2019/09/18 Chenxin
参考
https://bitcoinsv.io/services/wallets-and-exchanges/ 钱包推荐列表
https://aaron67.cc/2019/02/18/bitcoin-wallet-best-practice/ 钱包使用实践
See https://bitcoinsv.io/services/wallets-and-exchanges/"target="_blank" rel="noopener" https://bitcoinsv.io/services/wallets-and-exchanges/ recommended list of wallets
本文档对应版本
0.18.1
This document corresponds to version
0.18.1
钱包
节点
btc类,eth类等
Wallet
br'btc class, eth class etc.
https://bitcoincore.org/en/download/ 安装软件下载地址.
https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes.md 版本说明
https://github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md 启动配置参数
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list API参考(老旧,很多用不了.可以直接使用命令后 -h 或 help 查看)
https://lhalcyon.com/blockchain-bitcoin-node/ 本章节参考
https://https://bitcoincocore.en/download=http://https://bitcoincococore.org/bref=https://bitcoin.com/bitcoin/bitcoin/bitcoin/bitcoit< 安装 installs linux(命令行) Linux (command line) Mac(GUI界面,命令行) Mac (GUI interface, command line) 目录结构 直接执行 /data/coin_test/bitcoin/bitcoin/bin/bitcoind 二进制,会自动到/root目录下创建 ".bitcoin"文件夹. Direct execution /data/coin_test/bitcoin/bitcoin/bin/bitcoin/bitcoind bins will automatically create the folder ".bitcoin" under the/root directory. 常用指令请参考本文日常"运维"部分
bitcoind指令参数(此为命令行方式,与配置文件一一对应) bitcoind command parameters (this is command line approach, corresponding to configuration file I)bitcound-conf=/data/coin_test/bitcoin/bitcoin.conf 钱包选项 Wallet Options bitcoin.conf配置文件(优先级低于命令行方式) 数据目录配置 Data Catalogue Configuration 以daemon后台方式启动 Start bitcoind 的 daemon 方式,查看实时输出(输出与直接执行bitcoind控制台输出一致) bitcound's daemon way of viewing real-time output (the output is consistent with the direct execution of bitcoind control output) 使用测试网络数据(真实环境需要250GB磁盘,测试环境当前为35GB) Test network data (real environment needs 250 GB disk, test environment currently 35 GB) 使用指定的钱包(这里是在test环境下,如果正式环境,就不要放到test里.此步骤是第一次启动后,通过rpc创建的钱包,然后重新修改配置文件,加载这个新的钱包.创建钱包在此文后半部分) Use the specified wallet (in a test environment, and in a formal environment, don't put it in a test. This step is the first time that a wallet created through rpc has been activated, and then changes the configuration file to load the new wallet. Creates the wallet in the latter part of the text) 进程执行 Process execution 以下是官方配置文件示例 Here's an example of the official profile. bitcoin-cli客户端/管理端使用说明 bitcoin-cli client/manager use instructions bitcoin-cli命令参数 Bitcoin-cli command parameters RPC指令 RPC Command 整体数据文件,以及各种操作对数据影响的说明 corporate data files and description of the impact of various operations on the data 终止或启动进程测试 Disable or start the process test 切换用户测试 Switch user test 剪切数据测试 Cut data test 数据文件分类说明 data file classification description 文件权限问题 How to prevent illegal users from accessing data (managed wallets, or walklet.dat files) dns自动获取种子问题 When the bitcoin client first started, the program did not know any active bitcoin full node. In order to find some IP addresses, some DNS addresses (also called dns seeds) needed to be coded to the bitcon source code. In the absence of dns seed, the client could not automatically connect to the node. 修改配置文件与同步 modify configuration files to sync 交易测试 transaction test 2.查看钱包 View wallet 3.备份钱包 The back-up wallet 4.加密与解密钱包 The encryption and decrypting wallet 5.切换钱包 Toggle the wallet 6.钱包与账号关系 The wallet is connected to account number 7.新建地址(钱包对应收款地址可以有多个) New address (the wallet can have more than one receivable address) 8.密钥(地址,公钥,私钥 区别) The key (address, public key, private key difference) 9.导出私钥(收款地址对应的私钥地址) 9. Export of private keys (the private key address for the receiving address) 9.导入私钥 9. Importing private key 说明: 当同一个密钥同时属于A,B两个钱包,在这2个钱包间转账,那么会被无缘无故的扣除手续费,显示在两个钱包上,就是2个钱包都在被扣费.因为转账1个币从A钱包到B钱包,总额没有变化,但手续费需要付给第三方. Note: When the same key belongs to both A, B and B wallets, which are transferred between these two wallets, the charges will be deducted for no reason, showing that on both wallets, both wallets will be withheld. Since the total amount of a currency transferred from A wallet to B wallet remains unchanged, the fees will have to be paid to a third party. 10.支付与转账 For the payment and transfer of 创建收款地址 Create a new address (receipt address) to create the currently loaded wallet (receipt address) 测试币申请 The test currency application 完成转账后,可以从以下网站看收付款: Upon completion of the transfer, payments may be received from 查询当前余额 Query current balance 支付,执行转账 Payment, execution of transfers 10.助记词有吗? Do you have any notes? 11.默认钱包和自建的钱包啥区别? What's the difference between the default wallet and the self-constructed wallet? 12.地址说明 The address indicates that each address corresponds to a private key in the wallet. The wallet is a collection of all private keys. Officially, it is recommended that a new collection address be created for each transaction. 测试转账流程里的收付款地址情况 Test the payment address in the transfer process 地址说明 Cannot initialise Evolution's mail component. 更新程序. Update the program. 常用指令统计(解析请参考具体内容) Common command statistics (please refer to specific content) md5sum 和 sha256sum 都用来用来校验软件安装包的完整性.讲解如何使用两个命令进行软件安装包的校验. md5sum and sha256sum are used to verify the integrity of the software installation package. Explain how two commands are used to verify the software installation package. sha 是什么? md5 是什么? md5 What? sha256sum校验软件是否被非法修改过的方法 sha256sum verification method to verify whether the software has been illegally modified 类似的方法还有以下, There's a similar method,
资源占用说明
测试网会占用500MB左右内存,35GB的左右的磁盘空间(2019/09/23)
resource occupancy instructions
that will take up about 500 MB memory, 35 GB or so disk space (2019/09/23)
linux直接到官网下载tar.gz包.解压,放置到磁盘空间足够大的地方(250GB以上),便于全节点.
linux downloads tar.gz bags. unpressure and places the disk space sufficiently large (more than 250 GB) for the full node.
下载,安装dmg文件.可以将linux上的已经同步完的节点数据和钱包一并拷贝到mac上(之后钱包可以在两边一起用),mac上安装节点.然后测试钱包.
downloads, installs dmg files.
可以将 bin 目录,加入系统变量PATH里.
can add the bin directory to the system variable PATH.
bitcoind -conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf
一般选项
bitcoin.conf 配置文件
默认情况下,Bitcoin(或 bitcoind)会在比特币数据文件夹下查找一个名为“bitcoin.conf”的文件,或通过 -conf 命令行参数指定.
配置文件说明 https://github.com/bitcoin/bitcoin/blob/master/doc/bitcoin-conf.md
-conf 指定读取配置文件位置.要跟绝对路径,如-conf=/data/coin_test/.https://www.cnblogs.com/chanix/bitcoin.conf,如果是相对路径,则会自动到用户的根目录下相对路径里去找.
配置文件里指定的项目优先级低于命令行参数设置的值(命令行会覆盖配置文件中的设置).
配置文件不会自动创建.
默认位置: $HOME/.bitcoin/ /home/username/.bitcoin/bitcoin.conf
datadir=/data/coin_test/bitcoin/bitcoin/bitcoin-data
datadir=/data/coin_test/bitcoin/bitcoin/bitcoin-data
daemon=1.
或者bitcoind后指定 -daemon 也可以.
tailf debug.log
teilf debug.log
testnet=1
testnet=1
[test]
wallet=/data/coin_test/bitcoin/bitcoin/bitcoin-data/testnet3/wallets/wallet-chenxin/
[test] >wallet=/data/coin_test/bitcoin/bitcoin-data/testnet3/wallets/wallet-chenxin/
bitcoind -conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf
bitcound-conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf
关闭同步服务
bitcoin-cli -conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf stop 相当于直接启动bitcoind后,ctrl+c操作.
to close synchronization services
bitcoin-cli-conf=/data/coin_test/bitcoin/bitcoin.conf stop equals direct start bitcound, ctrl+c operation.
可以随时终止进程,拷贝或移动数据文件到别处,重新指定配置参数 datadir 就可以了.默认是指向当前用户根目录下的.
to terminate the process at any time, copy or move the data file elsewhere, reassign the configuration parameter datdir. Default refers to the current user root directory.
切换到admin账号,修改文件属组,依旧正常执行.
to the admin account, change file group, still performed.
只要把配置文件+指定的数据文件夹文件一并拷贝就可以了.
just copy the profile plus the specified data folder file.
参考: https://www.jianshu.com/p/6a8ee6cea3f7
在比特币业务中需要存储的数据主要分为下面四种:
reference:
has four main categories of data to store in Bitcoin operations:
如何防止非法用户获取到数据(管理好钱包,也就是 wallet.dat文件)
进程启动后,ctrl+c关闭经常卡几分钟在"dnsseed thread exit"原因.
当bitcoin客户端第一次启动的时候,程序不知道任何活跃的bitcoin全节点.为了发现一些IP地址,需要把一些DNS地址(也叫dns种子)硬编码到比特币源码中.如果没有dns seed,客户端不能自动联上节点.
Dns Seed 由比特币的社区成员维护,其中一些提供动态的dns seed服务,通过扫描网络自动获取活跃的节点IP地址,其中一些提供静态dns seed,这些种子是手动添加的.
dns seed 硬编码在什么地方了?
修改配置文件bitcoin.conf
testnet=1 (默认为0)
开始同步 bitcoind -conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf
如无意外,同步则开始.测试网络节点数据大概几十G,大概花了1~2个小时完成.
or modify configuration files bitcoin.conf
textnet=1 (default 0)
Start synchronizing bitcoin-conf=/data/coin_test/bitcoin/bitcoin.conf
, if no accident, start synchronizing. Test network node data for about a few dozen Gs, probably one to two hours.
1.创建钱包
1. Create wallet
查看当前加载的钱包内容(配置文件里指定)
to see the contents of the currently loaded wallet (as specified in the configuration file)
就是备份"wallet.dat"文件.GUI上的备份功能,也是直接拷贝这个文件到用户指定目录.
每次有新地址生成后(尤其是这个地址上有币),就一定要重新备份钱包.因为新地址对应着一个新的密钥.
is the backup of the "wallet.dat" file. Back-up on the GUI is also a direct copy of the file to the user-assigned directory.
加密钱包,会重新根据当前wallet.dat生成新的wallet.dat(加过密的),以前备份的wallet.dat都会失效(密码当前为168.....).转账的时候需要这个密码.
MAC上,GUI支持点击.
Linux上,对应指令:
加密:
bitcoin-cli -conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf encryptwallet "168....."
解密:
bitcoin-cli -conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf walletpassphrase "168....." 60
解锁后重新锁定说明:
will recreate a new wallet.dat based on the current wallet.dat (which has been over-secret), and the previously backed up wallet.dat will expire (the password is currently 168...). The password will be required for the transfer.
MAC, GUI supports the click.
Linux, corresponding instructions:
encryption:
bitcoin-cli-conf=/data_bitcoin/bitcoin.conf walpasphasse "168... 60
, declassification:
bitcoin-cl-conf=/data/coin_bitcoin/bitcoin.conf walpasphasse"
bitcoin.conf配置文件中指定.
wallet=/data/coin_test/bitcoin/bitcoin/bitcoin-data/testnet3/wallets/wallet-chenxin/
如果是测试网络,则放到"[test]"下面.
bitcoin.conf configuration file specified.
wallet=/data/coin_test/bitcoin/bitcoin-data/testnet3/wallets/wallet-chenxin/
under "[test]".
现在应该没有account的概念了.
and there's no account concept.
创建的地址,就是该钱包的收款地址.官方建议每笔交易使用一个新的地址(虽然可以复用).
is the receipt address of the wallet. Officially it is recommended that a new address (although it can be reused) be used for each transaction.
收款地址是一个公钥对应的地址.可以通过这个收款地址,导出对应的私钥地址.请见本文档下文说明.
is a public key corresponding address. The corresponding private key address can be exported through this collection address. See the following description in this document.
RPC命令格式: importprivkey "privkey" ( "label" ) ( rescan )
将私钥(dumpprivkey返回)添加到钱包中。需要一个新的钱包备份。
提示:使用importmulti导入多个私钥。
参数:
"privkey":字符串,必须项。私钥(dumpprivkey的输出)
"label":字符串,可选项,默认为空。可选标签。
rescan:布尔值,可选项,默认为true。重新扫描钱包的交易。
注意:如果rescan为真,则此调用可能需要一个多小时才能完成,在此期间,其他rpc调用可能报告导入的密钥存在,但相关事务仍然缺失,导致临时错误/虚假余额和未使用的输出,直到rescan完成。
RPC command format: importprivkey "privkey" ( "label") (rescan)
adds private key (dumpprivkey return) to his wallet. A new wallet backup is required.
hint: import multiple private keys using keymulti.
argument:
"privkey": string has to be assigned. Private key (dumpprivkey output)
"label": string, default is empty.
地址部分,请查看"地址说明".
生成当前加载的钱包的一个新地址(收款地址)
bitcoin-cli -conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf getnewaddress "chenxin"
返回值: 2Msjqu5hjBRtTbyqu25XzoCiPqVKqLc8Q9P
bitcoin-cli-conf=/data/coin_test/bitcoin/bitcoin/bitcoin.conf getnewdress "chenxin"
returns value: 2Msjqua5hBRtTbyqu25XzozoCiPqVqLc8Q9P
因是测试环境,需要获取测试币.在以下测试币申请地址.
http://bitcoinfaucet.uo1.net/send.php (申请成功,网页提示"0.00010000 coins sent to 2Msjqu5hjBRtTbyqu25XzoCiPqVKqLc8Q9P")
https://coinfaucet.eu/en/btc-testnet/ (这个网址好像不行)
一般在上述网站申请后,mac客户端会立即提示收到币(当然,处于待收阶段,还需要6个区块的验证).
requires a test currency application because of the test environment. The test currency application is required.
at the following test currency application address: (the application was successful, the web page "0.00001000 coins sent to 2Msjqua5hk" rel=nopener" https://coinfeat.eu/zoPqVqLc8Q9P") .
https://live.blockcypher.com/btc-testnet/tx/302ecc4a3c19a7b2262b07e6a9f0a304ab5288f57dbf49a62e2e28e811aba9d9/
https://live.blockcypher.com/btc-testnet/tx/302ecc4a3a3c19a7b2262b07e6a9f0a304a5258b57df49a62e2e2e28e811aba9d9
不同钱包区别不同.bitcore没有.
Different wallets. Bitcore doesn't.
安装节点后,有个默认钱包.可以手动再创建钱包(位置在默认钱包的下一级目录).
installed node, there's a default wallet.
每个地址对应着钱包里的一个私钥.钱包就是所有私钥的集合.官方建议每笔交易新建一个收款地址.
收款地址,付款地址有区别吗?地址应该不分收款地址或付款地址.统称地址.GUI上看不全,需要RPC指令listaddressgroupings.
不同步了排查下原因.
钱包就是备份dat文件,加密钱包,解密钱包.转账.
可能会用到导出收款地址公钥对应的私钥,然后将私钥导入其他钱包,那笔交易另一个钱包也看得到了.
Unsync the reason for checking.
sha 为 安全散列算法(英语:Secure Hash Algorithm,缩写为SHA)是一个密码散列函数家族,是FIPS所认证的安全散列算法。
能计算出一个数字消息所对应到的,长度固定的字符串(又称消息摘要)的算法。
且若输入的消息不同,计算得出的相同字符串的几率极低。
SHA家族的五个算法,分别是SHA-1、SHA-224、SHA-256、SHA-384,和SHA-512.
由美国国家安全局(NSA)所设计,并由美国国家标准与技术研究院(NIST)发布;是美国的政府标准。后四者有时并称为SHA-2。
SHA-1在许多安全协定中广为使用,包括TLS和SSL、PGP、SSH、S/MIME和IPsec,曾被视为是MD5(更早之前被广为使用的杂凑函数)的后继者。MD4 ->MD5 ->SHA-1 ->SHA-2.
is a security hash algorithm (English: Secure Hash Algorithm, acronym IS), a code hash function family, certified by FIPS.
calculates a fixed string (also known as NIST) corresponding to a digital message.
and calculates the very low probability of the same string if the message is entered.
and the
SHA-1 family's five algorithms are widely used in many safety agreements, including TSL-1, SHA-224, SHA-256, SHA-384, and SHA-512.
, designed by the National Security Service (NSA) of the United States and published by the National Standards and Technology Institute (NIST); the latter four are sometimes known as SHA-2;
SHA-1 are widely used in many safety agreements, including TLS and SSL, PGH, SSH, SMIME and IPSec, which were considered to be more widely used than & Mg; & D.
md5 为 消息摘要算法(英语:MD5 Message-Digest Algorithm),一种被广泛使用的密码散列函数,可以产生出一个128位(16字节)的散列值(hash value),用于确保信息传输完整一致。
MD5由美国密码学家罗纳德·李维斯特(Ronald Linn Rivest)设计,于1992年公开,用以取代MD4算法。
md5 is a message summary algorithm (English: MD5 Message-Digest Algorithm), a widely used password hash function that produces a 128-bit (16 byte) hash value to ensure complete consistency in the transmission of information.
MD5 was designed by US cryptographer Ronald Linn Riverst and made public in 1992 to replace MD4 algorithms.
md5sum test.txt
sha1sum test.txt
md5sum test.txt
sha1sum test.txt
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论