@corpus-core/colibri-stateless 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -10
- package/c4w.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +19 -10
- package/package.json +1 -1
- package/transactionVerifier.d.ts +2 -2
- package/transactionVerifier.js +2 -2
- package/types.d.ts +2 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ import Colibri from "@corpus-core/colibri-stateless";
|
|
|
28
28
|
async function main() {
|
|
29
29
|
|
|
30
30
|
// Initialize the client with the default configuration and RPCs
|
|
31
|
-
const client = new Colibri({
|
|
31
|
+
const client = new Colibri({prover:['https://mainnet.colibri-proof.tech']});
|
|
32
32
|
|
|
33
33
|
// Use Colibri client as the EIP-1193 provider for ethers (v6)
|
|
34
34
|
const provider = new BrowserProvider(client);
|
|
@@ -48,7 +48,7 @@ import Colibri from "@corpus-core/colibri-stateless";
|
|
|
48
48
|
async function main() {
|
|
49
49
|
|
|
50
50
|
// Initialize the client with the default configuration and RPCs
|
|
51
|
-
const client = new Colibri({
|
|
51
|
+
const client = new Colibri({prover:['https://mainnet.colibri-proof.tech']});
|
|
52
52
|
|
|
53
53
|
// Use Colibri client as the EIP-1193 provider for ethers (v6)
|
|
54
54
|
const provider = new ethers.providers.Web3Provider(client);
|
|
@@ -70,7 +70,7 @@ import Colibri from "@corpus-core/colibri-stateless";
|
|
|
70
70
|
async function main() {
|
|
71
71
|
|
|
72
72
|
// Initialize the client with the default configuration and RPCs
|
|
73
|
-
const client = new Colibri({
|
|
73
|
+
const client = new Colibri({prover:['https://mainnet.colibri-proof.tech']});
|
|
74
74
|
|
|
75
75
|
// Use Colibri client as the EIP-1193 provider for web3.js
|
|
76
76
|
const web3 = new Web3(client);
|
|
@@ -93,7 +93,7 @@ import Colibri from "@corpus-core/colibri-stateless";
|
|
|
93
93
|
async function main() {
|
|
94
94
|
|
|
95
95
|
// Initialize the Colibri client
|
|
96
|
-
const colibriClient = new Colibri({
|
|
96
|
+
const colibriClient = new Colibri({prover:['https://mainnet.colibri-proof.tech']});
|
|
97
97
|
|
|
98
98
|
// Create a viem Public Client using Colibri as a custom EIP-1193 transport
|
|
99
99
|
const viemClient = createPublicClient({
|
|
@@ -173,22 +173,31 @@ The constructor of the colibri client accepts a configuration-object, which may
|
|
|
173
173
|
new Colibri({ chainId: 0x7})
|
|
174
174
|
```
|
|
175
175
|
- `beacon_apis` - urls for the beacon apis
|
|
176
|
-
An array of endpoints for accessing the beacon chain using the official [Eth Beacon Node API](https://ethereum.github.io/beacon-APIs/). The Array may contain more than one url, and if one API is not responding the next URL will work as fallback. This beacon API is currently used eitehr when building proofs directly or even if you are using a remote
|
|
176
|
+
An array of endpoints for accessing the beacon chain using the official [Eth Beacon Node API](https://ethereum.github.io/beacon-APIs/). The Array may contain more than one url, and if one API is not responding the next URL will work as fallback. This beacon API is currently used eitehr when building proofs directly or even if you are using a remote prover, the LightClientUpdates (every 27h) will be fetched directly from the beacon API.
|
|
177
177
|
```js
|
|
178
178
|
new Colibri({ beacon_apis: [ 'https://lodestar-mainnet.chainsafe.io' ]})
|
|
179
179
|
```
|
|
180
|
+
- `checkpointz` - urls for checkpoint servers (Checkpointz or Beacon API)
|
|
181
|
+
An array of server endpoints for fetching finalized checkpoint data and weak subjectivity validation. Supports both dedicated Checkpointz servers and standard Beacon API nodes, as the verifier uses the Beacon-API-compatible endpoint `/eth/v1/beacon/states/head/finality_checkpoints`. These servers provide finalized beacon block roots used for secure initialization and periodic validation. Multiple URLs enable automatic fallback. Defaults to public Checkpointz servers for mainnet, but you can also use your own Beacon node for maximum trust.
|
|
182
|
+
```js
|
|
183
|
+
// Using public Checkpointz servers (default)
|
|
184
|
+
new Colibri({ checkpointz: [ 'https://sync-mainnet.beaconcha.in', 'https://beaconstate.info' ]})
|
|
185
|
+
|
|
186
|
+
// Or using your own Beacon node
|
|
187
|
+
new Colibri({ checkpointz: [ 'http://localhost:5052' ]})
|
|
188
|
+
```
|
|
180
189
|
- `rpcs` - RPCs for the executionlayer
|
|
181
|
-
a array of rpc-endpoints for accessing the execution layer. If you are using the remote
|
|
190
|
+
a array of rpc-endpoints for accessing the execution layer. If you are using the remote prover, you may not need it at all. But creating your proofs locally will require to access data from the execution layer. Having more than one rpc-url allows to use fallbacks in case one is not available.
|
|
182
191
|
```js
|
|
183
192
|
new Colibri({ beacon_apis: [
|
|
184
193
|
"https://nameless-sly-reel.quiknode.pro/<APIKEY>/",
|
|
185
194
|
"https://eth-mainnet.g.alchemy.com/v2/<APIKEY>",
|
|
186
195
|
"https://rpc.ankr.com/eth/<APIKEY>" ]})
|
|
187
196
|
```
|
|
188
|
-
- `
|
|
189
|
-
a array of endpoints for remote
|
|
197
|
+
- `prover` - urls for remove prover
|
|
198
|
+
a array of endpoints for remote prover. This allows to generate the proof in the backend, where caches can speed up the process.
|
|
190
199
|
```js
|
|
191
|
-
new Colibri({
|
|
200
|
+
new Colibri({ prover: ["https://mainnet.colibri-proof.tech" ]})
|
|
192
201
|
```
|
|
193
202
|
- `trusted_block_hashes` - beacon block hashes used as trusted anchor
|
|
194
203
|
Thise array of blockhashes will be used as anchor for fetching the keys for the sync committee. So instead of starting with the genesis you can define a starting block, where you know the blockhash. If not trusted blockhash is set the beacon-api will be used to fetch one, but defining it is safer.
|
|
@@ -315,7 +324,7 @@ After a successful build (using either method), the JS/WASM module will be in th
|
|
|
315
324
|
|
|
316
325
|
## Concept
|
|
317
326
|
|
|
318
|
-
The idea behind C4 is to create a ultra light client or better verifier which can be used in Websites, Mobile applications, but especially in embedded systems. The
|
|
327
|
+
The idea behind C4 is to create a ultra light client or better verifier which can be used in Websites, Mobile applications, but especially in embedded systems. The Prover is a library which can used within you mobile app or in the backend to create Proof that the given data is valid. The Verifier is a library which can be used within the embedded system to verify this Proof.
|
|
319
328
|
|
|
320
329
|
The verifier itself is almost stateless and only needs to store the state of the sync committee, which changes every 27h. But with the latest sync committee the verifier is able to verify any proof with the signatures matching the previously verified public keys of the sync committee.
|
|
321
330
|
This allows independent Verification and security on any devices without the need to process every blockheader (as light clients usually would do).
|