Reset SMT Root

Operator-only instruction that rotates the Sparse Merkle Tree by incrementing Instance.current_tree_index and resetting the withdrawal root, allowing a new epoch of 65,536 withdrawals.

The escrow program is migrating from this Sparse Merkle Tree design to an on-chain nonce bitmap (tracked upstream), where this instruction becomes RotateBitmap. This page is accurate against the current escrow program and will be reworked once that change lands.

Accounts

AccountWritableSignerDescription
payer✓✓Fee payer
operator✓Operator signer
instance✓Escrow instance PDA (current_tree_index incremented)
operator_pdaOperator PDA proving the signer is provisioned
event_authorityEvent authority PDA for EmitEvent CPI
private_channel_escrow_programEscrow Program (self-reference for CPI)

Parameters

ParameterTypeDescription
expected_current_tree_indexu64Replay guard; must match Instance.current_tree_index or the call fails

Returns

Returns a TransactionBuilder that can be used to build and send the transaction.

Example

import { getResetSmtRootInstruction } from "../private-channel-escrow-program/clients/typescript/src/generated";
const resetIx = getResetSmtRootInstruction({
payer: operatorPayerSigner,
operator: operatorSigner,
instance: instancePda,
operatorPda: operatorPdaAddress,
eventAuthority: eventAuthorityPda,
privateChannelEscrowProgram: ESCROW_PROGRAM_ID,
expectedCurrentTreeIndex: currentTreeIndex // u64
});

Important Notes

  • Operator-only: requires a valid operator_pda; throws InvalidOperatorPda otherwise
  • expected_current_tree_index must equal Instance.current_tree_index at call time; a stale value throws UnexpectedTreeIndex, guarding against replaying a reset that already landed
  • Increments Instance.current_tree_index; nonces valid in the previous tree epoch are invalidated after rotation
  • The operator-private-channel service calls this automatically when transaction_nonce % 65536 == 0 (and nonce > 0), signaling the start of a new epoch; it should not need to be called manually under normal operation
  • After rotation, the withdrawal root resets to the empty tree, so new withdrawals start from a fresh SMT
  • Emits an event via EmitEvent CPI

Is this page helpful?

Table of Contents

Edit Page
© 2026 Solana Foundation. All rights reserved.