Skip to main content

Events, membership and confirmation

Recover actual wallet state from successful canonical receipts. A sent transaction or one ciphertext does not establish payment completion. One EVM transaction can contain multiple Core operations, each with multiple outputs.

EventPurpose
NoteOperationOperation ID, token, kind, output count and fee terms
NoteStateTransitionConsumed source trees and nullifiers
PublicDeposit / PublicWithdrawalPublic fund flows for the operation
CommitmentsInsertedActual commitments, tree and contiguous positions
NoteOutputsEncrypted outputs for an operation’s actual range
TransactAggregatedOrdered member operation IDs

Scope associations by Core, canonical block, transaction and operationId. An output range must fit inside one physical insertion; never stitch across insertions or overlap another operation.

operationId is an event association fingerprint, not a merchant order ID, signature or proof. Aggregate operations may share an insertion. Do not double-count merged ERC-20 Transfers and per-operation allocation events.

Read public deposits​

This reusable TypeScript function requires ethers and an application-provided chain provider, trusted Core address and transaction hash. It extracts successful deposit events only; it does not validate private Note openings, index completeness or finality.

import { Interface, JsonRpcProvider } from "ethers";

export async function readDeposits(
provider: JsonRpcProvider, coreAddress: string, transactionHash: string,
) {
const receipt = await provider.getTransactionReceipt(transactionHash);
if (!receipt || receipt.status !== 1) throw new Error("No successful receipt");
const block = await provider.getBlock(receipt.blockNumber);
if (!block || block.hash !== receipt.blockHash) throw new Error("Noncanonical receipt");
const abi = new Interface([
"event PublicDeposit(bytes32 indexed operationId,address indexed token,address indexed payer,uint256 amount)",
]);
return receipt.logs
.filter(log => log.address.toLowerCase() === coreAddress.toLowerCase())
.flatMap(log => {
const event = abi.parseLog(log);
return event?.name === "PublicDeposit" ? [{
operationId: event.args.operationId,
token: event.args.token,
payer: event.args.payer,
amount: event.args.amount,
}] : [];
});
}

Credit events​

Pure creation emits CreditCreated. Creation with an initial payment includes CreditCreated and CreditDraw; later draws pair CreditStateTransition with CreditDraw.

Check the same Core, canonical transaction, output tree, noteCommitment and insertion batch. Count the ordinary Note and payment amount once from CreditDraw; successor Credit comes from the matching state events.

Received is not spendable​

The append-only tree physically stores both Notes and Credit, without merging their business semantics. Membership establishes inclusion in an accepted root; check current nullifiers, revocation and local reservations separately.

A receipt gives inclusion. Applications can additionally require native safe or finalized observations; elapsed time and block counts do not establish those tags. After a reorganization, remove orphan effects and reauthenticate receipts and inventory rather than permanently accumulating observed events.

Use Protocol RPC for candidates and membership data, and session recovery for operation tracking.