Expand description
Keys, addresses, signing and transaction building for the Torvyon blockchain.
Pure logic: no network, no I/O, no async. Every encoding here is checked
against vectors generated by the Go node (spec/vectors).
Re-exports§
pub use pq::PQAddress;pub use pq::PQKeypair;pub use pq::PQNetwork;pub use pq::PQSignature;
Modules§
- pq
- ML-DSA-65 post-quantum keys, signatures, and addresses.
- tx
- Transactions: types, encoding, signing, verification and payment building.
Structs§
- Address
- A validated
bt1address. - Amount
- An exact amount in nibbles. Never uses floating point.
- Atomic
Swap - Atomic swap helpers. Convenience only — nothing here is a consensus rule.
- Atomic
Swap Params - Parameters for a swap where both locks are on the same chain.
- Chain
Clock - Block timing of one chain, for converting durations into heights.
- Condition
Templates - Higher-level condition templates built only from deterministic v4 primitives. These are convenience constructors, not extra consensus rules.
- Escrow
Refund Template - Parameters for an escrow/release path with a timed refund path.
- Htlc
Template - Parameters for a hash-time-locked contract.
- Payment
Channel Template - Parameters for a simple two-party payment-channel style lock.
- Private
Key - A secp256k1 private key. Never printed; zeroized on drop.
- Public
Key - A 32-byte x-only (BIP340) public key.
- Signature
- A 64-byte BIP340 Schnorr signature.
- SwapLeg
- One side of a cross-chain swap: that chain’s clock and the refund height of the lock on it.
- Swap
Locks - The two locks of a same-chain swap.
- Swap
Secret - A fresh swap secret. The secret is wiped from memory on drop.
- Swap
Timeouts - Estimated time until each refund opens, from
AtomicSwap::check_cross_chain.
Enums§
- Condition
- One deterministic spending-condition node.
- Error
- Everything that can go wrong. Messages match the node’s error text where the node has an equivalent check.
- Network
- Torvyon network identity.
Constants§
- MAINNET_
CHAIN_ ID - Chain ID of Torvyon Mainnet.
- NIBBLES_
PER_ BYTE - Nibbles in one Byte (the chain’s smallest unit is the nibble).
- TESTNET_
CHAIN_ ID - Chain ID of Torvyon Testnet.
Functions§
- mnemonic_
from_ private_ key - The 24-word phrase for a private key.
- private_
key_ from_ mnemonic - Recovers the private key from a 24-word phrase. The phrase’s BIP39
entropy is the key (no seed derivation, no HD path) — see
spec/keys-and-addresses.md. Case and whitespace are normalized.
Type Aliases§
- Result
- Result type for this crate.