This repository contains Go example implementations related to the cryptography RFCs in iotaledger/protocol-rfcs.
It contains the following general packages:
encoding/b1t6
implements the binary-to-ternary encoding as described in the IOTA protocol RFC-0015.bech32
implements Bech32 addresses based on the format described in RFC-0020 draft.bip32path
provides utilities for BIP-0032 chains.bip39
implements the BIP-0039 specification and mnemonic word lists.ed25519
implements Ed25519 signatures with particular validation rules around edge cases as described in RFC-0028 draft.merkle
implements the combination of multiple bundle hashes into one Merkle tree as described in the IOTA protocol RFC-0012.pow
implements the Curl-based proof of work for arbitrary binary data as mentioned in RFC-0017 draft.slip10
implements the SLIP-0010 private key derivation.
All these packages are tested against the full test vectors provided in the corresponding specifications.
bech32
encode and decode addresses using the bech32 address scheme.
Run the example withgo run examples/bech32/main.go
and use-help
to see the available commands.kdf
shows the private and public key derivation using SLIP-0010 and BIP-0039 mnemonics + passphrase.
It performs the legacy IOTA seed derivation (as implemented in the Ledger App) based on BIP-0032 and the Ed25519 key derivation following SLIP-0010.
Run withgo run examples/kdf/main.go
and use-help
to see the available command-line flags.merkle
prints the Merkle tree of several random transaction hashes on the console.
Run withgo run examples/merkle/main.go
and use-help
to see the available command-line flags.mnemseed
presents the extension of BIP-0039 to decode and encode 81-tryte legacy IOTA seeds using mnemonics.
Run withgo run examples/mnemseed/main.go
and use-help
to see the available command-line flags.