Skip to content

Commit 09fbab8

Browse files
Add uScribe
1 parent 76b4cf6 commit 09fbab8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

docs/Intro/Scribe/uScribe.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
sidebar_position: 3
3+
description: uScribe - Universal Scribe
4+
keywords: [uScribe]
5+
---
6+
# Universal Scribe
7+
8+
## Background
9+
uScribe is a universal Oracle that is able to deliver any arbitrary data, building on Chronicle's cost-efficient [Scribe Oracle](/Intro/Scribe/scribe.md).
10+
11+
Unlike the original Scribe, which focuses on standard price feed updates, uScribe can support **any arbitrary data payload** onchain.
12+
13+
The uScribe oracle allows for unique customization via its [consumer](#consumers) architecture, giving data providers a chance to define onchain enforced rules over their data - all while enjoying the high security of the underlying _Chronicle Protocol_.
14+
15+
This is achieved via separating the data integrity verification from the data update and access logic, giving data providers the ability to enforce unique rulesets about their data directly onchain. By separating the highly complex cryptographic verification from the application logic, uScribe enables building oracles with full flexibility.
16+
17+
18+
## Key advantages:
19+
- **Supports arbitrary data types:** Supports any `bytes` payload of unrestricted size.
20+
- **Flexible consumer pattern:** Application-specific logic is implemented in downstream “consumer” contracts.
21+
- **High security:** Leverages the [Chronicle Protocol reputable validator set](https://chroniclelabs.org/validators) for verifying the data.
22+
- **Separation of concerns:** Cryptographic verification is handled in uScribe, leaving [consumer](#consumers) to define their own rules for data use.
23+
- **Customizable data access:** Consumers can implement arbitrary read functions (e.g.: provide access to historical data, grant access based on specific conditions an address must fulfill, or even restrict access during times of uncertainty).
24+
25+
## Consumers
26+
A **consumer** is a downstream contract that:
27+
- Inherits from [`UScribe.sol`](https://github.com/chronicleprotocol/uscribe/blob/main/src/UScribe.sol).
28+
- Implement application specific logic.
29+
- Implements the internal [_poke(bytes calldata payload)](https://github.com/chronicleprotocol/uscribe/blob/main/src/UScribe.sol#L81-L116) function.
30+
- Defines the actual data being poked
31+
32+
In `poke()`:
33+
- **You** define the state update logic for when new data arrives.
34+
- Data integrity has already been verified by Chronicle.
35+
- You **only** need to handle application-specific requirements (e.g., parsing payloads, storing values).
36+
37+
The internal [`_poke(bytes calldata payload)`](https://github.com/chronicleprotocol/uscribe/blob/main/src/UScribe.sol#L81-L116) function must be overwritten to define the data deserialization and state update executed when new data is being published.
38+
39+
Example of data types that can be defined to be `poked()` by the consumer:
40+
- `uint256 price`
41+
- `uint256[] prices`
42+
- `struct MyData {
43+
uint timestamp;
44+
uint price;
45+
int rate;
46+
}`
47+
48+
## Security
49+
50+
The data integrity verification is based on the battle-tested [Scribe](https://github.com/chronicleprotocol/scribe/) codebase which runs without security issues in production since 2023 and uses the most efficient [Schnorr multi-signature verification](https://github.com/chronicleprotocol/scribe/blob/main/docs/Schnorr.md) live on Ethereum up to this date.
51+
52+
53+
## GitHub Repository
54+
You can access the associated Github repository [here](https://github.com/chronicleprotocol/uscribe).

0 commit comments

Comments
 (0)