Skip to content

Instantly share code, notes, and snippets.

@maraoz
maraoz / gist:9834017
Last active August 29, 2015 13:57 — forked from matiu/gist:9833812
/* create and sign */
var tx = TransactionBuilder.init(opts)
.addUtxos(utxos)
.addOutputs(outs)
.addKeys(keys)
.build();
broadcast(tx.serialize());
@maraoz
maraoz / gist:10297571
Created April 9, 2014 17:59
ci.testling.com build output for bitpay/bitcore
Traceback (most recent call last):
File "/testling/bin/node-v0.10.24/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 18, in <module>
sys.exit(gyp.script_main())
File "/testling/bin/node-v0.10.24/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 534, in script_main
return main(sys.argv[1:])
File "/testling/bin/node-v0.10.24/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 527, in main
return gyp_main(args)
File "/testling/bin/node-v0.10.24/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 503, in gyp_main
options.circular_check)
File "/testling/bin/node-v0.10.24/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 129, in Load
@maraoz
maraoz / gist:10776497
Created April 15, 2014 21:20
is this secure from browser extensions inspecting the secret value?
var Hasher = (function(){
var secret = 42;
var Hasher = function() {
};
Hasher.prototype.setSecret = function(s) {
secret = s;
};
Hasher.prototype.hash = function(x) {
@maraoz
maraoz / gist:51a0018ecf9afcd3c007
Last active August 29, 2015 14:01
m-of-n finder script output with scriptSig < 500 bytes limit
case 1-of-1
max size: 113
case 1-of-2
max size: 147
case 2-of-2
max size: 221
case 1-of-3
max size: 182
case 2-of-3
@maraoz
maraoz / gist:8393f72a998bae58d585
Created June 11, 2014 19:16
bip32 non-deterministic derivation bug
var hk = new HierarchicalKey('tprv8ZgxMBicQKsPdSF1avR6mXyDj5Uv1XY2UyUHSDpAXQ5TvPN7prGeDppjy4562rBB9gMMAhRfFdJrNDpQ4t69kkqHNEEen3PX1zBJqSehJDH');
console.log(hk.derive('m/45/0/0/0').extendedPrivateKeyString());
console.log(hk.derive('m/45/0/0/0').extendedPrivateKeyString());
console.log(hk.derive('m/45\'/0/0/0').extendedPrivateKeyString());
console.log(hk.derive('m/45\'/0/0/0').extendedPrivateKeyString());
Outputs:
tprv8iDdrJ7doYBh2MpWDAPHopqUZ8jftExnk3v98yGFfEJPAfUBszoswxqg5doKrQS7whF6q5Q4cdK2Bdn3HWA4tURnjdPyPv83fpuamjELFmP
tprv8iDdrJ7doYBh2MpWDAPHopqUZ8jftExnk3v98yGFfEJPAfUBszoswxqg5doKrQS7whF6q5Q4cdK2Bdn3HWA4tURnjdPyPv83fpuamjELFmP
@maraoz
maraoz / gist:1f07abe80e88291f8bc9
Created July 21, 2014 18:07
Copay new architecture thoughts
The objectives are:
- make copay work in all platforms.
- make it as decentralized as possible.
- allow async operations (mainly transaction proposals)
- allow remote encrypted key storage
### Keybase proof
I hereby claim:
* I am maraoz on github.
* I am maraoz (https://keybase.io/maraoz) on keybase.
* I have a public key whose fingerprint is B27B D36C DF12 AA21 2788 E780 64F3 727B FE0B 3196
To claim this, I am signing this object:
io.sockets.on('connection', function(socket) {
wrapper(socket).pipe(process.stdout);
};
@maraoz
maraoz / gist:99c8b306861ef74f9ca0
Created November 18, 2014 13:06
onename.io proof
Verifying that +maraoz is my openname (Bitcoin username). https://onename.io/maraoz
@maraoz
maraoz / gist:e4accbe567deafefd797
Created November 21, 2014 19:53
Bitcore default network configuration
var bitcore = require('bitcore');
// Returns a livenet address
var address = new bitcore.PrivateKey().toAddress();
// Returns a testnet address
var address = new bitcore.PrivateKey().toAddress(bitcore.testnet);
bitcore.defaultNetwork = bitcore.testnet;