项目作者: macroing

项目描述 :
A simple Bitcoin library for Java
高级语言: Java
项目地址: git://github.com/macroing/BTC4J.git
创建时间: 2020-11-22T12:51:53Z
项目社区:https://github.com/macroing/BTC4J

开源协议:GNU Lesser General Public License v3.0

下载


BTC4J

BTC4J is a simple Bitcoin library for Java.

Getting Started

To clone this repository and build the project using Apache Ant, you can type the following in Git Bash.

  1. git clone https://github.com/macroing/BTC4J.git
  2. cd BTC4J
  3. ant

Example

The example below shows how an address can be obtained from a private key.

  1. import org.macroing.btc4j.Address;
  2. import org.macroing.btc4j.PrivateKey;
  3. import org.macroing.btc4j.PublicKey;
  4. public class Example {
  5. public static void main(String[] args) {
  6. PrivateKey privateKey = PrivateKey.parseStringWIF("5J1F7GHadZG3sCCKHCwg8Jvys9xUbFsjLnGec4H125Ny1V9nR6V");
  7. PublicKey publicKey = privateKey.toPublicKey();
  8. boolean isCompressed = false;
  9. Address address = publicKey.toAddress(isCompressed);
  10. System.out.println(address);
  11. }
  12. }

Dependencies

Note

This library has not reached version 1.0.0 and been released to the public yet. Therefore, you can expect that backward incompatible changes are likely to occur between commits. When this library reaches version 1.0.0, it will be tagged and available on the “releases” page. At that point, backward incompatible changes should only occur when a new major release is made.