-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
510 additions
and
240 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,26 @@ | ||
# Nacho | ||
|
||
A decentralized and scalable layer-2 solution that allows decentralized trading on top of Mina Protocol. | ||
|
||
Nacho is being built by [**Berzan**](https://berzan.org/) with his love, sweet and tears. | ||
|
||
## System Architecture | ||
|
||
In high level overview, Nacho consists of a sequencer, a prover and a smart contract. | ||
|
||
Nacho has a client, a state database, a witness database, a prover and a smart contract. | ||
|
||
### Client | ||
|
||
The client provides an interface to interact with Nacho. | ||
It uses a custom RPC protocol and data format for low deserialization cost and high performance. | ||
It is the program that runs Nacho. | ||
|
||
### State Database | ||
|
||
The state database stores Nacho's state in a way that allows quick access. | ||
It also stores the leaf index of each data along with the data to provide a constant time to get the witness of a data from the witness database. | ||
|
||
### Witness Database | ||
|
||
The witness database stores the hashes of each data stored in the state database inside an on disk Merkle tree. | ||
It also makes it possible to represent the entire state as a fixed size Merkle root. | ||
It is optimized for high performance and low disk usage. | ||
|
||
### Prover | ||
|
||
The prover generates proofs using user transactions in batches as private inputs and the Merkle root of the entire state as the public input, returning the Merkle root of the updated state as the public output. | ||
|
||
### Smart Contract | ||
|
||
The smart contract stores the Merkle root of the latest state backed up in the smart contract and updates it by verifying proofs generated by the prover. | ||
|
||
### Bridge | ||
|
||
The bridge allows users to send MINA and other tokens to the smart contract on Mina Protocol | ||
and mint them back on Nacho by sending proofs of transfers to the client. | ||
|
||
It also allows users to withdraw MINA and other tokens from the smart contract by burning them on Nacho and sending proofs of burns to the smart contract. | ||
## Running Nacho | ||
|
||
### Required Environment Variables | ||
|
||
- `NACHO_RPC_SERVER_PORT` | ||
- `NACHO_SUBMITTER_PRIVATE_KEY` | ||
- `NACHO_MINA_NODE_URL` | ||
- `NACHO_ROLLUP_CONTRACT_PUBLIC_KEY` | ||
- `NACHO_BRIDGE_CONTRACT_PUBLIC_KEY` | ||
- `NACHO_PROOFS_PATH` | ||
- `NACHO_BALANCES_DB_PATH` | ||
- `NACHO_LIQUIDITIES_DB_PATH` | ||
- `NACHO_POOLS_DB_PATH` | ||
- `NACHO_BURNS_DB_PATH` | ||
- `NACHO_WITHRAWALS_DB_PATH` | ||
- `NACHO_TRANSACTIONS_DB_PATH` | ||
- `NACHO_EVENTS_DB_PATH` | ||
- `NACHO_EVENT_FETCHER_PROCESS_SCRIPT_PATH` | ||
- `NACHO_PROOF_GENERATOR_PROCESS_SCRIPT_PATH` | ||
- `NACHO_PROOF_MERGER_PROCESS_SCRIPT_PATH` | ||
- `NACHO_PROOF_SUBMITTER_PROCESS_SCRIPT_PATH` | ||
- `NACHO_SIGNATURE_VERIFIER_PROCESS_SCRIPT_PATH` | ||
- `NACHO_MEMPOOL_PATH` | ||
- `NACHO_PROOFPOOL_PATH` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.