Appendix D. Bitcore
Bitcore is a suite of tools provided by BitPay. Its goal is to provide easy-to-use tools for Bitcoin developers. Almost all of Bitcore’s code is written in JavaScript. There are some modules written specifically for NodeJS. Finally, the “node” module of Bitcore includes Bitcoin Core’s C++ code. Please see https://bitcore.io for more information.
Bitcore’s Feature List
-
Bitcoin full node (bitcore-node)
-
Block explorer (insight)
-
Block, transaction, and wallet utilities (bitcore-lib)
-
Communicating directly with Bitcoin’s P2P network (bitcore-p2p)
-
Seed entropy mnemonic generation (bitcore-mnemonic)
-
Payment protocol (bitcore-payment-protocol)
-
Message verification and signing (bitcore-message)
-
Elliptic curve Integrated Encryption Scheme (bitcore-ecies)
-
Wallet service (bitcore-wallet-service)
-
Wallet client (bitcore-wallet-client)
-
Playground (bitcore-playground)
-
Integrating services directly with Bitcoin Core (bitcore-node)
Bitcore Library Examples
Prerequisities
-
NodeJS >= 4.x or use our hosted online playground
If using NodeJS and the node REPL:
$npm install -g bitcore-lib bitcore-p2p$ NODE_PATH=$(npm list -g|head -1)/node_modules node
Wallet Examples using bitcore-lib
Creating a new bitcoin address with associated private key:
> bitcore = require('bitcore-lib')
> privateKey = new bitcore.PrivateKey()
> address = privateKey.toAddress().toString()
Creating a hierarchical deterministic private key and address:
> hdPrivateKey = bitcore.HDPrivateKey() ...