vulcanize / go-codec-dagcosmos

A Go implementation of the DAG interface for Tendermint and Cosmos types
Other
8 stars 2 forks source link

SMT marshaller and unmarshaller #22

Closed i-norden closed 3 years ago

i-norden commented 3 years ago

Cosmos SMT leafs are of the form 0x0 || path || value where path = sha256(key) and value = sha256(key || stateValue) where key and stateValue are the kv pair stored in a separate state storage database (stateValue is either protobuf of amino encoded).

It's not possible to do further decoding of the hash(key, stateValue) values. If instead SMTs stored hash(stateValue) in their leaf nodes this would form a proper content hash link that we could decode.

Towards #3