1 multibit
https://multibit.org/download.html 比特币桌面钱包,用于创建比特币的钱包,钱包用户管理(支付、接收、购买、验证消息和网络)。目前可以通过keepkey(类似USB硬件)用来储存和安全保护钱包中的比特币。
multibit基于java开发,支持40多种语言,选择“选项”中的“语言”项可以切换相应的语言。
https://github.com/keepkey/multibit-hd
2 比特币客户端bitcoin-cli
== Blockchain ==
getbestblockhash
getblock "hash" ( verbose )
getblockchaininfo
getblockcount
getblockhash index
getblockheader "hash" ( verbose )
getchaintips
getdifficulty
getmempoolinfo
getrawmempool ( verbose )
gettxout "txid" n ( includemempool )
gettxoutproof ["txid",...] ( blockhash )
gettxoutsetinfo
verifychain ( checklevel numblocks )
verifytxoutproof "proof"
== Control ==
getinfo
{
"version": 120100, bitcoin核心客户端版本号
"protocolversion": 70012,
"walletversion": 60000, 钱包版本
"balance": 0.00000000, 钱包余额
"blocks": 5040, 客户端区块高度,告诉我们有多少区块对此客户端已知(5040)
"timeoffset": -1,
"connections": 8,
"proxy": "",
"difficulty": 1,
"testnet": false,
"keypoololdest": 1470823448,
"keypoolsize": 101, 比特币客户端维护的地址池,这些地址是自动生成的,可用于公共接收地址或零钱地址,可以通过getnewaddress获取其中的随机的地址
"paytxfee": 0.00000000,
"relayfee": 0.00001000,
"errors": ""
}
help ( "command" )
stop
== Generating ==
generate numblocks
getgenerate
setgenerate generate ( genproclimit )
== Mining ==
getblocktemplate ( "jsonrequestobject" )
getmininginfo
getnetworkhashps ( blocks height )
prioritisetransaction <txid> <priority delta> <fee delta>
submitblock "hexdata" ( "jsonparametersobject" )
== Network ==
addnode "node" "add|remove|onetry"
clearbanned
disconnectnode "node"
getaddednodeinfo dns ( "node" )
getconnectioncount
getnettotals
getnetworkinfo
getpeerinfo
listbanned
ping
setban "ip(/netmask)" "add|remove" (bantime) (absolute)
== Rawtransactions ==
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime )
decoderawtransaction "hexstring"
decodescript "hex"
fundrawtransaction "hexstring" includeWatching
getrawtransaction "txid" ( verbose )
sendrawtransaction "hexstring" ( allowhighfees )
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )
== Util ==
createmultisig nrequired ["key",...]
estimatefee nblocks
estimatepriority nblocks
estimatesmartfee nblocks
estimatesmartpriority nblocks
validateaddress "bitcoinaddress"
verifymessage "bitcoinaddress" "signature" "message"
== Wallet ==
abandontransaction "txid"
addmultisigaddress nrequired ["key",...] ( "account" )
backupwallet "destination"
.block目录下 wallet.dat 钱包文件备份;恢复的时候可以通过importwallet进行恢复
dumpprivkey "bitcoinaddress"
获取比特币地址对应的私钥;对于加密的钱包需要提前解锁(运行命令 walletpassphrase)
dumpwallet "filename"
dump钱包成可读文件的形式,dump之前需要对钱包进行解锁(walletpassphrase). 可读的文件部分摘录如下: # Wallet dump created by Bitcoin v0.12.1 (2016-04-11 13:01:43 +0200) # * Created on 2016-08-24T09:15:12Z # * Best block at time of backup was 3744 (000000004f1b3400f03671507732231a97159626500f394e46ad24ab92ffd31a), # mined on 2009-02-10T11:20:07Z L3V5izoZ8Hq6K9eUEgqssoYTHtHjj7wF676U3hUHo1XH7G6xE6pL 2016-08-24T08:45:17Z change=1 # addr=113RurSHYRtEc5rmufSpCxMst2f9nCUeAm L2yJLNfaSp1E8tkUmRob9ThMeaw8xmQcqztcqEMBvaCKDgUFra7s 2016-08-24T08:45:17Z change=1 # addr=15ebU1EQ8XTuEaMBKTXqVe9JwjEVH1o785
------------------------------------------------------------------------------------------------------------------------------
说明:dump文件内容中对应的是比特币addr以及地址对应的私钥,如地址addr=113RurSHYRtEc5rmufSpCxMst2f9nCUeAm 对应的私钥 L3V5izoZ8Hq6K9eUEgqssoYTHtHjj7wF676U3hUHo1XH7G6xE6pL
encryptwallet "passphrase"
[root@haproxy .bitcoin]# /opt/bitcoin-0.12.1/bin/bitcoin-cli getinfo { "version": 120100, "protocolversion": 70012, "walletversion": 60000, "balance": 0.00000000, "blocks": 544, "timeoffset": 0, "connections": 8, "proxy": "", "difficulty": 1, "testnet": false, "keypoololdest": 1472028341, "keypoolsize": 100, "unlocked_until": 0, //加密之后新增unlocked_until字节,表示钱包处于锁定状态(初始计数器为0);可以通过“bitcoin-cli walletpassphrase 钱包密码 解锁秒数”进行内存解锁,秒数到达后将会恢复锁定状态 "paytxfee": 0.00000000, "relayfee": 0.00001000, "errors": "" }
说明:钱包加密后,客户端核心程序会要求重启,已经加密的钱包再次加密会被拒
getaccount "bitcoinaddress"
通过比特币地址返回钱包账号名
getaccountaddress "account"
根据account返回对应的钱包地址,如果account不存在,则创建一个account(通过bitcoin-cli listaccounts 查看),并返回一个新的地址
getaddressesbyaccount "account"
命令:
/bitcoin-cli getaddressesbyaccount ""
输出结果:
[ "157LNUtoTq8tFuBzX6ikMzWQmk3yczh7gd", "1HYiVYz36Cu3AuKygEu7LKzC3q4JiJLjEc", "1LhJeSRHweUT6KUtKZZLKGQjvE3b5ZGVRb" ]
说明:
列出钱包所有的地址
getbalance ( "account" minconf includeWatchonly )
getnewaddress ( "account" )
从钱包中获取一个任意的钱包地址用于对外接收地址或零钱地址,钱包会把该地址的状态置为label= # 状态
getrawchangeaddress
getreceivedbyaccount "account" ( minconf )
getreceivedbyaddress "bitcoinaddress" ( minconf )
获取指定的比特币地址钱包余额状况。如果是交易的话,中间因为比特币网络暂时未确认会有延迟
参数说明:
minconf 想要某笔交易出现在余额中所设置的最少确认数。 minconf 设置在bitcoind配置文件指定
gettransaction "txid" ( includeWatchonly )
getunconfirmedbalance
getwalletinfo
importaddress "address" ( "label" rescan p2sh )
importprivkey "bitcoinprivkey" ( "label" rescan )
importpubkey "pubkey" ( "label" rescan )
importwallet "filename"
命令:
bitcion-cli importwallet dump文件名
说明:
恢复 backupwallet命令备份的钱包
keypoolrefill ( newsize )
listaccounts ( minconf includeWatchonly)
命令:
bitcion-cli listaccounts
输出结果:
{ "": 0.00000000 } 说明: 返回钱包中所有的账号名,默认账号名 “”
listaddressgroupings
listlockunspent
listreceivedbyaccount ( minconf includeempty includeWatchonly)
listreceivedbyaddress ( minconf includeempty includeWatchonly)
listsinceblock ( "blockhash" target-confirmations includeWatchonly)
listtransactions ( "account" count from includeWatchonly)
listunspent ( minconf maxconf ["address",...] )
lockunspent unlock [{"txid":"txid","vout":n},...]
move "fromaccount" "toaccount" amount ( minconf "comment" )
sendfrom "fromaccount" "tobitcoinaddress" amount ( minconf "comment" "comment-to" )
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] )
sendtoaddress "bitcoinaddress" amount ( "comment" "comment-to" subtractfeefromamount )
setaccount "bitcoinaddress" "account"
settxfee amount
signmessage "bitcoinaddress" "message"
https://bitcoin.org/en/bitcoin-core/