
BTC上各种格式的地址
这几天在写一个BTC的脚本,其中BTC上各种格式的地址让人混乱,这里就写些关于BTC各种格式的地址
Legacy
: 1开头,不支持铭文
- HD Path: m/44’/0’/0’/0
Nested SegWit
: 3开头,不支持铭文
- HD Path: m/49’/0’/0’/0
Native SegWit
: bc1q开头, 有2种HD Path:
- m/44’/0’/0’/0
- m/84’/0’/0’/0 (比较常用)
这种地址最短,打铭文的时候使用这种地址会省不少gas
Taproot
: bc1p开头
- HD Path: m/86’/0’/0’/0
所有格式的BTC地址之间都能互转BTC, 但是支持铭文的就只有bc1q和bc1q开头的地址
目前最好用的BTC上各种地址生成的库是okx开发的 @okxweb3/cooin-bitcoin: https://www.npmjs.com/package/@okxweb3/coin-bitcoin
- Thanks for your appreciation. / 感谢您的赞赏
List of appreciation
Because of your support, I realize the value of writing articles. / 由于您的支持,我才能够实现写作的价值。
This piece of writing is an original article, utilizing theCC BY-NC-SA 4.0Agreement. For complete reproduction, please acknowledge the source as Courtesy ofERICET
Comment ()