You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varprivateKey=newbitcore.PrivateKey();varexported=privateKey.toWIF();// e.g. L3T1s1TYP9oyhHpXgkyLoJFGniEgkv2Jhi138d7R2yJ9F4QdDU2mvarimported=bitcore.PrivateKey.fromWIF(exported);varhexa=privateKey.toString();// e.g. 'b9de6e778fe92aa7edb69395556f843f1dce0448350112e14906efc2a80fa61a'
Create an Address
varaddress=privateKey.toAddress();
Create a Multisig Address
// Build a 2-of-3 address from public keysvarp2shAddress=newbitcore.Address([publicKey1,publicKey2,publicKey3],2);
vartransaction=newTransaction().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
varpeer=newPeer('5.9.85.34');peer.on('inv',function(message){// new inventory});peer.connect();
varMessage=require('bitcore-message');varprivateKey=newbitcore.PrivateKey('L23PpjkBQqpAF4vbMHNfTZAb3KFPBSawQ7KinFTzz7dxq6TZX8UA');varmessage=newMessage('This is an example of a signed message.');varsignature=message.sign(privateKey);
Verify a Bitcoin message
varMessage=require('bitcore-message');varaddress='13Js7D3q4KvfSqgKN8LpNq57gcahrVc5JZ';varsignature='IBOvIfsAs/da1e36W8kw1cQOPqPVXCW5zJgNQ5kI8m57FycZXdeFmeyoIqJSREzE4W7vfDmdmPk0HokuJPvgPPE=';varverified=newMessage('This is an example of a signed message.').verify(address,signature);