Skip to main content

Crate krusty_kms

Crate krusty_kms 

Source
Expand description

TONGO Key Management System (KMS).

Provides BIP-44 compliant key derivation for TONGO accounts using custom coin type 5454.

§Derivation Path

The TONGO protocol uses the following BIP-44 derivation path:

m/44'/5454'/0'/0/{index}

Where:

  • 44' - BIP-44 purpose
  • 5454' - TONGO custom coin type
  • 0' - Account (hardened)
  • 0 - Change (external chain)
  • {index} - Address index

Re-exports§

pub use account::calculate_contract_address;
pub use account::derive_oz_account_address;
pub use account_class::AccountClass;
pub use account_class::ArgentAccount;
pub use account_class::BraavosAccount;
pub use account_class::OpenZeppelinAccount;
pub use account_class::OzDeploymentDescriptor;
pub use derivation::derive_keypair;
pub use derivation::derive_keypair_with_coin_type;
pub use derivation::derive_nostr_keypair;
pub use derivation::derive_nostr_private_key;
pub use derivation::derive_private_key;
pub use derivation::derive_private_key_with_coin_type;
pub use derivation::derive_view_keypair;
pub use derivation::derive_view_private_key;
pub use derivation::NostrKeyPair;
pub use derivation::TongoKeyPair;
pub use derivation::NOSTR_COIN_TYPE;
pub use derivation::STARKNET_COIN_TYPE;
pub use derivation::TONGO_COIN_TYPE;
pub use derivation::TONGO_VIEW_COIN_TYPE;
pub use eth_signer::EthSigner;
pub use mnemonic::generate_mnemonic;
pub use mnemonic::mnemonic_to_seed;
pub use mnemonic::validate_mnemonic;

Modules§

account
Starknet account contract address derivation.
account_class
Account class trait and presets for Starknet account contracts.
address
Re-export common types Validated Starknet address (Felt newtype).
amount
Re-export common types Precision-safe token amount representation.
chain
Re-export common types Chain ID enum for Starknet networks.
derivation
BIP-44 key derivation for TONGO accounts.
error
Re-export common types Error types for TONGO protocol operations.
eth_signer
Secp256k1 (Ethereum) signer for Starknet account transactions.
mnemonic
Mnemonic phrase generation and validation.
network
Re-export common types Network preset configuration for Starknet chains.
secret_felt
Re-export common types A zeroizing wrapper for secret Felt values.
token
Re-export common types Token metadata and presets for known Starknet tokens.
types
Re-export common types Common type definitions for TONGO protocol.
utils
Re-export common types Utility functions for TONGO protocol.
validator
Re-export common types Staking validator metadata and presets.

Structs§

AccountState
Re-export common types Tongo account state.
Address
Re-export common types A validated Starknet contract address.
Amount
Re-export common types A token amount with associated decimal precision.
AuditProof
Re-export common types Audit proof structure (SameEncryptUnknownRandom protocol). Proves that two ciphertexts encrypt the same plaintext.
ElGamalCiphertext
Re-export common types ElGamal ciphertext.
ElGamalProof
Re-export common types ElGamal encryption proof structure.
NetworkPreset
Re-export common types A preset configuration for a Starknet network.
Poe2Proof
Re-export common types Proof of Exponentiation 2 (PoE2) proof structure.
PoeProof
Re-export common types Proof of Exponentiation (PoE) proof structure.
ProofOfBit
Re-export common types Proof of Bit (proves a committed value is either 0 or 1). This is an OR proof: either V = h^r (bit=0) OR V/g = h^r (bit=1).
ProofOfTransfer
Re-export common types Proof of Transfer structure matching Cairo contract expectations. This proves:
Range
Re-export common types Range proof structure proving a value is in [0, 2^bit_size - 1]. Contains commitments V_i = g^b_i * h^r_i for each bit and corresponding proofs.
SecretFelt
A Felt that holds secret key material and is zeroized on drop.
SerializablePoint
Re-export common types Represents a point on the Stark curve in serializable form.
Token
Re-export common types ERC-20 token metadata.
Validator
Re-export common types A staking delegation pool validator.

Enums§

ChainId
Re-export common types Starknet chain identifier.
KmsError
Re-export common types
TransactionType
Re-export common types Transaction types in TONGO protocol.

Type Aliases§

Result
Re-export common types