Crate simplicityhl_core

Crate simplicityhl_core 

Source
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§

DebugTracker
Stores dbg! logs keyed by their label text.
DefaultTracker
Tracks Simplicity execution events and forwards them to configurable sinks.
TaprootPubkeyGen
Container for the seed, public key and derived address.

Enums§

RunnerLogLevel
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.