版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。<br><img><br><img><br>26 篇文章1 订阅<br>订阅专栏<br><img><br>25 篇文章8 订阅<br>订阅专栏<br>1.首先引入bitcoinj最新的库<br>compile 'org.bitcoinj:bitcoinj-core:0.15'<br>3.生成不同格式地址代码如下:<br>LegacyAddress address1 = LegacyAddress.fromKey(networkParameters, ecKey); System.out.println("1开头的地址:" + address1.toBase58()); LegacyAddress address3 = LegacyAddress.fromScriptHash(networkParameters, ecKey.getPubKeyHash()); System.out.println("3开头的地址:" + address3.toBase58()); SegwitAddress segwitAddress = SegwitAddress.fromKey(networkParameters, ecKey); System.out.println("bc1开头的地址:" + segwitAddress.toBech32());<br>打印结果:<br>1开头的地址:1AMWsQHBgBCmMog3JxSkvAT5NcXQeGNxba<br>3开头的地址:3B3XnwmdE5X9SyNUS47MLnp1X8p8Afi8kx<br>bc1开头的地址:bc1qv6dxy7tmsyupwp46skcdg08c8693c6chrcu94h<br><img><br><img><br><img><br><img><br><img><br><img><br><img><br><img><br>收藏<br><img><br>一键三连<br><img><br>扫一扫,分享海报<br>专栏目录<br><img><br><img><br><img><br><img><br><img><br>1.测试网络 获取btc https://testnet.coinfaucet.eu/en/ https://live.blockcypher.com/ btc:https://github.com/Samourai-Wallet/samourai-wallet-android eth:https://gitter.im/web3j/web3j eos:https://eos.io/ 2.引...<br><img><br><img><br>