- run bitcoin-abc with:
./bitcoind -regtest -monolithactivationtime=0
- create some UTXOs:
./bitcoin-cli generate 100
- grab one UTXO:
./bitcoin-cli listunspent
(grab the last TXIDs, vout; we will call them here: TXID: 64be40b2688e8767fc62f8556d3b9ee608aae28894b867f8228ac5aa74325aff vout: 0 - 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 - sign it:
bitcoin-cli -regtest signrawtransaction 0200000001ff5a3274aac58a22f867b89488e2aa08e69e3b6d55f862fc67878e68b240be640000000000ffffffff01606b042a0100000017a9145944649bbd7f8d554b993e74f7b7884d2c78a2908700000000
=> . hex: 0200000001ff5a3274aac58a22f867b89488e2aa08e69e3b6d55f862fc67878e68b240be6400000000494830450221009835b056be12a08dc48a27f2903ad2d96c6d7ea9834dffad26aac3fd2d7be6e9022016bb4f08fdc391e3ca42fc4dc1345cb90d90e50e288360f30b16b544c1a7da6a41ffffffff01606b042a0100000017a9145944649bbd7f8d554b993e74f7b7884d2c78a2908700000000 - send it:
bitcoin-cli -regtest sendrawtransaction ./bitcoin-cli -regtest sendrawtransaction 0200000001ff5a3274aac58a22f867b89488e2aa08e69e3b6d55f862fc67878e68b240be6400000000494830450221009835b056be12a08dc48a27f2903ad2d96c6d7ea9834dffad26aac3fd2d7be6e9022016bb4f08fdc391e3ca42fc4dc1345cb90d90e50e288360f30b16b544c1a7da6a41ffffffff01606b042a0100000017a9145944649bbd7f8d554b993e74f7b7884d2c78a2908700000000 436b718f81336f01b586b298e65d412d913f9fe41d7a69b790b473e3fe0ede31
=> 436b718f81336f01b586b298e65d412d913f9fe41d7a69b790b473e3fe0ede31
==
- check it:
bitcoin-cli -regtest getrawtransaction 436b718f81336f01b586b298e65d412d913f9fe41d7a69b790b473e3fe0ede31 1
relevant portion (is it was created non-p2sh)
"vout": [
{
"value": 49.99900000,
"n": 0,
"scriptPubKey": {
"asm": "OP_XOR 1 OP_DUP",
"hex": "865176",
"type": "nonstandard"
}
}
==
- spend it:
나는�도데체모르겟다.도외�주는건지?�
�카카오뱅크�업로드시키다가�갑자기우리팅들이나티니는이유는�.ㅎ�
�반갑고강사.뭔진모르겟다�^^