Protocol Overview
Last updated
Last updated
Nocturne is a private account abstraction protocol.
At a high level, users can deposit assets into the protocol to one of their stealth addresses. Later, in the future, they can prove ownership of said assets in zero-knowledge for use in arbitrary anonymous contract interactions or confidential payments.
Deposits are how a users can move assets into Nocturne such that they can be transacted with privately in the future. Currently, in order to minimize the inflow of illicit funds, deposits into Nocturne initially go into the Deposit Manager contract. Assets will wait in the contract until an offchain actor called the screener signs off on and completes deposits below a certain compliance risk threshold. Please see our compliance section for the rationale behind the design decision and our long term plans for improving permissionlessness.
Once funds have been deposited, all usage of private funds are initiated from a single Teller contract, which takes a bundle of operations, verifies their proofs, then delegates the processing and execution of individual operations to a second contract called the Handler. To initiate a dapp interaction, a user constructs an Operation
, which encodes some assets to spend and a sequence of contract calls. Nocturne guarantees that:
Right before contract calls are executed, the Handler contract holds exactly the assets declared in Operation
.
Contract calls are carried out directly from the Handler contract.
After the calls are completed, all leftover tokens in the Handler contract are "refunded" to the initiating user's stealth address.
To make sure each user Operation
only spends the assets that the user has declared, deposited assets are held by the Teller, separate from where execution occurs. The Handler contract will request only those assets declared by the Operation
, then perform the contract calls. Once the contract calls are made, the Handler will send any remaining or new funds back to the Teller. The Handler will then create new note commitments for these assets belonging to the user. See the following diagram for a high level view of the workflow.