Private proof inputs
The core program declares the following private inputs:
A private input is not the same as an encrypted record. The value participates in proof construction, while a record is a persistent unit of encrypted Aleo state that can later be consumed.
PositionNFT records
PositionNFT contains:
- Owner
- Immutable withdrawal address
- Token ID
- Token program identifiers
- Pool
- Lower and upper ticks
PositionNFT is the confidential ownership capability for public position state. Current liquidity and owed amounts remain in the public positions mapping.
Mint creates the first PositionNFT. Increase, decrease, and collect consume it and return an updated record with the same identifying fields. Burn consumes the final record and returns no replacement.
Token records
Dynamic token records fund and settle the confidential path.Funding records
Mint and increase consume two token records. Swap consumes one token record. The token program moves the requested amount into the AMM’s public balance and returns an encrypted change record for any unspent balance. The exact record schema and authorization rules belong to the dynamically selected token program. The AMM depends on a compatibleIARC20 implementation. Asset onboarding must confirm that the production token program enforces the intended ownership, amount, freeze, and transfer rules.
Payout records
Collect converts public AMM balances into token records owned by the immutablePositionNFT.withdrawal address. Swap claims convert the output and any original-input refund into token records owned by self.signer.
The owner of a token record is confidential from ordinary public state. The amount transferred by the AMM is still public because collect and claim amounts are public arguments and because pending swap amounts are stored publicly before claim.
Compliance records
The program defines three encrypted compliance record types:MintComplianceRecordSwapComplianceRecordMultiHopSwapComplianceRecord
SWAP_INVESTIGATOR_KEY, not by the participant. The record contents are confidential from the public and available to the corresponding investigator-key holder.
All three records include self.signer and self.caller. This preserves both the top-level account and the immediate integration path when a call is routed through another program.
See Compliance records and Caller and signer.
What each record owner can see
Position recipient
The mint recipient can decrypt the PositionNFT. If the recipient differs from the signer, the signer should not be assumed to own or decrypt that position record.Token-record owner
The owner of a token change, output, refund, or collect record can decrypt its token and amount fields according to the token program’s schema.Investigator
The investigator can decrypt compliance records addressed toSWAP_INVESTIGATOR_KEY. The investigator does not gain general authority over participant PositionNFTs or token records from this AMM contract.
Administrator
The admin has no special decryption function inshield_swap.aleo. The program initially assigns the deployer and investigator roles to the same address, so one key holder may control both capabilities. An admin transfer does not move the investigator role.
Mint confidentiality differs from swap confidentiality
Mint does not accept ablinded_address. Its token ID is computed as:
Information not covered by encrypted records
The confidential path does not hide:- Swap amount or direction
- Minimum output or price limit
- Pool or multi-hop route
- Position range
- Desired or minimum mint amounts
- Position token ID
- Liquidity and owed balances
- Claim amount or timing
- Administrative control activity
Lifecycle coverage
The initial mint compliance record links signer, caller, owner recipient, immutable withdrawal address, nonce, and token ID. An investigator can use that token ID to follow later public position-accounting changes. The contract does not issue new compliance records for:- Increase liquidity
- Decrease liquidity
- Collect
- Burn
- Claims
- Freeze or unfreeze