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.
go 1.15 or newer.
- Install pre-required package
sudo apt-get update
sudo apt-get install -y git cmake
- Clone the project
git clone https://github.com/JayT106/bitcoinAddressGenerator.git
-
Install Go according to the installation instructions here: http://golang.org/doc/install
-
Ensure Go was installed properly and is a supported version:
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.
- Build the project
make
or
make build
- Run the test suites
make tests
- After
make
built the project without any error, you can find the binary in thebin
folder. Launch the server and the server will use8080
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 thetest
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
This project is under MIT License.