Closed shohu closed 6 years ago
launch c0band
# c0band -server -regtest -listen -rpcallowip=0.0.0.0/0 -port=3883 -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 -connect=c0ban-test:3883 -daemon -debug
create block
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 generate 101
create addresses
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 getnewaddress testA n1WbaxNGPbD7Eraf517vudYZwhW4Vhy69h # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 getnewaddress testB mrFUEhMu4dUHHS8sJyGv18XwaJF82MqrbZ # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 listaccounts { "": 22000.00000000, "testA": 0.00000000, "testB": 0.00000000 }
move RYO to new address
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 sendtoaddress n1WbaxNGPbD7Eraf517vudYZwhW4Vhy69h 100 4324ac88d4da74e9d23d630eb7a4574b47ddbf3cde4d1d5d903c5bdfda6c799f # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 sendtoaddress "n1WbaxNGPbD7Eraf517vudYZwhW4Vhy69h" 100 b5f2b6f6c7bc7bd394382ea81c8afbba5609f1579040477d094b185632600485 # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 generate 1 [ "2e96606368d4f1e3cf79d72d966cbdf56d49465b3baf474ece5deef08b2ef300" ] # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 getinfo { "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16", "version": 150101, "protocolversion": 70015, "walletversion": 139900, "balance": 43999.99991640, "blocks": 102, "timeoffset": 0, "connections": 2, "proxy": "", "difficulty": 4.656542373906925e-10, "testnet": false, "keypoololdest": 1528986128, "keypoolsize": 1999, "paytxfee": 0.00000000, "relayfee": 0.00001000, "errors": "" }
Go to the separete block height
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 generate 10 [ "2a8af21b522ba4c896aa5050e54bf941f241a07a16c1c48edec52c91ee42bb4a", "3c196d03cf2ee44da29bba15ddbe3aeb834c3f7233deccfc738b73b2d3c1a631", "2189c2c4a081741e7188d67ab276939567ca4ebc3190582bed253e57dc96e152", "47132133092ac3b90e35f458df4d0edb391179b8823411e1902a53ffb27951d7", "52ebaedf6f8e51412c2b1d29d59c9ec8c49e637f4100176a89ae476307baa194", "034bcbba21a7f87408ffede531b81c04b8989595dcf05fab2087adde9fd85b56", "4c156c7dcf9eb463760f8d705d0d551de36f7ff3bfa008042e069e5ab5bddbf6", "61685c1ce1414327377e5855ecb9a68e6dd9efe5d3d5694596081bb15c9def08", "5fda85e79e5d70c1a5aae24bc3e8a148f19177353c6f15483b9ab5f09898396c", "68bea0ba445ea07d22569eb99978a72105922fcc83e94113c972c57b276d8523" ] # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 getinfo { "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16", "version": 150101, "protocolversion": 70015, "walletversion": 139900, "balance": 263999.99991640, "blocks": 112, "timeoffset": 0, "connections": 1, "proxy": "", "difficulty": 4.656542373906925e-10, "testnet": false, "keypoololdest": 1528986128, "keypoolsize": 1999, "paytxfee": 0.00000000, "relayfee": 0.00001000, "errors": "" }
# c0band-lyra2rev2 -server -regtest -listen -rpcallowip=0.0.0.0/0 -port=3883 -rpcuser=c0ban -rpcpassword=c0ban -connect=c0ban-15-ubuntu:3883 -rpcport=3882 -daemon -debug # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 getinfo { "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16", "version": 150101, "protocolversion": 70015, "walletversion": 139900, "balance": 0.00000000, "blocks": 109, "timeoffset": 0, "connections": 1, "proxy": "", "difficulty": 4.656542373906925e-10, "testnet": false, "keypoololdest": 1528986134, "keypoolsize": 2000, "paytxfee": 0.00000000, "relayfee": 0.00001000, "errors": "" }
generate block
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 generate 100 # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 getinfo { "deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16", "version": 150101, "protocolversion": 70015, "walletversion": 139900, "balance": 0.00000000, "blocks": 209, "timeoffset": 0, "connections": 0, "proxy": "", "difficulty": 1, "testnet": false, "keypoololdest": 1528986134, "keypoolsize": 1999, "paytxfee": 0.00000000, "relayfee": 0.00001000, "errors": "" }
restart c0band
# pkill -f sha256d c0band # c0band -server -regtest -listen -rpcallowip=0.0.0.0/0 -port=3883 -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 -daemon -debug
restart lyra2rev2 c0band
c0band-lyra2rev2 -server -regtest -listen -rpcallowip=0.0.0.0/0 -port=3883 -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 -daemon -debug
check utxo
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 listunspent 1 9999999 '["n1WbaxNGPbD7Eraf517vudYZwhW4Vhy69h"]' [ { "txid": "b5f2b6f6c7bc7bd394382ea81c8afbba5609f1579040477d094b185632600485", "vout": 1, "address": "n1WbaxNGPbD7Eraf517vudYZwhW4Vhy69h", "account": "testA", "scriptPubKey": "76a914db513aa05f854f5b50607bf59ff53b02c9dd41e388ac", "amount": 100.00000000, "confirmations": 11, "spendable": true, "solvable": true, "safe": true }, { "txid": "4324ac88d4da74e9d23d630eb7a4574b47ddbf3cde4d1d5d903c5bdfda6c799f", "vout": 1, "address": "n1WbaxNGPbD7Eraf517vudYZwhW4Vhy69h", "account": "testA", "scriptPubKey": "76a914db513aa05f854f5b50607bf59ff53b02c9dd41e388ac", "amount": 100.00000000, "confirmations": 11, "spendable": true, "solvable": true, "safe": true } ]
testA send c0ban to testB
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 createrawtransaction '[{"txid":"b5f2b6f6c7bc7bd394382ea81c8afbba5609f1579040477d094b185632600485","vout":1}]' '{"mrFUEhMu4dUHHS8sJyGv18XwaJF82MqrbZ":99.99950000}' 02000000018504603256184b097d47409057f10956bafb8a1ca82e3894d37bbcc7f6b6f2b50100000000ffffffff01b0200b54020000001976a91475bbb8ffb3edc51265ac198a7067b6160ba1ff4a88ac00000000 # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 signrawtransaction 02000000018504603256184b097d47409057f10956bafb8a1ca82e3894d37bbcc7f6b6f2b50100000000ffffffff01b0200b54020000001976a91475bbb8ffb3edc51265ac198a7067b6160ba1ff4a88ac00000000 { "hex": "02000000018504603256184b097d47409057f10956bafb8a1ca82e3894d37bbcc7f6b6f2b5010000006a4730440220453d057eb5b7b5d7746ab59825cab403470ef4a9cbd170f64917ac1e684060bb022046e4adf6b4098dabe9ffdeb59b582430270b1bac732a2348c120758e0a577873012102517eb4e0b81a8eb692b03648dbbe31fe7abed23ff84b441b3e1bfc1ba2b86006ffffffff01b0200b54020000001976a91475bbb8ffb3edc51265ac198a7067b6160ba1ff4a88ac00000000", "complete": true } # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 sendrawtransaction 02000000018504603256184b097d47409057f10956bafb8a1ca82e3894d37bbcc7f6b6f2b5010000006a4730440220453d057eb5b7b5d7746ab59825cab403470ef4a9cbd170f64917ac1e684060bb022046e4adf6b4098dabe9ffdeb59b582430270b1bac732a2348c120758e0a577873012102517eb4e0b81a8eb692b03648dbbe31fe7abed23ff84b441b3e1bfc1ba2b86006ffffffff01b0200b54020000001976a91475bbb8ffb3edc51265ac198a7067b6160ba1ff4a88ac00000000 f45b5910f3473ba016b6310d6e3dca7caf92c2d12a9e6e1530e67c911cab6bc2 # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 generate 1 [ "5d05b1da2f4881ae3ba04569e7f006dc8a7b96eac08f14088e2bd7a04f671076" ] # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 listaccounts { "": 285699.99991640, "testA": 200.00000000, "testB": 99.99950000 }
check transaction code
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 getrawtransaction f45b5910f3473ba016b6310d6e3dca7caf92c2d12a9e6e1530e67c911cab6bc2 02000000018504603256184b097d47409057f10956bafb8a1ca82e3894d37bbcc7f6b6f2b5010000006a4730440220453d057eb5b7b5d7746ab59825cab403470ef4a9cbd170f64917ac1e684060bb022046e4adf6b4098dabe9ffdeb59b582430270b1bac732a2348c120758e0a577873012102517eb4e0b81a8eb692b03648dbbe31fe7abed23ff84b441b3e1bfc1ba2b86006ffffffff01b0200b54020000001976a91475bbb8ffb3edc51265ac198a7067b6160ba1ff4a88ac00000000
send transaction (replay attack)
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 sendrawtransaction 02000000018504603256184b097d47409057f10956bafb8a1ca82e3894d37bbcc7f6b6f2b5010000006a4730440220453d057eb5b7b5d7746ab59825cab403470ef4a9cbd170f64917ac1e684060bb022046e4adf6b4098dabe9ffdeb59b582430270b1bac732a2348c120758e0a577873012102517eb4e0b81a8eb692b03648dbbe31fe7abed23ff84b441b3e1bfc1ba2b86006ffffffff01b0200b54020000001976a91475bbb8ffb3edc51265ac198a7067b6160ba1ff4a88ac00000000 f45b5910f3473ba016b6310d6e3dca7caf92c2d12a9e6e1530e67c911cab6bc2 # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 generate 1 [ "068bcccd1478621e7c481e1f9cfccec89431a252a7300aa6637178882735c628" ]
get privatekey
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 dumpprivkey mrFUEhMu4dUHHS8sJyGv18XwaJF82MqrbZ cThYH1mGbcCURDArCXsg5Ax7HTmNLBynN8ETWe729u8BzQqDUZcv
import wallet info
# c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 importprivkey cThYH1mGbcCURDArCXsg5Ax7HTmNLBynN8ETWe729u8BzQqDUZcv # c0ban-cli -rpcuser=c0ban -rpcpassword=c0ban -rpcport=3882 listunspent [ { "txid": "f45b5910f3473ba016b6310d6e3dca7caf92c2d12a9e6e1530e67c911cab6bc2", "vout": 0, "address": "mrFUEhMu4dUHHS8sJyGv18XwaJF82MqrbZ", "account": "", "scriptPubKey": "76a91475bbb8ffb3edc51265ac198a7067b6160ba1ff4a88ac", "amount": 99.99950000, "confirmations": 1, "spendable": true, "solvable": true, "safe": true },
Preparation
node A
launch c0band
create block
create addresses
move RYO to new address
Go to the separete block height
node B
launch c0band
generate block
Separate Node
node A
restart c0band
node B
restart lyra2rev2 c0band
noda A
check utxo
testA send c0ban to testB
check transaction code
replay attack
node B
send transaction (replay attack)
node A
get privatekey
node B
import wallet info