New Bitcoin Script


SUBMITTED BY: bitminter

DATE: Sept. 14, 2016, 10:25 a.m.

FORMAT: Text only

SIZE: 728 Bytes

HITS: 4558

  1. // create a new 2-of-3 multisig output from 3 given public keys
  2. var pubkeys = [
  3. new PublicKey('022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da'),
  4. new PublicKey('03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9'),
  5. new PublicKey('021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18'),
  6. ];
  7. var threshold = 2;
  8. var script = Script.buildMultisigOut(pubkeys, threshold);
  9. assert(script.toString() === 'OP_2 33 0x022df8750480ad5b26950b25c7ba79d3e37d75f640f8e5d9bcd5b150a0f85014da'
  10. + ' 33 0x03e3818b65bcc73a7d64064106a859cc1a5a728c4345ff0b641209fba0d90de6e9'
  11. + ' 33 0x021f2f6e1e50cb6a953935c3601284925decd3fd21bc445712576873fb8c6ebc18 OP_3 OP_CHECKMULTISIG');

comments powered by Disqus