tokucore is a simple Go (golang) library for creating and manipulating bitcoin data structures like creating keys and addresses (HD/BIP32/BIP39/SegWit) or parsing, creating and signing transactions.
- Base58 encoding/decoding
- Block headers, block and transaction parsing
- Transaction creation, signature and verification
- Script parsing and execution
- BIP 32 (deterministic wallets)
- BIP 39 (mnemonic code for generating deterministic keys)
- BIP 173 (Base32 address format for native v0-16 witness outputs)
- Two-Party ECDSA Threshold Signature Scheme (TSS)
- Mult-Party Schnorr Threshold Signature Scheme (TSS)
- Scriptless Adaptor Signature
- Simple and easy to use
- No external dependencies
- Full test coverage
$ export GOPATH=`pwd`
$ go get -u github.com/keyfuse/tokucore/xcore
$ cd src/github.com/keyfuse/tokucore/
$ make test
- Generate a Random Address
- Generate a P2PKH Address
- Generate a P2SH Address
- Generate a 2-of-3 P2SH MultiSig Address
- Generate a P2WPKH SegWit Address
- Generate a P2WSH SegWit Address
- Create a P2PKH Transaction
- Create a 2-to-3 P2SH MultiSig Transaction
- Create a Transaction with an OP_RETURN Output
- Create a Transaction with Verify
- Create a Transaction with P2WPKH Segwit Output
- Create a Transaction with P2WPKH SegWit Input
- Create a Transaction with P2WSH SegWit Output
- Create a Transaction with P2WSH SegWit Input
- Create a Two-Party-Threshold ECDSA Transaction with P2PKH Output
- Create a Two-Party-Threshold ECDSA Transaction with P2PKH Input
- Create a Two-Party-Threshold ECDSA Transaction with P2WPKH SegWit Output
- Create a Two-Party-Threshold ECDSA Transaction with P2WPKH SegWit Input
- Scriptless ECDSA adaptor signature
- HDWallet
- Mnemonic
The performance was done on an Intel i5 (2.50GHz) with golang benchmark.
Implementation | |
---|---|
2P-ECDSA KeyGen | 2.13 ms |
2P-ECDSA Signing | 426.05 ms |
2P-Schnorr KeyGen | 0.01 ms |
2P-Schnorr Signing | 4.31 ms |
$ go test -bench=BenchmarkMpc* ./xcrypto
goos: linux
goarch: amd64
pkg: github.com/keyfuse/tokucore/xcrypto
BenchmarkMpcEcdsaKeyGen-4 1000 2133566 ns/op
BenchmarkMpcEcdsaSigning-4 3 426058258 ns/op
BenchmarkMpcSchnorrKeyGen-4 100000 11310 ns/op
BenchmarkMpcSchnorrSigning-4 300 4315631 ns/op
Don't trust. Verify.
tokucore is released under the BSD License.