Module builder

Module builder 

Source
Expand description

Convenience builders for constructing shielded state transitions.

These functions encapsulate the full Orchard bundle construction pipeline: builder configuration, proof generation, signature application, and serialization into platform state transitions.

Requires the shielded-client feature, which pulls in grovedb-commitment-tree (and transitively the orchard crate).

§Example

use dpp::shielded::builder::*;
use grovedb_commitment_tree::{SpendingKey, FullViewingKey, Scope, ProvingKey};

// Derive recipient address
let sk = SpendingKey::from_bytes(seed)?;
let fvk = FullViewingKey::from(&sk);
let recipient = OrchardAddress::from_raw_bytes(
    &fvk.address_at(0, Scope::External).to_raw_address_bytes(),
);

// Build a shield transition
let pk = ProvingKey::build();
let st = build_shield_transition(
    &recipient, shield_amount, inputs, fee_strategy,
    &signer, 0, &pk, [0u8; 36], platform_version,
)?;

Structs§

SerializedBundle
The serialized fields extracted from an authorized Orchard bundle, ready for use by state transition constructors.
SpendableNote
A note that can be spent in a shielded transaction, paired with its Merkle inclusion path in the commitment tree.

Traits§

OrchardProver
Trait abstracting over Orchard proof generation.

Functions§

build_shield_from_asset_lock_transition
Builds a ShieldFromAssetLock state transition (core asset lock -> shielded pool).
build_shield_transition
Builds a Shield state transition (transparent platform addresses -> shielded pool).
build_shielded_transfer_transition
Builds a ShieldedTransfer state transition (shielded pool -> shielded pool).
build_shielded_withdrawal_transition
Builds a ShieldedWithdrawal state transition (shielded pool -> core L1 address).
build_unshield_transition
Builds an Unshield state transition (shielded pool -> platform address).
serialize_authorized_bundle
Serializes an authorized Orchard bundle into the raw fields used by state transition constructors.