var clientSign = function(tx, xpriv, n) {
//Derive proper key to sign, for each input
var privs = [],
derived = {};
var xpriv = new Bitcore.HDPrivateKey(someXPrivKey[0]);
_.each(tx.inputs, function(i) {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = require('bitcore'); | |
var priv = new b.PrivateKey(); | |
var pub = new b.PublicKey(priv); | |
var inputs = | |
[ { txid: 'e872a0fda0afd0bce31ddfd9229c9eca2a68e4746615b8a0902b7a657b83676d', | |
vout: 8, | |
amount: 100, | |
scriptPubKey: b.Script.buildPublicKeyHashOut(pub).toBuffer().toString('hex') } ] ; |
Hoy
var storage = new Client.FileStorage({
filename: args.file || process.env['BIT_FILE'],
});
var c = new Client({
storage: storage,
baseUrl: args.host || process.env['BIT_HOST'],
verbose: args.verbose,
});
There are 3 tiers of access control
- Access is controlled at the server
All requests to an existing wallet must be signed by a private key and are verified by the server. All copayers have
a always valid private key, m/1/1
, and can generate more with restricted access thru the grantAccess
removeAccess
API.
Extra access keys pairs are always derived from the extended master private key using m/1/x
.
- createTX
- output: 1bitcoin
- amount: 1BTC
- useCoinJoin: true
- coinJoinToSignTimeout: 1hr
- coinJoinToBroadcastTimeout: 24hr
- coinJoinTimeoutPolicy: broadcastWithoutCoinJoin | rejectByServer
- Download signature file
- Check it by running:
$ gpg --verify \
$FILENAME.sig \
$FILENAME
# If should say:
"Good signature from "Copay (visit copay.io) "
- run bitcoin-abc with:
./bitcoind -regtest -monolithactivationtime=0
- create some UTXOs:
./bitcoin-cli generate 100
- grab one UTXO:
./bitcoin-cli listunspent
(grab the last TXIDs, vout; we will call them here: TXID: 64be40b2688e8767fc62f8556d3b9ee608aae28894b867f8228ac5aa74325aff vout: 0 - create a TX with the script you want to test, using P2SH:
bitcoin-tx -regtest -json -create in=64be40b2688e8767fc62f8556d3b9ee608aae28894b867f8228ac5aa74325aff:0 outscript=49.999:"XOR 1 DUP":S
(last :S is to use P2SH) => hex: 0200000001ff5a3274aac58a22f867b89488e2aa08e69e3b6d55f862fc67878e68b240be640000000000ffffffff01606b042a0100000017a9145944649bbd7f8d554b993e74f7b7884d2c78a2908700000000 - sign it:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using bitcoin-abc 0.17 hash: 855043153da2d7d5d4d577eede5ecf22f2c87080, | |
running bitcoind with: `-regtest -monolithactivationtime=0` | |
1. Base line | |
- send 10 p2pkh TX/s, 10 seconds. Check CPU and IO load. | |
- send 10 (small) op_ret TX/s, 100 seconds. Check CPU and IO load and mem usage. | |
2. Tests |
To prevent unautorized network access, Copay and Bitpay Wallet v5.3.0 and above use the following Content Security Policy (CSP)
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval' https://bws.bitpay.com
https://bitpay.com https://auth.shapeshift.io https://shapeshift.io https://api.coinbase.com https://coinbase.com;
img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:">
This restrict network connections to the listed hosts only. As a consecuence, accessing self-hosted Bitcore Wallet Service (BWS) hosts will not be allowed.