Skip to content

Commit 908b022

Browse files
Add ScribeOptimistic to docs
1 parent ed7f1c3 commit 908b022

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed
File renamed without changes.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
# ScribeOptimistic
5+
6+
## Background
7+
8+
[ScribeOptimistic](https://github.com/chronicleprotocol/scribe/blob/41f25a8a40f1a1d2ef62d6a073f98a3c57d23579/src/ScribeOptimistic.sol) is a contract that builds upon [Scribe](https://github.com/chronicleprotocol/scribe/blob/41f25a8a40f1a1d2ef62d6a073f98a3c57d23579/src/Scribe.sol), providing additional optimistic poke functionality on **Layer 1 blockchains**.
9+
10+
### Problem Statement
11+
12+
On Layer 1 blockchains, computation is expensive, and signature aggregation is a gas-intensive process. This makes onchain verification of Schnorr signatures costly, as it requires a significant amount of gas.
13+
14+
### Solution
15+
16+
ScribeOptimistic addresses this issue by introducing the `opPoke()` function, which enables offchain verification of Schnorr signatures. This allows for a more efficient and cost-effective way to verify signatures on Layer 1 blockchains.
17+
18+
## How Does it Work?
19+
With ScribeOptimistic all values optimistically proposed by validators are put into a public “buffer” and get automatically accepted after the challenge period.
20+
21+
During the challenge period, anyone can verify the signature offchain. If you find a signature to be invalid you can additionally call `opChallenge()` to collect an ETH reward by having the Oracle verify the signature onchain. `OpChallenge()` can be called at any time, but only successful challenges will procure the reward.
22+
Upon a successful challenge, the challenger will receive a reward in ETH, the optimistic answer gets dropped, and the validator responsible for the answer will be removed.
23+
24+
25+
<div style={{textAlign: 'center'}}>
26+
<img
27+
src="/img/Intro/Scribe/scribeOp.jpg"
28+
alt="Scribe Optimistic"
29+
/>
30+
</div>
31+
32+
The ETH reward is sent directly inside the `opChallenge()` transaction to the challenger if the opPoke is invalid. In other words, Chronicle Protocol will pay you to monitor their Oracles and challenge invalid data.
33+
34+
To check the current challenge period, you can check the `opChallengePeriod`’s value using `opChallengePeriod()` which returns a value in seconds. Similarly, you can check the reward for successfully challenging the opPoke using the `challengeReward()`.
35+
36+
## `OpPoke()`
37+
38+
The `opPoke()`allows a validator to sign a (value, age) tuple and a corresponding Schnorr signature offchain, using ECDSA. Here, the value represents the data that the validators reached consensus on as the next data for the Oracle to deliver, and the age is the timestamp of this value.
39+
40+
### Steps:
41+
42+
- A validator signs a (value, age) tuple and a corresponding Schnorr signature offchain, using ECDSA.
43+
- The signed data is then sent to the `opPoke()`.
44+
- `OpPoke()` binds the validator to the signed data. A public callable `opChallenge()` can be called to challenge the data.
45+
- The validator is now associated with the signed data, and the data is considered "poked" after the challenge period ends.
46+
47+
## `OpChallenge()`
48+
49+
The `opChallenge()` function is a public callable function that can be called at any time. Its purpose is to verify the current optimistically poked data to remove any potential invalid opPokes and remove the validator that submitted an invalid `opPoke()`.
50+
51+
### Steps:
52+
53+
- `OpChallenge()` is called, which triggers the verification process.
54+
- The function performs the Schnorr signature verification of the currently opPoked data.
55+
- If the verification succeeds, the data is finalized.
56+
- If the verification fails, the validator bound to the data is removed, the data is deleted, and the challenger gets an ETH reward.
980 KB
Loading

0 commit comments

Comments
 (0)