Skip to main content

Crate zanolib

Crate zanolib 

Source
Expand description

§zanolib

A Zano wallet library: address parsing, transaction (de)serialization, offline signing, deposit scanning, and threshold (MPC) spend keys.

§Layout

modulecontents
cryptocurve helpers, hash-to-point, key derivation, CLSAG-GGX, Bulletproof+, BGE
basevarints, the binary codec, transactions and their variant payloads
epeethe portable-storage codec used by the daemon’s .bin endpoints
prooftransaction-wide balance, range and asset surjection proofs
rpcJSON-RPC client and deposit scanner (feature rpc)
mpcthreshold spend key via FROST (feature mpc)

Everything else — addresses, wallets, scanning and signing — lives at the crate root.

use zanolib::Wallet;

let mut secret = [0u8; 32];
secret[0] = 1; // any canonical scalar
let wallet = Wallet::load_spend_secret(&secret, 0)?;
println!("{}", wallet.address());

Modules§

base
Zano’s on-the-wire data model: varints, the binary codec, transactions and the tagged-union payloads they carry.
crypto
Zano’s cryptographic primitives: the curve helpers, hash-to-point/scalar functions, key derivation, ChaCha8, and the CLSAG-GGX / Bulletproof+ / BGE proof systems.
epee
A minimal encoder/decoder for epee’s “portable storage” binary format — the serialization used by Zano’s daemon .bin RPC endpoints.
mpc
A Zano spend key under multi-party threshold control, using tsslib’s FROST-ed25519 protocol.
proof
Transaction-wide proofs: balance, output range, and asset surjection.
rng
Randomness sources.
rpc
A minimal client for a Zano daemon, plus the deposit scanner built on it.

Macros§

err
Builds an Error::Msg with format! syntax.

Structs§

Address
A parsed Zano address.
ClsagRequest
Everything a signature needs from an input, minus the spend key.
FinalizeTxParam
Parameters for finalizing and signing a transaction.
FinalizedTx
A constructed (and usually signed) transaction with the parameters it was built from.
LocalInputSigner
Signs with a spend secret held in this process — the default, non-MPC path.
ReceivedOutput
An output detected as belonging to the wallet.
RingMember
One output in an input’s decoy ring, identified by its chain-wide global index. The point fields are the on-chain (1/8-premultiplied) values, exactly as the daemon returns them.
ScanResult
The outputs of one transaction that belong to the wallet.
TransferDest
An output to create: send amount of asset_id to address.
TransferInput
One output to spend: what Wallet::scan_tx recovered, plus a ring of decoys that must include the real output.
TxDest
An output to create: an amount of an asset, to one (or more) addresses.
TxDestHtlcOut
HTLC (hash time-locked contract) options for a destination.
TxSource
An input to spend: its ring, which member is real, and the blinding masks recovered when the output was received.
TxSourceOutputEntry
One ring member of a source: the referenced output and its public data.
ViewWalletData
A JSON-marshalable view-only wallet plus the height to resume scanning from.
Wallet
A Zano wallet: the spend and view key pairs, plus the address flags.

Enums§

AddressType
The kind of a Zano address, encoded as a varint prefix.
Error
Anything that can go wrong while parsing, scanning or signing.

Traits§

InputSigner
Produces the two spend-key-dependent values for one confidential input: the key image and the CLSAG-GGX ring signature.

Functions§

native_coin_asset_id
The native coin’s asset id.

Type Aliases§

Result
The result type used throughout this crate.