Skip to content

Instantly share code, notes, and snippets.

Matias Alejo Garcia matiu

  • Bitpay Inc.
  • Tucuman, Argentina
Block or report user

Report or block matiu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
matiu / gist:f7b4afb3781c9f7c735435f19602db31
Last active Apr 22, 2019
Test new opcodes - bitcoin Cash
View gist:f7b4afb3781c9f7c735435f19602db31
  1. run bitcoin-abc with: ./bitcoind -regtest -monolithactivationtime=0
  2. create some UTXOs: ./bitcoin-cli generate 100
  3. grab one UTXO: ./bitcoin-cli listunspent (grab the last TXIDs, vout; we will call them here: TXID: 64be40b2688e8767fc62f8556d3b9ee608aae28894b867f8228ac5aa74325aff vout: 0
  4. 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
  5. sign it:
// cryto exports:
return Bitcore.crypto.Hash.sha256(pk.toBuffer()).slice(0, 16).toString('base64');
// priv key validation
$.checkArgument(Bitcore.PrivateKey.isValid(privKey), 'The private key received is invalid');
matiu / check.js
Created Mar 7, 2019
Checking a jsonPaymentProtocol signature witih bitcore-lib
View check.js
const B = require('bitcore-lib');
// Example signature, from an actual jsonPaymentProtocol header.
const h ='6d580c9bc2fbaff7614e3a030d536417d07d6dfb93f7c8887aac4e67e27c3e32';
const s ='e7a6490572855eb8feedabe32872424a2aef5b0b0f6e8b7d1959f6621de8c15a3871283a8fa78fc292444c50dc578dc58bd924d947f2ecc4bb91c250885a518a';
const p ='03159069584176096f1c89763488b94dbc8d5e1fa7bf91f50b42f4befe4e45295a';
hbuf = Buffer.from(h,'hex');
View json
[client.js.128:payload:] [{"address":"qqgpzjullztrd0xmsvsepxl6hp575pmjsyxwyaddp4"},{"address":"qrw5340g4tt3nk47sl5zpqph5y2gd6rddswc0qaa50"},{"address":"qzy0n4tq50lpjhe560uggpvxl4j28gykcu4n4tdw8r"},{"address":"qp90c6s67nayptr8jkmnp922r5vnxg8x45zcxp7e0n"},{"address":"qzd9r0xpcd8gvd7h7qcxzcnt7z443576wsjfwkcdrr"},{"address":"qz3wv55hyqz2edh4lkt4ff6z2k276363guvypvsl6x"},{"address":"qp4wpn3mkgm2jmv9ccxwu33jpcexf7fgpqg4uzk69l"},{"address":"qrp6s5jjudzs4e8h83g3j8hgaq3dlr2mxg6g0lw7yq"},{"address":"qpupl5x86jzw79spqfm8j3nyqdnd0uhpvqdwtvu4ej"},{"address":"qrxpsy8vacx9n8yfdcyv8n9nz9mfnxaagvk8624dlt"},{"address":"qqq06s8z509gxtqcn4z0znhtt767rqzu7vuwuljrs9"},{"address":"qq77x54g58jtgpqk8tpdhzmrn5s64azqzgkxxdr7g7"},{"address":"qzu3azwgj7ctv52eugxnd5zkvdfl5mtf7ucpf0uuc4"},{"address":"qqlwf0du4qecv8ddtscu5y5g43php2q4rqxwwlr3gs"},{"address":"qpmv900hcfv8mqqh9jzxxc2zh2m7hjuqyuhjhf3393"},{"address":"qrfqmzyft2jmhdkc4kqkweclhdvus6s4lqzpflpdq5"},{"address":"qpm92wzak9muxxtyc7n8ktj32tsj9j3h55anajghxh"},{"address":"qzmdasezmcclulnfd
View gist:bdd5e55ff0ad90b54261
server {
listen 80;
root /your/home/insight;
access_log /your/home/insight-log/livenet-access.log;
error_log /your/home/insight-log/livenet-error.log;
location / {
proxy_pass http://localhost:3000;
matiu /
Created Nov 29, 2018
Copay and Bitpay Wallet Network Restrictions

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'; 
  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.

matiu / gist:11182987
Created Apr 22, 2014
Creating and testing p2sh multisig bitcoin transactions
View gist:11182987
$bitcoind getinfo
"version" : 99900,
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : 15.74900000,
"blocks" : 226032,
"timeoffset" : -4,
"connections" : 9,
matiu / gist:61c9f529efeeba66c0e2
Created Jun 3, 2015
How to verify Copay file signatures
View gist:61c9f529efeeba66c0e2
  1. Download signature file
  2. Check it by running:
$ gpg --verify \
 $FILENAME.sig \

# If should say:

 "Good signature from "Copay (visit <>"
View OP Codes test plan
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
View gist:36cc194080dfb63da55d


Copay is an open-source multisig wallet. Each peer is has control of her private keys, that never leave their system.

Copay is implemented in JS client-side. It can work as a:

  • web app,
  • a webview based mobile app,
  • or a node-kit based desktop app.
You can’t perform that action at this time.