Skip to content

Commit

Permalink
Modify docs (#935)
Browse files Browse the repository at this point in the history
Co-authored-by: Mauro Toscano <12560266+MauroToscano@users.noreply.github.com>
  • Loading branch information
diegokingston and MauroToscano authored Sep 9, 2024
1 parent ad76d55 commit 42cc5f5
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 14 deletions.
10 changes: 10 additions & 0 deletions docs/1_introduction/0_about_aligned.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ Aligned has created a new category in crypto: ZK verification layer. It is the o

Other solutions focus on building a separate L1 for proof verification (which sets them apart from Ethereum and requires bootstrapping the economic security, which can be lowered and subject to volatility, as opposed to that provided by restaking) or focus on the aggregation of proofs from a few proof systems. This last approach adds latency, higher operational costs, and constrains the developer's choice of the proof system.

The following table contains costs estimates for Aligned, assuming a batch size of 20 proofs.

| Proof system | Ethereum | Aligned - Fast mode | Aligned - Aggregation |
| -------- | -------- | -------- | ---------- |
| Groth16 | 250,000 | 40,000 | TBD |
| STARKs | >1,000,000 | 40,000 | TBD |
| Kimchi-IPA | ?????? | 40,000 | TBD |
| Halo2-KZG | 350,000 | 40,000 | TBD |
| Binius. | ?????? | 40,000 | TBD |

## Why are we building Aligned?

In recent months, we have witnessed the development and enhancement of general proving virtual machines such as Risc0, Valida, Jolt, and SP1. These innovations allow users to write ordinary code in languages like Rust or C and generate proofs demonstrating the integrity of computations. This evolution is poised to transform application development, provided we have verification networks with high throughput and low cost. This is the core vision of Aligned and the reason we are building it: the future belongs to provable applications.
Expand Down
1 change: 1 addition & 0 deletions docs/1_introduction/1_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
In this tutorial, you will learn how to send your first SP1 proofs to get verified in Aligned in under 3 minutes.

## Quickstart

We will download a previously generated SP1 proof, send it to Aligned for verification, and retrieve the results from Ethereum Holesky testnet.

1. Download and install Aligned to send proofs in the testnet:
Expand Down
5 changes: 2 additions & 3 deletions docs/1_introduction/2_zkquiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## Introduction

This program leverages Aligned's ZK verification infrastructure to run a small quiz.
If answered correctly, the user receives an NFT.
This program leverages Aligned's ZK verification infrastructure to run a small quiz. The proof allows any party to check that the quiz was answered right or wrong. If answered correctly, the user receives an NFT.

The process is as follows:

Expand All @@ -12,7 +11,7 @@ The process is as follows:
3. The proof is posted on Aligned.
4. Upon verification, ZKQuiz mints an NFT via a Smart Contract.

The NFT is only granted if the user answers correctly.
The NFT is only granted if the user's answers correctly.
Incorrect answers or tampering with the ZKQuiz code will result in proof generation failure or mismatched checksums,
preventing NFT minting.

Expand Down
6 changes: 3 additions & 3 deletions docs/1_introduction/3_use_cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
- Verifiable Machine Learning (ML): with general-purpose zkvms we can prove code written in Rust, solving part of the problem of using ML. However, most zkVMs use STARK-based proof systems, which leads to high on-chain costs or expensive wrapping. With Aligned, you can directly verify your proof from the zkVM for much less than Ethereum.
- Cheap verification and interoperability for Identity Protocols.
- ZK Oracles: With ZK oracles we can show that we have a piece of information off-chain and produce a ZK proof doing some computation with that data. Aligned reduces the cost of using those oracles. For more background, see the [following post](https://minaprotocol.com/blog/what-are-zkoracles).
- New credential protocols such as zkTLS based systems.
- ZK Coprocessor.
- New credential protocols such as zkTLS based systems: you can create proofs of data shown on your web browser and have the result verified in Ethereum. See the following thread for an [ELI5 on TLS](https://x.com/dabit3/status/1830022029195501799)
- ZK Coprocessor: ZK allows complex computations to be delegated from the blockchain to a coprocessor. This can retrieve information from the blockchain and perform the computations securely in a more efficient way.
- Encrypted Mempools using SNARKs to show the correctness of the encryption.
- Protocols against misinformation and fake news.
- Protocols against misinformation and fake news: you can generate proofs that an image or audio comes from a given device, and show that a published image is the result of certain transformations performed on the original image.
- On-chain gaming.
8 changes: 6 additions & 2 deletions docs/1_introduction/4_faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Aligned’s mission is to extend Ethereum’s zero-knowledge capabilities. We ar

### What is the throughput of Aligned?

Aligned runs the verifier’s code natively. The verification time depends on the proof system, program run, and public input. Generally, most verifiers can be run in the order of ms on consumer-end hardware. We can optimize the code for speed and leverage parallelization by running it natively. Current testnet can verify more than 2500 proofs per second.
Aligned runs the verifier’s code natively. The verification time depends on the proof system, program run, and public input. Generally, most verifiers can be run in the order of ms on consumer-end hardware. We can optimize the code for speed and leverage parallelization by running it natively. Current testnet can verify more than 4000 proofs per second.

### How does the throughput of Aligned compare with Ethereum?

Expand All @@ -30,7 +30,7 @@ $$

### Why do you have a fast and aggregation mode?

The fast mode is designed to offer very cheap verification costs and low latency. It uses crypto-economic guarantees provided by restaking; costs can be as low as 2100 gas. The aggregation mode works with proof aggregation, with higher fees and latency, and achieves the complete security of Ethereum. We verify an aggregated BLS signature (around 113,000 gas) in the fast mode. We verify an aggregated proof (around 300,000 gas) in the aggregation mode.
The fast mode is designed to offer very cheap verification costs and low latency. It uses crypto-economic guarantees provided by restaking; costs can be as low as 21000 gas. The aggregation mode works with proof aggregation, with higher fees and latency, and achieves the complete security of Ethereum. We verify an aggregated BLS signature (around 113,000 gas) in the fast mode. We verify an aggregated proof (around 300,000 gas) in the aggregation mode.

### Why don’t you run Aligned on top of a virtual machine?

Expand Down Expand Up @@ -164,3 +164,7 @@ Aligned is just a network of decentralized verifiers renting security from Ether
### Why do we need a ZK verification layer?

Verifiable computation allows developers to build applications that help Ethereum scale or even create applications that were not possible before, with enhanced privacy properties. We believe the future of Ethereum will be shaped by zero-knowledge proofs and help it increase its capabilities.

### How about Aligned and TEE?

We want Aligned to verify TEE attestations. We think TEEs provide an alternative to ZK in some applications where ZK is too computationally intensive or as an additional mechanism to provide integrity (the case of multiproofs).
12 changes: 6 additions & 6 deletions docs/2_architecture/components/2_payment_service_contract.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Payment Service

The Payment Service handles User's payments to fund the verification of their proofs.
The Payment Service handles users payments to fund the verification of their proofs.

To be able to use the batcher, a user must fund its transactions.
For this, there is a simple Batcher Payment System.
Expand All @@ -12,7 +12,7 @@ and it guarantees that it can only spend these funds to send users' proofs to Al
Users must first deposit into this contract, via a normal transfer to its address,
where the Batcher Payment System will update the User's balance.

Users send proofs to the Batcher, which checks for sufficient funds.
Users send proofs to the Batcher, which checks whether there are enough funds.
Once a batch is complete, the Batcher calls its smart contract with the collected user data

The smart contract deducts funds from senders' balances and creates a new Batch in
Expand All @@ -21,13 +21,13 @@ including tokens for batch verification payment to the [Aggregator](./5_aggregat

Users can then withdraw extra funds deposited to the Batcher Payments smart contract,
or leave them to fund future proofs.
For this, to avoid causing a Denial of Service on the Batcher, Users must first call the contract's `unlock` function,
To avoid causing a Denial of Service on the Batcher, Users must first call the contract's `unlock` function,
and then call `withdraw` at least 100 blocks later, to finish their withdrawal process.
This enables the Batcher to be sure the User will have funds to pay for his proofs when `createNewTask` is called.

This way, the Batcher can only use User funds to pay for the verification of the User's proofs. The Batcher Payment Service guarantees that the Batcher will not be able to spend the user funds for anything other than submitting the user's proofs to Aligned.
This way, the Batcher can only use the User's funds to pay for the verification of the User's proofs. The Batcher Payment Service guarantees that the Batcher will not be able to spend the user funds for anything other than submitting the user's proofs to Aligned.

The way it does is:
The flow is:

- When the batcher calls the smart contract to create a new batch,
it gets the batch merkle tree leaves, with each leaf, signed by the user.
Expand All @@ -39,7 +39,7 @@ The way it does is:
discount the corresponding funds from the user's balance and
create a new batch in the [Aligned Service Manager](./3_service_manager_contract.md).

## Diagram
## Payment service architecture and flow

![Payment Service Flow Diagram](../../images/payment_service_diagram.png)

Expand Down

0 comments on commit 42cc5f5

Please sign in to comment.