bitcoinAddressGenerator
The bitcoinAddressGenerator is a simple HTTP server to demostrate:
-
Generate the public key and a Hierarchical Deterministic (HD) Segregated Witness
(SegWit) bitcoin address from the loaded seed and given path. To fulfill this feature, this project integreted btcd and btcutil to generate a BIP032 compatible HD key structure.
-
Generate an n-out-of-m Multisignature (multi-sig) Pay-To-Script-Hash (P2SH) bitcoin
address, where n, m and public keys can be specified. This project integreted multisig to generate multisig (Up to 7-out-of-7) P2SH address and redeem script.
Requirements
go 1.15 or newer.
Build from source
- Install pre-required package
sudo apt-get update
sudo apt-get install -y git cmake
git clone https://github.com/JayT106/bitcoinAddressGenerator.git
go version
go env GOROOT GOPATH
NOTE: The GOROOT
and GOPATH
above must not be the same path. It is
recommended that GOPATH
is set to a directory in your home directory such as
~/goprojects
to avoid write permission issues. It is also recommended to add
$GOPATH/bin
to your PATH
at this point.
make
or
make build
make tests
Run binary and run examples
- After
make
built the project without any error, you can find the binary in the bin
folder. Launch the server and the server will use 8080
as the HTTP listening port.
cd bin
./bitcoinAddressGeneratorServer-1.0.0_linux_amd64
- Execute the scripts and the binery in the
example
folder to understand how a client interacts with the server.
- The
seed
file is in the test
folder, it is a json format file. It can be loaded when running:
cd example
./getServerPublicKey.sh
./genPublicKeyAndSegWitAddress [the output of the previous script] ../test/test.json
License
This project is under MIT License.