• Stars
    star
    102
  • Rank 324,975 (Top 7 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 17 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Building generic merkle proof format for IBC

Cosmos ecosystem

ICS 23 Apache 2.0 Licensed

Language Test Suite Code Coverage
Go Go Test Go Cov
Rust Rust Test Rust Cov
TypeScript TypeScript Test TypeScript Cov

Proofs

This is an attempt to define a generic, cross-language, binary representation of merkle proofs, which can be generated by many underlying merkle tree storage implementations and validated by many client libraries over various languages.

The end goal is to provide a standard representation not only for light-client proofs of blockchains, but more specifically for proofs that accompany IBC (inter-blockchain communication) packets as defined in the cosmos specification.

Feature Set

The features and naming follow the ICS23: Vector Commitments Specification

  • Proof of Existence (key-value pair linked to root hash)
  • Hold Existence Proof to db-specific spec (avoid reinterpretation of bytes to different key-value pair)
  • Proof of Non-Existence (key proven not to be inside tree with given root hash)

Planned Features

  • Batch Proof or Range Proof (prove many keys at once, more efficiently than separate proofs)

Organization

The top level package will provide language-agnostic documentation and protobuf specifications. Every language should have a sub-folder, containing both protobuf generated code, as well as client-side code for validating such proofs. The server-side code should live alongside the various merkle tree representations (eg. not in this repository)

Client Languages Supported

Compatibility Table

ICS 023 Spec Go Rust
2019-08-25 0.9.x 0.9.x
2019-08-25 0.10.x 0.10.x, 0.11.x

Planned Support

Supported Merkle Stores

Planned

Unsupported

I spent quite some time to wrestle out a well-defined serialization and a validation logic that didn't involve importing too much code from go-ethereum (copying parts and stripping it down to the minimum). At the end, I realized the key is only present from parsing the entire path and is quite a painstaking process, even with go code that imports rlp and has the custom patricia key encodings. After a long time reflecting, I cannot see any way to implement this that doesn't either: (A) allow the provider to forge a different key that cannot be detected by the verifier or (B) include a huge amount of custom code in the client side.

If anyone has a solution to this, please open an issue in the proofs-ethereum repo.

Known Limitations

This format is designed to support any merklized data store that encodes key-value pairs into a node, and computes a root hash by repeatedly concatenating hashes and re-hashing them.

Notably, this requires the key to be present in the leaf node in order to enforce the structure properly and prove the key provided matches the proof without extensive db-dependent code. Since some tries (such as Ethereum's Patricia Trie) do not store the key in the leaf, but require precise analysis of every step along the path in order to reconstruct the path, these are not supported. Doing so would require a much more complex format and most likely custom code for each such database. The design goal was to be able to add new data sources with only configuration (spec object), rather than custom code.

More Repositories

1

cosmos-sdk

⛓️ A Framework for Building High Value Public Blockchains ✨
Go
5,983
star
2

cosmos

Internet of Blockchains βš›
TeX
1,243
star
3

ibc

Interchain Standards (ICS) for the Cosmos network & interchain ecosystem.
TeX
846
star
4

ethermint-archive

Ethereum on Tendermint using Cosmos-SDK!
Go
661
star
5

cosmjs

The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.
TypeScript
594
star
6

gravity-bridge

A CosmosSDK application for moving assets on and off of EVM based, POW chains
TypeScript
490
star
7

sdk-tutorials

Tutorials for building modules for the Cosmos SDK
Go
479
star
8

chain-registry

Python
477
star
9

ibc-go

Inter-Blockchain Communication Protocol (IBC) implementation in Golang.
Go
474
star
10

awesome-cosmos

Collection of Cosmos related resources
457
star
11

gaia

Cosmos Hub
Go
420
star
12

iavl

Merkleized IAVL+ Tree implementation in Go
Go
409
star
13

ethermint

Ethermint is a scalable and interoperable Ethereum, built on Proof-of-Stake with fast-finality using the Cosmos SDK.
Go
402
star
14

relayer

An IBC relayer for ibc-go
Go
376
star
15

cosmos-rust

The home of all shared Rust resources for the Cosmos ecosystem.
Rust
280
star
16

ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Rust
158
star
17

testnets

Cosmos Testnets
Shell
153
star
18

interchain-security

Replicated security (aka interchain security V1) is an open sourced IBC application which allows cosmos blockchains to lease their proof-of-stake security to one another.
Go
137
star
19

mainnet

It's happening!
Go
125
star
20

gex

In-terminal explorer for Cosmos SDK blockchains.
Go
92
star
21

cosmos-multisig-ui

Create multisigs and multisig transactions on Cosmos chains
TypeScript
76
star
22

ibc-apps

IBC applications and middleware for Cosmos SDK chains.
Go
76
star
23

cosmos-academy

Content for Cosmos Academy
Go
67
star
24

stargate-launch

58
star
25

relayer-archive

An example of a server side IBC relayer to be used for Game of Zones and beyond
Go
56
star
26

scaffold

Scaffolding for Cosmos-SDK based application
Go
55
star
27

gogoproto

Protocol Buffers for Go with Gadgets for Cosmos
Go
52
star
28

game-of-stakes

Python
51
star
29

ledger-cosmos

C
49
star
30

modules

Go
45
star
31

ledger-cosmos-obsolete

Ledger Nano S support for Tendermint/Cosmos
C++
43
star
32

ibc-proto-rs

Rust crate for interacting with Cosmos and IBC structs.
Rust
42
star
33

governance

Resources for Cosmos governance
Shell
40
star
34

snap

Packages That Add Cosmos Support Into Metamask. The Cosmos is Expanding!
TypeScript
37
star
35

cosmos-proto

Go
36
star
36

amino-js

go-amino + GopherJS + TypeScript
Go
32
star
37

b9-checkers-academy-draft

TypeScript
32
star
38

cips

The Cosmos Improvements Proposals
JavaScript
25
star
39

atlas

An open source Cosmos SDK module registry.
Vue
25
star
40

faucet

Token faucet web app for the Cosmos Hub and Gaia testnets.
Vue
24
star
41

research

21
star
42

developer-portal

JavaScript
21
star
43

cosmos-sdk-js

(NOTICE: Very out of date) JavaScript client for the Cosmos SDK API
JavaScript
20
star
44

cosmos-db

Go
18
star
45

gosec

Go
17
star
46

burner-chains

Low-security temporary experimental application-specific blockchains
17
star
47

vuepress-theme-cosmos

This repository is deprecated and is not maintained. Please, use another system for documentation.
Vue
16
star
48

stargate

Stargate Roadmap Website
Vue
16
star
49

qa-integration

Python
15
star
50

ethermint_abci

DEPRECATED - moved to https://github.com/cosmos/ethermint
Go
14
star
51

vega-test

Shell
12
star
52

fundraiser-cli

CLI tool for participating in Cosmos Fundraiser
Go
12
star
53

v1.cosmos.network

DEPRECATED - The website for Cosmos - Internet of Blockchains
HTML
12
star
54

registry

11
star
55

cosmos-registrar

A tool for pulling data from cosmos networks and pushing it to git repos
Go
10
star
56

community

10
star
57

fundraiser-lib

JS module for participating in Cosmos Fundraiser
JavaScript
9
star
58

composer

TypeScript
9
star
59

ledger-cosmos-go

Go
8
star
60

groups-ui

TypeScript
7
star
61

security

Cosmos Security contains guidelines (and tools in the future) for a responsible security incident disclosure
7
star
62

interchain-security-gravity

Python
6
star
63

ibc-docs

5
star
64

chainparse

Go
5
star
65

iavl-bench

Go
5
star
66

faucet-backend

Faucet Backend
Go
5
star
67

advocates

Cosmos Advocates
5
star
68

images

Cosmos Docker Images
Shell
4
star
69

keystone

Go
4
star
70

rosetta

Rosetta implementation for cosmos zones
Go
4
star
71

cosmos-sdk-docs

HTML
4
star
72

academy-checkers-ui

TypeScript
4
star
73

.github

GitHub Actions, Workflows, and templates used across the Cosmos org.
4
star
74

vanity

HTML
4
star
75

fundraiser

Code for the fundraiser subdomain
Vue
3
star
76

did-cosmos

3
star
77

tools

Tools used in our various repos
Go
3
star
78

gravity-dex-site

Gravity DEX: The Cosmos Interchain Exchange
Vue
3
star
79

hackatom2021

HackAtom VI
Vue
3
star
80

cosmos-sdk-ics-fork

2
star
81

jobs

PHP
2
star
82

nightly-stack

2
star
83

gravity-bridge-site

Vue
1
star
84

temp-archive

1
star
85

conversations-site

CSS
1
star
86

hackatom2020

HackAtom V
Vue
1
star
87

wallet-registry

1
star
88

gogogateway

Go
1
star