Expand description
High-level helpers for building and executing Simplicity programs on Liquid.
This crate provides:
- Address derivation for P2TR Simplicity programs
- Utilities to compile and run programs with optional logging
- Helpers to finalize transactions with Simplicity script witnesses
- Esplora integration and small conveniences around Elements types
Structs§
- Debug
Tracker - Stores
dbg!logs keyed by their label text. - Default
Tracker - Tracks Simplicity execution events and forwards them to configurable sinks.
- Taproot
Pubkey Gen - Container for the seed, public key and derived address.
Enums§
- Runner
LogLevel - Controls verbosity of program execution.
Constants§
- LIQUID_
DEFAULT_ REGTEST_ ASSET_ STR - Policy asset id (hex, BE) for Elements regtest.
- LIQUID_
POLICY_ ASSET_ STR - Policy asset id (hex, BE) for Liquid mainnet.
- LIQUID_
TESTNET_ POLICY_ ASSET_ STR - Policy asset id (hex, BE) for Liquid testnet.
- P2PK_
SOURCE - Embedded Simplicity source for a basic P2PK program used to sign a single input.
Statics§
- LIQUID_
TESTNET_ BITCOIN_ ASSET - LBTC asset id for Liquid testnet.
- LIQUID_
TESTNET_ GENESIS - Genesis block hash for Liquid testnet.
- LIQUID_
TESTNET_ TEST_ ASSET_ ID_ STR - Example test asset id (hex, BE) on Liquid testnet.
Functions§
- broadcast_
tx - Broadcast a transaction to Liquid testnet Esplora. Returns the txid string on success.
- control_
block - create_
p2tr_ address - Generate a non-confidential P2TR address for the given program CMR and key.
- execute_
p2pk_ program - Execute the compiled P2PK program against the provided env, producing a pruned redeem node.
- fetch_
utxo - Fetch UTXO given the txid and vout
- finalize_
p2pk_ transaction - Finalize the given transaction by attaching a Simplicity witness for the specified P2PK input.
- generate_
public_ key_ without_ private - Generate a valid ephemeral public key and its seed; repeats until valid.
- get_
new_ asset_ entropy - Compute issuance entropy for a new asset given an outpoint and contract hash entropy.
- get_
p2pk_ address - Construct a P2TR address for the embedded P2PK program and the provided public key.
- get_
p2pk_ program - Compile the embedded P2PK program with the given X-only public key as argument.
- get_
random_ seed - System-random 32-byte seed.
- hash_
script_ pubkey - SHA256 hash of an address’s scriptPubKey bytes.
- load_
program - Load program source and compile it to a Simplicity program.
- run_
program - Satisfy and execute a compiled program in the provided environment. Returns the pruned program and the resulting value.