Skip to main content

Crate torvyon_core

Crate torvyon_core 

Source
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 bt1 address.
Amount
An exact amount in nibbles. Never uses floating point.
AtomicSwap
Atomic swap helpers. Convenience only — nothing here is a consensus rule.
AtomicSwapParams
Parameters for a swap where both locks are on the same chain.
ChainClock
Block timing of one chain, for converting durations into heights.
ConditionTemplates
Higher-level condition templates built only from deterministic v4 primitives. These are convenience constructors, not extra consensus rules.
EscrowRefundTemplate
Parameters for an escrow/release path with a timed refund path.
HtlcTemplate
Parameters for a hash-time-locked contract.
PaymentChannelTemplate
Parameters for a simple two-party payment-channel style lock.
PrivateKey
A secp256k1 private key. Never printed; zeroized on drop.
PublicKey
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.
SwapLocks
The two locks of a same-chain swap.
SwapSecret
A fresh swap secret. The secret is wiped from memory on drop.
SwapTimeouts
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.