Skip to main content

Crate kobe_spark

Crate kobe_spark 

Source
Expand description

Spark protocol (Bitcoin L2) wallet utilities for Kobe.

Implements the Spark identity-key derivation and Bech32m address encoding from a unified kobe_primitives::Wallet:

  • Derivation path: m/8797555'/{account}'/0' — hardened BIP-32 secp256k1. The purpose 8797555 is the Spark-specific constant (SHA-256("spark") truncated).
  • Address: spark1… (Mainnet), sparkt1… (Testnet), sparks1… (Signet), sparkrt1… (Regtest), sparkl1… (Local) — Bech32m-encoded compressed identity public key wrapped in a minimal protobuf header.

§Example

use kobe_primitives::Wallet;
use kobe_spark::{Deriver, Network};

let wallet = Wallet::from_mnemonic(
    "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
    None,
)?;
let account = Deriver::with_network(&wallet, Network::Mainnet).derive(0)?;
assert!(account.address().starts_with("spark1"));

Structs§

DerivedAccount
A derived HD account — unified across all chains.
Deriver
Spark address deriver from a unified wallet seed.

Enums§

DeriveError
Errors produced by HD derivation, mnemonic handling, and address encoding.
DerivedPublicKey
Strongly typed public key emitted by an HD derivation.
Network
Spark protocol networks, each bound to a distinct Bech32 HRP.

Constants§

SPARK_PURPOSE
Spark-specific BIP-32 purpose.