You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Scribe.md
+2-10
Original file line number
Diff line number
Diff line change
@@ -26,16 +26,14 @@ The Scribe contract also allows the creation of an _optimistic-flavored_ oracle
26
26
27
27
Scribe implements _Chronicle Protocol_'s [`IChronicle`](https://github.com/chronicleprotocol/chronicle-std/blob/v1/src/IChronicle.sol) interface for reading the oracle's value.
28
28
29
-
To protect authorized functions, Scribe uses `chronicle-std`'s [`Auth`](https://github.com/chronicleprotocol/chronicle-std/blob/v1/src/auth/Auth.sol) module. Functions to read the oracle's value are protected via `chronicle-std`'s [`Toll`](https://github.com/chronicleprotocol/chronicle-std/blob/v1/src/toll/Toll.sol) module.
30
-
29
+
To protect authorized functions, Scribe uses `chronicle-std`'s [`Auth`](https://github.com/chronicleprotocol/chronicle-std/blob/v2/src/auth/Auth.sol) module. Functions to read the oracle's value are protected via `chronicle-std`'s [`Toll`](https://github.com/chronicleprotocol/chronicle-std/blob/v2/src/toll/Toll.sol) module.
31
30
32
31
## Schnorr Signature Scheme
33
32
34
33
Scribe uses a custom Schnorr signature scheme. The scheme is specified in [docs/Schnorr.md](./Schnorr.md).
35
34
36
35
The verification logic is implemented in [`LibSchnorr.sol`](../src/libs/LibSchnorr.sol). A Solidity library to (multi-) sign data is provided via [`script/libs/LibSchnorrExtended.sol`](../script/libs/LibSchnorrExtended.sol).
37
36
38
-
39
37
## Elliptic Curve Computations
40
38
41
39
Scribe needs to perform elliptic curve computations on the secp256k1 curve to verify aggregated/multi signatures.
@@ -48,7 +46,6 @@ This optimization allows Scribe to aggregate public keys, i.e. compute the sum o
48
46
49
47
For more info, see [`LibSecp256k1::addAffinePoint()`](../src/libs/LibSecp256k1.sol).
50
48
51
-
52
49
## Encoding Participating Public Keys
53
50
54
51
The `poke()` function has to receive the set of feeds, i.e. public keys, that participated in the Schnorr multi-signature.
@@ -57,16 +54,14 @@ To reduce the calldata load, Scribe does not use type `address`, which uses 20 b
57
54
58
55
For more info, see [`LibSchnorrData.sol`](../src/libs/LibSchnorrData.sol).
59
56
60
-
61
57
## Lifting Feeds
62
58
63
-
Feeds _must_ prove the integrity of their public key by proving the ownership of the corresponding private key. The `lift()` function therefore expects an ECDSA signed message derived from `IScribe::wat()`.
59
+
Feeds _must_ prove the integrity of their public key by proving the ownership of the corresponding private key. The `lift()` function therefore expects an ECDSA signed message, for more info see [`IScribe.feedRegistrationMessage()`](../src/IScribe.sol).
64
60
65
61
If public key's would not be verified, the Schnorr signature verification would be vulnerable to rogue-key attacks. For more info, see [`docs/Schnorr.md`](./Schnorr.md#key-aggregation-for-multisignatures).
66
62
67
63
Also, the number of state-changing `lift()` executions is limited to `type(uint8).max-1`, i.e. 254. After reaching this limit, no further `lift()` calls can be executed. For more info, see [`IScribe.maxFeeds()`](../src/IScribe.sol).
68
64
69
-
70
65
## Chainlink Compatibility
71
66
72
67
Scribe aims to be partially Chainlink compatible by implementing the most widely, and not deprecated, used functions of the `IChainlinkAggregatorV3` interface.
@@ -75,7 +70,6 @@ The following `IChainlinkAggregatorV3` functions are provided:
75
70
-`latestRoundData()`
76
71
-`decimals()`
77
72
78
-
79
73
## Optimistic-Flavored Scribe
80
74
81
75
_ScribeOptimistic_ is a contract inheriting from Scribe and providing an _optimistic-flavored_ Scribe version. This version is intended to only be used on Layer 1s with expensive computation.
@@ -88,7 +82,6 @@ If an `opPoke()` is not challenged, its value finalizes after a specified period
88
82
89
83
Monitoring optimistic pokes and, if necessary, challenging them can be incentivized via ETH rewards. For more info, see [`IScribeOptimistic::maxChallengeReward()`](../src/IScribeOptimistic.sol).
90
84
91
-
92
85
### About Bounded Gas Usage
93
86
94
87
For all functions being executed during `opChallenge()`, it is of utmost importance to have bounded gas usage. These functions are marked with `@custom:invariant` specifications documenting their gas usage.
@@ -99,7 +92,6 @@ Two loops are executed during an `opChallenge()`:
99
92
1. Inside `Scribe::_verifySchnorrSignature` - bounded by `bar`
100
93
2. Inside `LibSecp256k1::_invMod` - computing the modular inverse of a Jacobian `z` coordinate of a secp256k1 point
0 commit comments