Kobe
no_std-compatible Rust toolkit for multi-chain HD wallet derivation — one BIP-39 seed, twelve networks, zero hand-written cryptography, cross-implementation KATs.
Kobe derives standards-compliant accounts and addresses for Aptos, Bitcoin, Ethereum, Solana, Cosmos, Tron, Sui, TON, Filecoin, Spark, XRP Ledger, and Nostr (NIP-06 / NIP-19) from a single BIP-39 mnemonic. It layers thin wrappers around bip39, bip32, bitcoin, k256, and ed25519-dalek on top of a unified Wallet + Derive trait surface; every library crate builds under no_std + alloc, mnemonics and private keys wrap in Zeroizing<T> and wipe on drop, and every chain's pipeline is pinned against independent reference implementations (bitcoinjs-lib, @ton/core, @noble/hashes, NIP-06 official vectors, ethanmarcuss/spark-address, …).
See also
signer— the companion transaction-signing toolkit that consumes kobe's derived accounts viaSigner::from_derived.
Quick Start
Install the CLI
Shell (macOS / Linux):
|
PowerShell (Windows):
irm https://sh.qntx.fun/kobe/ps | iex
Or via Cargo:
CLI Usage
# Generate new wallets (default: 12-word English mnemonic, 1 account)
# Import from an existing mnemonic
# JSON output — stable, script- and agent-friendly
Every chain subcommand accepts the shared flags -w/--words, -c/--count, -p/--passphrase, and --qr through a flattened SimpleArgs group, so ergonomics stay consistent across the 12 networks.
Library Usage
use *; // Wallet, Derive, DeriveExt, DerivationStyle trait, ...
use Deriver; // or kobe::btc, kobe::svm, kobe::cosmos, ...
// Import from mnemonic
let wallet = from_mnemonic?;
// Derive addresses (accessor methods — fields are private for zeroization safety)
let eth = new.derive?;
let btc = new?.derive?;
let sol = new.derive?;
println!; // 0x9858EfFD232B4033E47d90003D41EC34EcaEda94
println!; // bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu
println!; // HAgk14JpMQLgt6rVgv7cBQFJWFto5Dqxi472uT3DKpqk
// Chain-specific extensions via newtypes: `BtcAccount` extends `DerivedAccount`
// with `private_key_wif()`, `address_type()`, `bip32_path()`; `SvmAccount`
// exposes `keypair_base58()`. Both `Deref` to the unified `DerivedAccount`.
println!;
String-path entry points are uniform across every chain. Bitcoin additionally exposes an explicit-type escape hatch for non-standard paths:
use ;
let deriver = new?;
let p2wpkh = deriver.derive_at?; // infer type from purpose
let taproot = deriver.derive_at?; // infer type from purpose
let custom = deriver.derive_at_with?; // non-standard purpose
DerivationStyle is a shared trait implemented by every chain's style enum.
kobe::prelude::* brings it into scope so style.path(i) / style.name()
work directly:
use *;
use DerivationStyle;
let style: DerivationStyle = "ledger-live".parse?; // FromStr
assert_eq!; // trait method
for variant in <DerivationStyle as DerivationStyle>all
// Generate new wallet
let wallet = generate?; // 12-word mnemonic
println!;
Supported Chains
| Chain | Crate | Curve | BIP-44 coin | Default path | Address format |
|---|---|---|---|---|---|
| Bitcoin | kobe-btc |
secp256k1 (BIP-32) | 0 | m/84'/0'/0'/0/{i} |
P2PKH / P2SH-P2WPKH / P2WPKH / P2TR |
| Ethereum | kobe-evm |
secp256k1 (BIP-32) | 60 | m/44'/60'/0'/0/{i} |
EIP-55 0x… |
| Cosmos | kobe-cosmos |
secp256k1 (BIP-32) | 118 * | m/44'/118'/0'/0/{i} |
Bech32 cosmos1… (HRP configurable) |
| Tron | kobe-tron |
secp256k1 (BIP-32) | 195 | m/44'/195'/0'/0/{i} |
Base58Check T… |
| Filecoin | kobe-fil |
secp256k1 (BIP-32) | 461 | m/44'/461'/0'/0/{i} |
Base32 f1… |
| Spark | kobe-spark |
secp256k1 (BIP-32) | 8797555 † | m/8797555'/{i}'/0' |
Bech32m spark1… / sparkt1… / … |
| XRP Ledger | kobe-xrpl |
secp256k1 (BIP-32) | 144 | m/44'/144'/0'/0/{i} |
Base58Check (XRPL alphabet) r… |
| Nostr | kobe-nostr |
secp256k1 (BIP-340) | 1237 | m/44'/1237'/{i}'/0/0 |
NIP-19 npub1… / nsec1… |
| Solana | kobe-svm |
Ed25519 (SLIP-10) | 501 | m/44'/501'/{i}'/0' |
Base58 + optional 64-byte keypair |
| Sui | kobe-sui |
Ed25519 (SLIP-10) | 784 | m/44'/784'/{i}'/0'/0' |
0x + hex(BLAKE2b-256(0x00 ‖ pubkey)) |
| TON | kobe-ton |
Ed25519 (SLIP-10) | 607 | m/44'/607'/{i}' |
wallet v5r1 (UQ… / EQ… / 0Q… / …) |
| Aptos | kobe-aptos |
Ed25519 (SLIP-10) | 637 | m/44'/637'/{i}'/0'/0' |
0x + hex(SHA3-256(pubkey ‖ 0x00)) |
* Cosmos coin type defaults to 118; Terra (330), Secret (529), Kava (459), and custom chains are selectable via ChainConfig.
† Spark purpose 8797555 is Spark-specific (SHA-256("spark") truncated), not a BIP-44 assignment.
Design
- 12 chains — Aptos, Bitcoin, Ethereum, Solana, Cosmos, Tron, Sui, TON, Filecoin, Spark, XRP Ledger, Nostr — one BIP-39 seed
- Zero hand-written cryptography —
bip39for mnemonic ↔ entropy,bip32/bitcoinfor BIP-32 secp256k1,k256for secp256k1 encodings,ed25519-dalekfor SLIP-10 Ed25519; hashing viasha2/sha3/blake2/ripemd; encoding viabech32/bs58 - Unified derivation contract — shared
Derivetrait with an associatedAccounttype + sharedDerivationStyletrait; every chain has typed public keys viaDerivedPublicKey, one sharedDeriveError, and one sharedParseDerivationStyleError - Consistent entry points —
derive/derive_with/derive_at/derive_at_withacross every chain (Bitcoin's structured path also available asderive_structured) - HD standards — BIP-32, BIP-39, BIP-44 / 49 / 84 / 86, SLIP-10, NIP-06, NIP-19
- Derivation styles — Standard, Ledger Live, Ledger Legacy, Trust, Phantom, Backpack, Tonkeeper — with
FromStraliases and an accepted-token diagnostic onParseDerivationStyleError - Cross-implementation KATs — every chain is pinned against independent references (bitcoinjs-lib, @ton/core, @noble/hashes, NIP-06 official vectors, ethanmarcuss/spark-address, BIP-84 / BIP-86 / EIP-55 / SLIP-10 test vectors) — no self-confirming dumps
no_std+alloc— every library crate compiles onthumbv7m-none-eabiunder CI; embedded / WASM ready- Security hardened — mnemonics, seeds, private keys, WIFs,
nsecs, and Solana keypairs wrapped inZeroizing<T>; no key material is logged or persisted - Signer integration —
signerconsumes everyDerivedAccount/BtcAccount/SvmAccount/NostrAccountviaSigner::from_derivedbehind itskobefeature flag - Strict linting — Clippy
pedantic+nursery+correctness(deny),rust_2018_idiomsdeny, zero warnings on nightly
Crates
See crates/README.md for the full crate table, dependency graph, and feature flag reference.
Security
This library has not been independently audited. Use at your own risk.
- Mnemonics, seeds, and derived private keys wrapped in
zeroize— wiped from memory on drop - Chain-specific secret encodings (BTC WIF, Nostr
nsec, Solana 64-byte keypair) are wrapped inZeroizing<String>/Zeroizing<[u8; N]> - Random generation uses the OS-provided CSPRNG via
getrandom;Wallet::generate_in_withaccepts a caller-suppliedCryptoRngon embedded / WASM targets where OS entropy is unavailable secp256k1contexts are cached onDeriverto avoid the ~768 KB per-call setup cost- Environment-variable mutation and
std::mem::{transmute, forget}are denied at the lint level - No key material is logged or persisted by the workspace
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project shall be dual-licensed as above, without any additional terms or conditions.
A QNTX open-source project.
Code is law. We write both.