6
4
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:
- A working testnet example of the question posed above (detailed further here) (I'll offer a bounty for this)
- Constructing a multisig Tx of form:
(1 KEY1 KEY2 2 CHECKMULTISIG) OR MASTERKEY
2Just a quick question: are you checking the output number in the transaction you are spending? It seems strange you can reproduce the transaction only at times.Your successful transaction in "prev_out": has "n": 1 but the output number in the previous transaction is likely to be different each time. How do you create the transaction? With bitcoin-cli createrawtransaction? – halftimepad – 2015-06-23T22:57:23.157
1@halftimepad both pybitcointools and Bitcoin core – Wizard Of Ozzie – 2015-06-24T01:13:36.537
Do you have at hand the hex raw transaction for one case where you could reproduce the transaction and for one where you couldn't? With that I can tell you if it is a problem with the output number. – halftimepad – 2015-06-24T07:45:02.747
@halftimepad sounds good, I'll check my iPython logs – Wizard Of Ozzie – 2015-06-25T01:41:37.430
@wizard-of-ozzie its been a while since you asked, do you still need help with the issue? – sr-gi – 2017-03-16T12:20:44.257