torvyon-core 0.1.2

Keys, addresses, post-quantum signing and transaction building for the Torvyon blockchain
Documentation

torvyon-core

Keys, recovery phrases, bt1/tbt1 addresses, Schnorr signing and UTXO transaction building for the Torvyon blockchain.

Pure logic — no network, no I/O, no async. Every encoding is tested against vectors generated by the Torvyon node itself.

use torvyon_core::{
    tx::{build_payment, Payment},
    Address, Amount, PrivateKey, MAINNET_CHAIN_ID,
};

let key = PrivateKey::from_hex(private_key_hex)?;
let from = key.address();
let payment = Payment {
    to: Address::parse("bt1…")?,
    amount: Amount::from_byte_str("1.5")?,
    fee: Amount::from_nibbles(3_000), // Standard
    data: vec![],
};
let signed = build_payment(MAINNET_CHAIN_ID, &from, &spendable_utxos, &payment)?.sign(&key)?;
let body = signed.to_json()?; // POST to https://api.torvyon.tech/api/v1/tx/broadcast
  • Networks: mainnet (torvyon-mainnet, bt1…) is the default; testnet (torvyon-testnet-1, tbt1…) via the *_for_network functions. Free test Byte: https://testnet.torvyon.tech/faucet/.
  • Hardware wallets: sighash() on the unsigned transaction, sign on the device, then with_signature(public_key, signature).
  • Conditional outputs: Condition exposes the consensus primitives, and ConditionTemplates composes them into treasury multisig, vesting, escrow/refund, HTLC and payment-channel locks.
  • Amounts are exact nibbles (1 Byte = 100,000,000 nibbles); no floats.
  • Keys are never printed (Debug is redacted) and are zeroized on drop.

Protocol spec, test vectors and the node API (OpenAPI) live in the repository. JavaScript/TypeScript: @torvyon/sdk.

More examples: docs/examples.md and examples/rust/build_payment.rs in the repository.

License: MIT.