PrivateNote
(Work in progress) PrivateNote Contract Interface Documentation
Overview
PrivateNote is a non-custodial wallet contract bound to a single deposit identifier. It allows users to deploy and interact with Pari Mutuel Pool (PMP) contracts, manage stakes, claim rewards, and withdraw tokens — all while preserving privacy guarantees.
Each PrivateNote:
is deterministically deployed by
RootPNis controlled by an public key
maintains internal token balances
enforces single-operation-at-a-time semantics via a “busy” lock
Events
OwnerChanged
Emitted when the owner public key is updated.
event OwnerChanged(uint256 oldPubkey, uint256 newPubkey);oldPubkey- Previous public keynewPubkey- New public key
StakeConfirmed
Emitted after a stake is successfully accepted by a PMP.
stakeController- Address of the PMP contract that accepted the stakeoutcome- Outcome identifier the stake was placed onamount- Amount of tokens added to the stake
StakeCancelled
Emitted after a stake is cancelled and refunded.
stakeController- Address of the PMP contract that cancelled the stakeoutcome- Outcome identifier of the cancelled stakeamount- Amount of tokens returned
ClaimAccepted
Emitted when a claim is resolved and payout is credited.
stakeController- Address of the PMP contractoutcome- Final resolved outcome. Empty if the event is not yet resolvedpayout- Amount of tokens paid to the wallet
PMPDeployed
Emitted when a new PMP contract is deployed.
name- Name of the PMP eventtoken_type- Token type used for stakingpmpAddress- Address of the deployed PMP contractoracleEventLists- Oracle event list contract addressesoracleFee- Oracle fee values corresponding to each oracle
Public & External Interface
changeOwner
changeOwnerChanges the public key controlling the wallet.
Parameters:
new_pubkey— Public key of the new owner
Access Control:
Must be signed by the current public key
Effects:
Updates owner key
Emits
OwnerChanged
deployPMP
deployPMPDeploys a new PMP contract associated with this wallet
Parameters:
name— unique PMP nameoracleFee— oracle fees per oracletoken_type— token used for stakingnames— oracle namesindex— oracle event list indices
Behavior:
Computes oracle list hash
Calculates required oracle fees
Deploys PMP deterministically
Emits
PMPDeployed
setStake
setStakePlaces or increases a stake on a PMP
Parameters:
name- Name of thePMPevent. Used to derive the unique event identifier and the targetPMPcontract address.oracle_list_hash- Hash of the oracle list configuration associated with thePMPevent. Must match the oracle list used when thePMPcontract was deployed.token_type- Token type used for staking. Must correspond to a token balance available in the wallet.outcome- Identifier of the outcome being staked on. The meaning of the outcome is defined by thePMPcontract logic.amount- Amount of tokens to stake. Must be greater than zero and less than or equal to the available balance for the specified token type.
Rules:
Wallet must not be busy
Balance must be sufficient
Stake is first stored as
candidate_amountPMPconfirmation is required
cancelStake
cancelStakeCancels an existing stake.
Parameters
name- Name of thePMPevent. Used to derive the event identifier and the address of the targetPMPcontract.oracle_list_hash- Hash of the oracle list configuration associated with thePMPevent. Must match the oracle list hash of the existing stake.token_type- Token type used for the stake being cancelled. Must correspond to the token type of the existing stake entry.outcome- Identifier of the outcome for which the stake was placed. Specifies which stake position should be cancelled.
Behavior:
Calls
PMPto cancel stakeLocks wallet until response
deleteStake
deleteStakeDeletes a local stake record without interacting with PMP.
Parameters:
name- Name of thePMPevent. Used to derive the internal stake identifier stored in the wallet.oracle_list_hash- Hash of the oracle list configuration associated with the stake. Must match the oracle list hash used when the stake entry was created.token_type- Token type of the stake being deleted. Used to identify the correct local stake record.outcome- Identifier of the outcome associated with the stake. Specifies which stake record should be removed.
Use case:
Cleanup after expiration or full resolution
claim
claimClaims winnings from a resolved PMP.
Parameters
name- Name of thePMPevent. Used to derive the event identifier and the address of the targetPMPcontract.oracle_list_hash- Hash of the oracle list configuration associated with thePMPevent. Must match the oracle list hash of the existing stake.token_type- Token type used for the stake. Determines which internal balance will receive the payout.outcome- Outcome identifier originally selected by the user when placing the stake. Used to identify the stake position being claimed.
withdrawTokens
withdrawTokensWithdraws tokens from the wallet via the Vault.
Parameters
flags- Transfer flags passed to the Vault contract. Control message delivery behavior during the token transfer.dest_wallet_addr- Destination wallet address that will receive the withdrawn tokens.token_type- Type of token to withdraw. All available balance for this token type will be withdrawn.
Behavior:
Transfers full balance of the given token type
Resets local balance to zero
Bounce Handling
onBounce
Handles bounced PMP calls.
Behavior:
Clears busy state
Restores candidate stake amount
Ensures balance consistency
View Functions
getPMPCode()
getPMPCode()Returns salted PMP code and its hash.
getDetails()
getDetails()Returns current wallet state:
deposit identifier hash
public key
token balances
PMP code hash
PrivateNote code hash
busy PMP address (if any)
getVersion()
getVersion()Returns version and contract identifier.
Last updated