@corpus-core/colibri-stateless 0.1.4 → 0.1.6

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.
Files changed (3) hide show
  1. package/README.md +70 -0
  2. package/c4_logo.png +0 -0
  3. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+
2
+
3
+ <img src="c4_logo.png" alt="C4 Logo" width="300"/>
4
+
5
+ # C4 (corpus core colibri client)
6
+
7
+ ![ETH2.0_Spec_Version 1.4.0](https://img.shields.io/badge/ETH2.0_Spec_Version-1.4.0-2e86c1.svg)
8
+ [![CI on multiple platforms](https://github.com/corpus-core/c4/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/corpus-core/c4/actions/workflows/cmake-multi-platform.yml)
9
+
10
+ The colibri client is a stateless and trustless ethereum client, which is optimized for the mobile apps or embedded devices, because it does not hols the state, but verifies on demand.
11
+
12
+ ## Installation
13
+
14
+ ```sh
15
+ npm install @corpus-core/colibri-stateless
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```js
21
+ import Colibri from "@corpus-core/colibri-stateless";
22
+
23
+
24
+ async function main() {
25
+ const method = "eth_getTransactionByHash";
26
+ const args = ['0x2af8e0202a3d4887781b4da03e6238f49f3a176835bc8c98525768d43af4aa24'];
27
+
28
+
29
+ // Initialize the client with the default configuration and RPCs
30
+ const client = new Colibri();
31
+
32
+ // Create a proof for the given method and arguments as UInt8Array
33
+ const proof = await client.createProof(method, args);
34
+
35
+ // Verify the proof against requested method and arguments
36
+ const result = await client.verifyProof(method, args, proof);
37
+
38
+ console.log(result);
39
+ }
40
+
41
+ main().then(console.log).catch(console.error);
42
+
43
+ ```
44
+
45
+ ## Building
46
+
47
+ In order to build the Javascript bindings, you need to have [emscripten installed](https://emscripten.org/docs/getting_started/downloads.html).
48
+
49
+ ```sh
50
+ git clone https://github.com/corpus-core/c4.git
51
+ cd c4
52
+ mkdir build
53
+ cd build
54
+ emcmake cmake -DWASM=true -DCURL=false ..
55
+ make
56
+ ```
57
+ The js-module will be in the `build/emscripten` folder.
58
+
59
+ ## Concept
60
+
61
+ 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 Proofer 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.
62
+
63
+ 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.
64
+ This allows independent Verification and security on any devices without the need to process every blockheader (as light clients usually would do).
65
+
66
+ More Details can be found on [github](https://github.com/corpus-core/c4)
67
+
68
+ ## License
69
+
70
+ MIT
package/c4_logo.png ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpus-core/colibri-stateless",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Colibri is a stateless and trustless ethereum client, which is optimized for the mobile apps or embedded devices, because it does not hols the state, but verifies on demand.",
5
5
  "main": "index.js",
6
6
  "scripts": {},