-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(website): update proving docs (#13915)
- Loading branch information
Showing
7 changed files
with
75 additions
and
35 deletions.
There are no files selected for viewing
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
11 changes: 0 additions & 11 deletions
11
packages/website/pages/docs/concepts/proving-taiko-blocks/_meta.json
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/website/pages/docs/concepts/proving-taiko-blocks/provers.mdx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/website/pages/docs/concepts/proving-taiko-blocks/the-oracle-prover.mdx
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...ges/docs/concepts/proving-taiko-blocks/verified-blocks-and-parallel-proving.mdx
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import Image from "next/image"; | ||
|
||
# Proving Taiko blocks | ||
|
||
## Overview | ||
The purpose of proving blocks is to give certainty to bridges about the execution that happened in the rollup. To rely on some state that happened inside of the rollup, a bridge will want a proof that everything was done correctly. On Taiko you can run a node as a prover and prove blocks, permissionlessly. This means that you can examine the proposed blocks on the TaikoL1 contract, and generate proofs for them. Currently, any prover can create proofs for proposed blocks. This means that the number of "fork choices" has no upper bound, because we don't know what is the correct state transition yet. Only first prover with a valid proof of the correct fork choice (state transition) will receive the reward of TTKO. | ||
|
||
## Verified blocks and parallel proving | ||
There are three states that a block can be in on Taiko: | ||
- Proposed | ||
- Proved | ||
- Verified | ||
|
||
We already know what a proposed block is (must pass at least the block-level intrinsic validity tests to be accepted by the TaikoL1 contract). Next, a proposed block can be valid or invalid, depending on whether it passes the transaction list intrinsic validity test. A block is invalid if it fails the transaction list intrinsic validity test, and this block is not created on Taiko. | ||
|
||
Now, a block can be proved, but also further "verified". What's the difference? A block is proved if it has a valid proof which proves a state transition from one state (parent block) to another (current block). However, blocks are proven in parallel by the decentralized provers. So while a block can prove a parent block transitions to the current block, we don't know if the parent block itself has been proven. As you can see, for a block to be "verified", it needs to prove the valid state transition to the current block, but the parent also need to be verified. We assume that the genesis block (which has no parent), is verified. So all the children blocks from genesis to the current block need to have proofs of their state transition for the current block to be "verified". | ||
|
||
For the visual learners here is a visualization of the three stages (proposed -> proved -> verified) | ||
|
||
**Proposed:** | ||
<center> | ||
<Image src="/images/diagrams/concepts/proving-taiko-blocks/proposed.png" alt="proposed" width={400} height={400} /> | ||
</center> | ||
**Proved:** | ||
<center> | ||
<Image src="/images/diagrams/concepts/proving-taiko-blocks/proved.png" alt="proved" width={400} height={400} /> | ||
</center> | ||
**Verified:** | ||
<center> | ||
<Image src="/images/diagrams/concepts/proving-taiko-blocks/verified.png" alt="verified" width={400} height={400} /> | ||
</center> | ||
|
||
## Types of provers | ||
### Community prover | ||
|
||
Currently, you only need a single proof from the any prover to verify a block. | ||
|
||
### Oracle prover | ||
|
||
The oracle prover is a prover from a unique address (our own address) that is able to override the community prover. This is a safety mechanism we have in place while the ZK-EVM is still in development and in case an invalid block was marked as verified from a community proof. | ||
|
||
### System proof | ||
|
||
A system proof is a fake proof that is generated by the system to mark a block as verified. We only require a real proof to be generated every N blocks. Otherwise, we accept a fake, system proof, and mark the block as verified. This is a temporary testnet feature to reduce the cost for community provers. | ||
|
||
### The proof cooldown period | ||
|
||
We have a proof cooldown period which is an interval of time we set after fully verifying a block. The reason we do that is to allow for a fault proof to come in, once we have a multi-prover system set in place. | ||
|
||
|
||
## Prover dynamics | ||
|
||
### How the proof reward is determined | ||
|
||
A proof reward in TTKO is rewarded for successfully proving a block. This reward is dependent on the `proofTimeTarget`. You can see the current proof reward by calling `getProofReward` on the TaikoL1 contract. | ||
|
||
So that we don't grow a long list of unverified blocks for too long, we want to target proofs coming in at a certain rate. So we set a target proof time. If it has taken a long time since the last verified block, the proof reward increases to incentivize provers to generate a proof. | ||
|
||
Conversely, if everyone is submitting proofs quickly, then the proof reward decreases towards zero. This means that as a prover, you should query `getProofReward` on the TaikoL1 contract to determine if it is profitable to generate a proof. If you submit proofs as quickly as possible, then the proof reward will trend towards zero. | ||
|
||
### Default in simple-taiko-node | ||
|
||
The [simple-taiko-node](https://github.com/taikoxyz/simple-taiko-node) will come pre-configured to not submit proofs as quickly as possible, by querying `getProofReward`. This hopefully means that most nodes in the network are acting in the group interest, by responsibly not submitting the proof as quickly as possible. However, because the first prover will win the reward, and because the project is open source, anybody can modify the [taiko-client](https://github.com/taikoxyz/taiko-client) and act rationally to submit a proof slightly earlier than the default set in `simple-taiko-node`. As you can see, it causes somewhat of a prisoner's dilemma. | ||
|
||
### Proof skip | ||
|
||
We have a `realProofSkipSize` set [here](https://github.com/taikoxyz/taiko-mono/blob/main/packages/protocol/contracts/L1/TaikoConfig.sol#LL40C13-L40C30) so that a real proof is only needed every N blocks for the testnet. | ||
|
||
### Your role as a prover | ||
|
||
We are describing this dynamic so you can be informed when you run a prover. It's very possible that without the correct strategy, you will not be profitable as a prover. You are naturally competing in an open space where others could have more efficient hardware and generate a proof in a short amount of time that you cannot compete against. |
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