You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.4 KiB
2.4 KiB
Bitcore v0.8
Principles
Bitcoin is a powerful new peer-to-peer platform for the next generation of financial technology. The decentralized nature of the Bitcoin network allows for highly resilient bitcoin infrastructure, and the developer community needs reliable, open-source tools to implement bitcoin apps and services. Bitcore provides a reliable API for javascript apps that need to interface with Bitcoin.
To get started, just npm install bitcore
or bower install bitcore
.
Documentation Index
Addresses and Key Management
- Addresses
- Using different networks
- Private Keys and Public Keys
- Hierarchically-derived Private and Public Keys
Payment handling
- Using different Units
- Acknowledging and Requesting payments: Bitcoin URIs
- Payment Protocol Support
- The Transaction Class
Bitcoin internals
Networking
- Interface to the Bitcoin P2P network
- Managing a pool of peers
- Connecting to a bitcoind instance through JSON-RPC
- Connecting to a Insight instance to retrieve informetion
Extra
Module Development
Examples
Create a Private Key
var privKey = new bitcore.PrivateKey();
Create an Address
var privKey = new bitcore.PrivateKey();
var address = privKey.toAddress();
Create a Multisig Address
// Build a 2-of-3 address from public keys
var P2SHAddress = new bitcore.Address([publicKey1, publicKey2, publicKey3], 2);
Request a Payment
var paymentInfo = {
address: '1DNtTk4PUCGAdiNETAzQFWZiy2fCHtGnPx',
amount: 120000 //satoshis
};
var uri = new bitcore.URI(paymentInfo).toString();
Create a Transaction
var transaction = new Transaction()
.from(utxos) // Feed information about what unspent outputs one can use
.to(address, amount) // Add an output with the given amount of satoshis
.change(address) // Sets up a change address where the rest of the funds will go
.sign(privkeySet) // Signs all the inputs it can
Connect to the Network
var peer = new Peer('5.9.85.34');
peer.on('inv', function(message) {
// new inventory
});
peer.connect();