3 ms·
Really impressed with Urkel! I've had my eye on it for some time. In an earlier version (https://github.com/handshake-org/urkel https://github.com/handshake-o
by jude- 6y ago
Really impressed with Urkel! I've had my eye on it for some time. In an earlier version (https://github.com/handshake-org/urkel https://github.com/handshake-org/urkel), the documentation talked about compaction being an expensive and user-initiated operation. Does this version address this?
If you're looking for more SMT implementations, we've got a home-grown one at Blockstack. We built a "merklized adaptive-radix forest" (MARF) to represent blockchain state as an authenticated key/value store, where you can query a key's value at any block height (and get a proof). I think the high-level differences between it an an Urkel tree are:
* No delete operation -- we need to be able to service key lookups from any previous committed root hash, since a major use-case for the MARF is in allowing Blockstack smart contracts to cheaply query historic chain state in the same fork.
* Key insertion order affects the root hash (but this is more of an artifact of the implementation than a deliberate design decision).
* Variable-radix nodes, in order to minimize the number of nodes that would need to be loaded on a key lookup. Ours is based on adaptive-radix trees [1].
* Proof size is bigger, and has a different structure. The proof is meant to show a key's value, as well as its place in the blockchain history.
* Implemented in Rust, as an index within a Sqlite database -- we rely in Sqlite to provide crash-consistency.
Anyway, the technical documentation is here [2] and the code is here [3] if you want to take a look!
[1] https://15721.courses.cs.cmu.edu/spring2016/papers/leis-icde2013.pdf https://15721.courses.cs.cmu.edu/spring2016/papers/leis-icde...
[2] https://github.com/blockstack/stacks-blockchain/blob/master/sip/sip-004-materialized-view.md https://github.com/blockstack/stacks-blockchain/blob/master/...
[3] https://github.com/blockstack/stacks-blockchain/tree/master/src/chainstate/stacks/index https://github.com/blockstack/stacks-blockchain/tree/master/...