RootPN

(Work in progress) RootPrivateNote Contract Interface Documentation

file-download
3KB

Overview

RootPN is the system root contract responsible for deploying and managing PrivateNote contracts. It also stores and manages the canonical contract code for related system components, including Pari Mutuel Pool, Oracles, and Nullifiers.

The contract acts as a trusted entry point for:

  • zero-knowledge–verified deposits

  • deterministic deployment of PrivateNote

  • system-wide code upgrades


Events

PrivateNoteDeployed

Emitted when a new PrivateNote contract is deployed.

event PrivateNoteDeployed(
    uint256 depositIdentifierHash,
    address noteAddress,
    uint128 initialBalance
);

Meaning:

  • A PrivateNote was successfully deployed

  • The address is deterministically derived from the deposit identifier


NullifierDeployed

Emitted when a Nullifier contract is deployed.

Meaning:

  • A nullifier was created to prevent double-spending

  • Funds were transferred to the associated PrivateNote


Public & External Interface

sendEccShellToPrivateNote

Sends ECC Shell tokens to a PrivateNote after zero-knowledge proof verification.

Parameters:

  • proof — zero-knowledge proof validating the deposit

  • nullifier_hash — unique nullifier preventing double spend

  • deposit_identifier_hash — deposit identifier hash

  • value — amount of ECC Shell tokens to mint and transfer

Behavior:

  • Verifies the proof using zkhalo2verify

  • Mints ECC Shell tokens

  • Deploys a Nullifier contract

  • Forwards minted tokens to the corresponding PrivateNote

  • Emits NullifierDeployed


deployPrivateNote

Deploys a new PrivateNote contract after ZK verification.

Parameters:

  • zkproof — zero-knowledge proof of deposit validity

  • deposit_identifier_hash — unique deposit identifier

  • ethemeral_pubkey — public key for the note

  • value — initial token balance

  • token_type — token type identifier

Behavior:

  • Verifies token type

  • Validates the deposit via zero-knowledge proof

  • Computes deterministic PrivateNote address

  • Deploys the PrivateNote contract

  • Emits PrivateNoteDeployed


privateNoteDeployed

Records the deployment of a PrivateNote.

Access Control:

  • Callable only by the corresponding PrivateNote contract

Behavior:

  • Updates internal accounting of deployed values by token type


View Functions

getPrivateNoteCode

Returns the salted PrivateNote contract code.

Returns:

  • privateNoteCode — salted code cell

  • privateNoteHash — hash of the salted code


getDetails

Returns core RootPN state information.

Returns:

  • hash of PMP code

  • hash of PrivateNote code

  • root owner public key

  • current contract balance


getVersion()

Returns version information for the RootPN contract.

Returns:

  • semantic version string

  • contract identifier: "RootPN"

Last updated