Skip to main content

Summary

Below is an overview of how the main elements of Nyx work together to enable you to store, send, and earn money privately. It has some technical aspects and assumes you have a basic familiarity with blockchains and apps. For a more technical deep-dive, see our Technical Overview.

How login works

Summary

At a high level, login involves first proving that you control an Ethereum address that controls a Nyx private account. Then, fetching and decrypting the encrypted account data for that private account so you can view and use it. These are the steps involved in doing the above:
  1. You sign an off-chain message with your Ethereum wallet.
  2. A zero-knowledge proof is generated in your browser using the signed message.
  3. The proof is sent to our backend (not the signature). The backend validates the proof that you control this Ethereum address (and therefore its associated Nyx account).
  4. If the proof is accepted, the Nyx app prompts you for a passkey you’ve enrolled for your account.
  5. If a passkey is found and verified, your Nyx app session is verified and the app asks the backend for your encrypted private account data.
  6. Your private account data is decrypted in your browser. Now you, and only you, can view and use your private account.
Your account state - contacts list and pending transaction claims - is encrypted on your device and synced to our backend. It is always up to date whenever you log into your account (on the same or different device) and repeat the process above. Privacy and security addition to #3 above: We do not store a mapping from your Ethereum address to your Aztec private address, only a mapping from a hash of your Ethereum address to its associated encrypted private account data. We believe this is safe because once you send funds into a Nyx smart contract when you fund your private account, you publicly reveal that your Ethereum address has a Nyx account. Additionally, the encrypted private account data associated with an Ethereum address can only be decrypted and understood by the owner of that Ethereum address as they have a Nyx passkey used to encrypt the data (learn more).

Diagram


The main elements of Nyx

These are the main elements involved in using Nyx.
  • Your public account: Authorizes private account actions through off-chain message signing.
  • Your private Nyx account on the Aztec blockchain: The Aztec blockchain was built to enable private account balances and actions. This is where your private account lives, with a balance and actions invisible to everyone else (including us).
  • The Nyx app frontend (in your browser): This is where you view your private account and initiate private actions. When you initiate a private transaction, the following happens: your Ethereum wallet signs an off-chain message approving the transaction and then a zero knowledge proof containing this and the transaction information is generated on your browser and submitted to the Aztec blockchain.
  • The Nyx app backend: Stores a limited amount of information - such as your contacts, account secret, and pending asset claim secrets - in an encrypted form we cannot read. This is so that you can easily move across devices and so that you do not have the burden of having to store things like your contacts.
  • Your passkey(s): This is used in your browser to encrypt information sent to our backend (and decrypt information loaded from our backend). This is how we ensure that only you can view and use your private account.
  • Smart contracts: Nyx smart contracts on the Ethereum and Aztec blockchains (along with Aztec, Aave, and other smart contracts). These facilitate Nyx actions.
  • Nyx relayers: The relayer’s purpose is to monitor the Aztec network for certain events (messages), and then call the corresponding Ethereum contracts to finalize those message operations on Ethereum. One main benefit from this pattern is that the relayer is shown as the sender and there is no link to your public account that approved the action in Nyx. Examples include depositing into, and redeeming from Aave, which are anonymous actions you can take using Nyx.
The first five elements are shown in the images above. For a look at how smart contracts and relayers fit in, see our diagrams of how Nyx features work (e.g. private Earn)