Working example of raw transaction utilising Boolean (OP_IF, OP_ENDIF) scripting REQUIRED

Working example of raw transaction utilising Boolean (OP_IF, OP_ENDIF) scripting REQUIRED

I recently posted this Testnet TX (TxID 2d0daa01da8294a54178f8111eb2a02010c425fd15957d8baee8717edcfbe105) which successfully spends an output (TxID 8d897ca91774a7fafa086a3275e679248d6bffee015d3b2efefd5dab00df152d) of form:

OP_DUP OP_HASH160 ##HASH160_KEY1## OP_EQUALVERIFY OP_CHECKSIGVERIFY OP_IF OP_DUP OP_HASH160 ##HASH160_KEY1## OP_EQUALVERIFY OP_CHECKSIG OP_ELSE OP_HASH256 ##HASH256_OF_SECRET## OP_EQUAL OP_ENDIF

Where ##HASH256_OF_SECRET## is sha256(sha256(3ceb50edd0282cd99dc59351f513dcdf)) and ##HASH160_KEYx## is the ripemd160(sha256(public key n)).

I have been trying for days using Python (pybitcointools library, Pycoin library, raw tx construction) and Bitcoincore, however I consistently cannot duplicate the Tx myself.

EDIT: added keys, code

Here's a duplicated Tx on Testnet: ed99a9d3c8da943c5140790349d000450209367c7cf24d1627df6b43ece8b9d4:1

Keys (from pycoin):

input                        : 98a6776b00481d69147af4f19982816d24b21f1e45bd6b9b6612969a805dff5d
network                      : Bitcoin testnet3
netcode                      : XTN
secret exponent              : 69045673789968930636498185430340997034503775217197653543201755869784347377501
 hex                         : 98a6776b00481d69147af4f19982816d24b21f1e45bd6b9b6612969a805dff5d
wif                          : cShS7YocDNMfpxHPd1iWbXX6eTFPQoNTJSw6W4sQY5BVimvvw6FY
 uncompressed                : 92k9QgqAnrFCWtwvA4neyJnngkZG3g43ne9BJuzBmeeirPHXtu3
public pair x                : 66609190448066768097937392847179714582119540337817974512409209527265330917500
public pair y                : 13690920648454078566739109880631240403596673427366917192400893160542072726114
 x as hex                    : 9343773d05d5a07f103914d5294ca742db124babd2c2cac5f84e6114f192f07c
 y as hex                    : 1e44c956c737a60369fbf4f5e6324dc005ba38d156f61232f9251fec8ee3e262
y parity                     : even
key pair as sec              : 029343773d05d5a07f103914d5294ca742db124babd2c2cac5f84e6114f192f07c
 uncompressed                : 049343773d05d5a07f103914d5294ca742db124babd2c2cac5f84e6114f192f07c\
                                 1e44c956c737a60369fbf4f5e6324dc005ba38d156f61232f9251fec8ee3e262
hash160                      : fd00f9fd452fee2214e8b0f9acf4c53496bd5636
 uncompressed                : 23dfc9ad6d857c92ad2b99004354067492cf464c
Bitcoin address              : n4aiRSJEm2gT9QrZTFJ7DJy3KPGnDHxybf
Bitcoin address uncompressed : mine2pMKAyoA6CBimPd1ZdFVi5kvhTM7TT

script = 76a914dd6cce9f255a8cc17bda8ba0373df8e861cb866e88ad6376a914e900510876cb689f1db6fa982376c301362b740c88ac67aa20644d79d87e0907833e888e272e5d7b925deb261a8499a65cbc0bf26797a15e8e8768

[118, 169, '23dfc9ad6d857c92ad2b99004354067492cf464c', 136, 173, 99, 118, 169, 'fd00f9fd452fee2214e8b0f9acf4c53496bd5636', 136, 172, 103, 170, '0757152190e14e5889b1270309d7c8e40219d45e04096fcb97d1b4c5a99064e1', 135, 104]

*mysecret* = '12345678'.decode('hex')
sha256(sha256(*mysecret*)) == 0757152190e14e5889b1270309d7c8e40219d45e04096fcb97d1b4c5a99064e1

I'm looking for a working guide on constructing a Testnet & P2SH Tx which utilises Boolean scripting. Specifically:

  1. A working testnet example of the question posed above (detailed further here) (I'll offer a bounty for this)
  2. Constructing a multisig Tx of form: (1 KEY1 KEY2 2 CHECKMULTISIG) OR MASTERKEY
http://ift.tt/2lfOTDR

Comments

Popular posts from this blog

Antminer D3 Blissz Modified Firmware For Improved Performance

ETH To The Moon / Bank of England Cryptocurrency? / BTC Dominance / More (The Crypt0 Minute)