How it works
Confidential Intents use a two-chain architecture:- NEAR (Public) — The public blockchain where
intents.nearholds deposited tokens - FAR (Private) — A private NEAR fork where the
intents.farcontract executes swaps with shielded balances
The bridge operates on a request-driven model — it processes deposits and burns via RPC requests rather than actively detecting on-chain events.
token_diff intent, invisible to public indexers.
Asset identifiers
Confidential assets are represented as IMT (Intents Multi-Token) tokens on FAR. Each IMT is backed 1:1 by real tokens held in the Treasury account on the public chain. The token ID format prefixes the public asset ID with a system account:PRIVATE_TREASURY_ACCOUNT_ID in solver configs) is a production constant shared by all participants.
Private Relay
Confidential Intents use a separate Private Relay (PRIVATE_RELAY_WS_URL) instead of the public Message Bus. The private relay:
- Broadcasts quote requests for confidential swaps (asset IDs are IMT-wrapped)
- Collects signed quotes from connected solvers
- Uses
QUOTE_STATUS_EXTENDEDevents (vsQUOTE_STATUSon the public relay) - Verifies signatures against the public
intents.nearcontract, but reads balances from FAR
The private relay uses the same Partner JWT authentication as the public relay. Contact the Defuse team for access to the private relay URL and credentials.
Versioned nonces
Confidential intents require a versioned nonce format that encodes the contract salt and deadline. This differs from public intents where solvers typically use deterministic nonces based on reserves. The nonce is constructed usingVersionedNonceBuilder from the @defuse-protocol/intents-sdk:
Solver response format
When quoting confidential swaps, solvers return signed intents in theprivate_signed_data field:
| Intent | Required | Purpose |
|---|---|---|
shield | No | Transfer of solver’s public liquidity to the Treasury (triggers IMT mint on FAR) |
swap | Yes | Must contain exactly one token_diff. May optionally include an imt_burn if the solver wants output released immediately rather than staying shielded |
recover | If shield present | Fallback imt_burn if the swap fails (shares the swap’s nonce — only one can land) |
quote_settle_successful event before releasing funds.
Unshield notifications
When a solver’s funds are unshielded (private → public), the relay sends anUNSHIELDED status notification via the dedicated shield_status stream. Subscribe to this stream separately from quote_status to receive these notifications:
shield_status event payload contains:
quote_hash: The quote identifierstatus:"unshielded"when funds have been released to public
Shielding and unshielding liquidity
Before quoting confidential swaps, market makers must shield (deposit) liquidity from the public NEAR chain into their private balance on FAR.Shield (deposit into confidential)
Transfer tokens from your public Intents balance to your confidential balance:depositType:INTENTSrecipientType:CONFIDENTIAL_INTENTSrefundType:INTENTS
Unshield (withdraw to public)
Transfer tokens from your confidential balance back to public Intents:depositType:CONFIDENTIAL_INTENTSrecipientType:INTENTSrefundType:CONFIDENTIAL_INTENTS
Next steps
Confidential Example
Detailed walkthrough of solving for confidential intents
Public Intents
Compare with the public intents implementation