Last active
June 3, 2018 06:10
-
-
Save planethouki/ed43ab949d56a5a7e5fb8cf8c20233ce to your computer and use it in GitHub Desktop.
Bitcoinトランザクション作成手順 通常のP2PKH ref: https://qiita.com/planethouki/items/1ab965b771731e2a27b6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<root> | |
└─bitcoin-0.15.1 | |
├─bin | |
├─data | |
│ └─regtest | |
│ ├─blocks | |
│ │ └─index | |
│ ├─chainstate | |
│ └─database | |
├─include | |
├─lib | |
└─share | |
└─man | |
└─man1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> cd bitcoin-0.15.1 | |
> mkdir data | |
> cd bin | |
> bitcoind -datadir="..\data" -regtest -printtoconsole -rpcuser=<user> -rpcpassword=<password> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli getnewaddress | |
migTFvPH42S3ho4q8axgtzqvxfhMb6eyX3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli createrawtransaction ^ | |
"[{\"txid\":\"e9f47fc69c82f798232f267e8afedb274145486b788e98a9d685abf16e62cad9\",\"vout\":0}]" ^ | |
"{\"migTFvPH42S3ho4q8axgtzqvxfhMb6eyX3\":1, \"mgN7gJqdgvP7wzMUAGyy581jtWyHRucA7G\":48.99}" | |
0200000001d9ca626ef1ab85d6a9988e786b48454127dbfe8a7e262f2398f7829cc67ff4e90000000000ffffffff0200e1f505000000001976a91422b44c5ce463fe601d106ed03a257d016c5ba94a88acc0ce0024010000001976a914094c371a210733be6e977ece1d621ce735d38f8f88ac00000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli signrawtransaction 0200000001d9ca626ef1ab85d6a9988e786b48454127dbfe8a7e262f2398f7829cc67ff4e90000000000ffffffff0200e1f505000000001976a91422b44c5ce463fe601d106ed03a257d016c5ba94a88acc0ce0024010000001976a914094c371a210733be6e977ece1d621ce735d38f8f88ac00000000 | |
{ | |
"hex": "0200000001d9ca626ef1ab85d6a9988e786b48454127dbfe8a7e262f2398f7829cc67ff4e90000000049483045022100ecd7ce8052ec7eb26f8ea5a5403db24c1df372faab8074f73304c951663e09910220699477fd659b931f2d441b4bebffc66c2171cc9b0d164642b9f9df0e10dd8a5c01ffffffff0200e1f505000000001976a91422b44c5ce463fe601d106ed03a257d016c5ba94a88acc0ce0024010000001976a914094c371a210733be6e977ece1d621ce735d38f8f88ac00000000", | |
"complete": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli signrawtransaction 0200000001d9ca626ef1ab85d6a9988e786b48454127dbfe8a7e262f2398f7829cc67ff4e90000000000ffffffff0200e1f505000000001976a91422b44c5ce463fe601d106ed03a257d016c5ba94a88acc0ce0024010000001976a914094c371a210733be6e977ece1d621ce735d38f8f88ac00000000 ^ | |
"[{\"txid\":\"e9f47fc69c82f798232f267e8afedb274145486b788e98a9d685abf16e62cad9\",\"vout\":0,\"scriptPubKey\":\"2102d519802343386e8c73c7c6395b5d2af39ef03507cacd290c49ac1bd7162c6c9fac\",\"amount\":50}]" ^ | |
"[\"cMiGJFYmKcWmmXAjgv294X8AtgxV2oXk4owP6WeYSJ8xVwFnWUqr\"]" | |
{ | |
"hex": "0200000001d9ca626ef1ab85d6a9988e786b48454127dbfe8a7e262f2398f7829cc67ff4e90000000049483045022100ecd7ce8052ec7eb26f8ea5a5403db24c1df372faab8074f73304c951663e09910220699477fd659b931f2d441b4bebffc66c2171cc9b0d164642b9f9df0e10dd8a5c01ffffffff0200e1f505000000001976a91422b44c5ce463fe601d106ed03a257d016c5ba94a88acc0ce0024010000001976a914094c371a210733be6e977ece1d621ce735d38f8f88ac00000000", | |
"complete": true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli sendrawtransaction 0200000001d9ca626ef1ab85d6a9988e786b48454127dbfe8a7e262f2398f7829cc67ff4e90000000049483045022100ecd7ce8052ec7eb26f8ea5a5403db24c1df372faab8074f73304c951663e09910220699477fd659b931f2d441b4bebffc66c2171cc9b0d164642b9f9df0e10dd8a5c01ffffffff0200e1f505000000001976a91422b44c5ce463fe601d106ed03a257d016c5ba94a88acc0ce0024010000001976a914094c371a210733be6e977ece1d621ce735d38f8f88ac00000000 | |
5a94d7dd97b8c1547b9d50f3a3e5ebf0deb8471202faada59e4ac90fee31ef09 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli generate 1 | |
[ | |
"0cc6baf17028e7641c40b4e1cbf92635c827e2b8d8d8a19fd59af16933a8e2f4" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli getblock 0cc6baf17028e7641c40b4e1cbf92635c827e2b8d8d8a19fd59af16933a8e2f4 | |
{ | |
"hash": "0cc6baf17028e7641c40b4e1cbf92635c827e2b8d8d8a19fd59af16933a8e2f4", | |
"confirmations": 1, | |
"strippedsize": 419, | |
"size": 419, | |
"weight": 1676, | |
"height": 105, | |
"version": 536870912, | |
"versionHex": "20000000", | |
"merkleroot": "c9a115a84518e8bd69b757e59704db39c3843df4904c440fc99c9534a9e1bb45", | |
"tx": [ | |
"1ca6d235d8962d8f4e96803b545ea988789f84df1b2256d63bc3e0f72661fb25", | |
"5a94d7dd97b8c1547b9d50f3a3e5ebf0deb8471202faada59e4ac90fee31ef09" | |
], | |
"time": 1527931653, | |
"mediantime": 1527927165, | |
"nonce": 0, | |
"bits": "207fffff", | |
"difficulty": 4.656542373906925e-010, | |
"chainwork": "00000000000000000000000000000000000000000000000000000000000000d4", | |
"previousblockhash": "44520f6c0ff71be72df52d1da16284009c1d9acd50c0b66dff0db92fc890abdf" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli gettransaction 5a94d7dd97b8c1547b9d50f3a3e5ebf0deb8471202faada59e4ac90fee31ef09 | |
{ | |
"amount": 0.00000000, | |
"fee": -0.01000000, | |
"confirmations": 1, | |
"blockhash": "0cc6baf17028e7641c40b4e1cbf92635c827e2b8d8d8a19fd59af16933a8e2f4", | |
"blockindex": 1, | |
"blocktime": 1527931653, | |
"txid": "5a94d7dd97b8c1547b9d50f3a3e5ebf0deb8471202faada59e4ac90fee31ef09", | |
"walletconflicts": [ | |
], | |
"time": 1527931624, | |
"timereceived": 1527931624, | |
"bip125-replaceable": "no", | |
"details": [ | |
{ | |
"account": "", | |
"address": "migTFvPH42S3ho4q8axgtzqvxfhMb6eyX3", | |
"category": "send", | |
"amount": -1.00000000, | |
"label": "", | |
"vout": 0, | |
"fee": -0.01000000, | |
"abandoned": false | |
}, | |
{ | |
"account": "", | |
"address": "migTFvPH42S3ho4q8axgtzqvxfhMb6eyX3", | |
"category": "receive", | |
"amount": 1.00000000, | |
"label": "", | |
"vout": 0 | |
} | |
], | |
"hex": "0200000001d9ca626ef1ab85d6a9988e786b48454127dbfe8a7e262f2398f7829cc67ff4e90000000049483045022100ecd7ce8052ec7eb26f8ea5a5403db24c1df372faab8074f73304c951663e09910220699477fd659b931f2d441b4bebffc66c2171cc9b0d164642b9f9df0e10dd8a5c01ffffffff0200e1f505000000001976a91422b44c5ce463fe601d106ed03a257d016c5ba94a88acc0ce0024010000001976a914094c371a210733be6e977ece1d621ce735d38f8f88ac00000000" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli -regtest -rpcuser=<user> -rpcpassword=<password> help | |
== Blockchain == | |
getbestblockhash | |
getblock "blockhash" ( verbosity ) | |
getblockchaininfo | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> notepad.exe %AppData%\Bitcoin\bitcoin.conf | |
rpcuser=<user> | |
rpcpassword=<password> | |
regtest=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli generate 101 | |
> bitcoin-cli getbalance | |
50.00000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bx-windows-x64-icu.exe help | |
Usage: bx COMMAND [--help] | |
Version: 3.2.0 | |
Info: The bx commands are: | |
address-decode | |
address-embed | |
address-encode | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli listunspent | |
[ | |
{ | |
"txid": "e9f47fc69c82f798232f267e8afedb274145486b788e98a9d685abf16e62cad9", | |
"vout": 0, | |
"address": "mgN7gJqdgvP7wzMUAGyy581jtWyHRucA7G", | |
"scriptPubKey": "2102d519802343386e8c73c7c6395b5d2af39ef03507cacd290c49ac1bd7162c6c9fac", | |
"amount": 50.00000000, | |
"confirmations": 101, | |
"spendable": true, | |
"solvable": true, | |
"safe": true | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli validateaddress mgN7gJqdgvP7wzMUAGyy581jtWyHRucA7G | |
{ | |
"isvalid": true, | |
"address": "mgN7gJqdgvP7wzMUAGyy581jtWyHRucA7G", | |
"scriptPubKey": "76a914094c371a210733be6e977ece1d621ce735d38f8f88ac", | |
"ismine": true, | |
"iswatchonly": false, | |
"isscript": false, | |
"pubkey": "02d519802343386e8c73c7c6395b5d2af39ef03507cacd290c49ac1bd7162c6c9f", | |
"iscompressed": true, | |
"timestamp": 1527927140, | |
"hdkeypath": "m/0'/0'/1'", | |
"hdmasterkeyid": "4e2f089e0447ed1214e127a6dd65bcec6a85aa8b" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bitcoin-cli dumpprivkey mgN7gJqdgvP7wzMUAGyy581jtWyHRucA7G | |
cMiGJFYmKcWmmXAjgv294X8AtgxV2oXk4owP6WeYSJ8xVwFnWUqr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> bx-windows-x64-icu.exe wif-to-ec cMiGJFYmKcWmmXAjgv294X8AtgxV2oXk4owP6WeYSJ8xVwFnWUqr | |
03e401f846cf5060ca812f3dd96109decf0193977be31dcbf07b3c055cb013a3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment