@heliuslabs/spr - v0.9.0-alpha
    Preparing search index...

    Class ProofInputUtxo

    A UTXO as the circuit consumes it: its fields and the nullifier public key that closes its commitment and the nullifier that spending it publishes.

    The nullifier is derived by whoever holds the nullifier secret (see ShieldedKeys.derive) and carried here as a value, so this type never holds a secret and can cross any boundary, including the wire to a remote key holder. The secret itself enters only the prover witness.

    Index
    • Parameters

      • input: Readonly<
            {
                utxo: Utxo;
                nullifierPublicKey: Bytes32;
                nullifier: Bytes32;
                treeId?: TreeId;
                dataHash?: Bytes32;
                ringDataHash?: Bytes32;
                cacheSlot?: number;
                compact?: boolean;
                address?: boolean;
            },
        >

      Returns ProofInputUtxo

    utxo: Utxo
    nullifierPublicKey: Bytes32
    treeId: number

    The tree the UTXO is spent from.

    dataHash?: Bytes32
    ringDataHash?: Bytes32
    cacheSlot?: number
    addressNullifier?: Bytes32

    The nullifier an address input publishes, which is the reserved address; absent for state spends and padding. A copy taken at construction, so a spread of this input keeps it; the SDK revalidates the input itself wherever it hashes or proves the slot.

    • Reserves an address scoped to a signing owner, a seed and a tree: the slot publishes the address as its nullifier with a non-inclusion proof and spends no state leaf. Only the default confidential transfer proves it. The owner must be an Ed25519 or PDA key. The seed must be a canonical BN254 field value, below the field modulus, and should include the application's program id and the account identifier, so no other program or account derives the same address. Mirrors Rust SppProofInputUtxo::new_address.

      Parameters

      Returns ProofInputUtxo

    • Compact padding in treeId: a dummy over blinding 0 that publishes nullifier 0, so the instruction leaves it out and SPP creates nothing for it. The circuit still checks non-inclusion of its derived nullifier(), so it needs a non-inclusion proof like any dummy. It cannot fill input slot 0. Mirrors Rust SppProofInputUtxo::compact.

      Parameters

      • treeId: number = DEFAULT_TREE_ID

      Returns ProofInputUtxo

    • Rebinds a dummy to another tree and recomputes its zero-key nullifier. A real input's nullifier must be derived by ShieldedKeys for that tree.

      Parameters

      • treeId: number

      Returns ProofInputUtxo

    • Whether this slot reserves an address rather than spending a UTXO.

      Returns boolean

    • Whether the slot needs a state inclusion proof: a real, uncached spend.

      Returns boolean

    • Checks an address input's fields and zero-key nullifier before it is built, hashed or proved. Each failure has its own code. Mirrors Rust SppProofInputUtxo::validate_address.

      Returns void

    • A zero owner is not a parseable key, so a zero-owner input can only stand for an unused slot. Every other field must be zero as well: the circuit treats the slot as absent, and anything carried here would be committed under an owner hash no key can reproduce.

      ringProgramId is checked for presence rather than for a zero value, unlike the two hashes: the zero address commits to pk_field(0), a non-zero field, so it is carried rather than absent.

      The nullifier public key is a zero sentinel, not the public key derived from a zero secret; dummy slots omit it from the circuit. The nullifier must be the zero-key derivation for this exact tree-bound dummy commitment.

      Returns void

    • The nullifier the instruction and the public input carry for this slot: 0 for compact padding, the derived nullifier() otherwise. Mirrors Rust published_nullifier.

      Returns Bytes32