An implementation of the ChainStore trait backed by a simple key-value store.
怎么存,由 DB 处理;
我们关心的是“存什么数据”。
grin_chain store
业务封装,与具体数据库无关,相当于 ORM
The full state of a Grin chain consists of all the following data:
- The full unspent output (UTXO) set.
- The range proof for each output.
- All the transaction kernels.
- A MMR for each of the above (with the exception that the output MMR includes hashes for _all _outputs, not only the unspent ones).
Rust wrapper for CRoaring
A better compressed bitset
Roaring bitmaps are compressed bitmaps. They can be hundreds of times faster.
带有完全支持编译器( GNU,llvm,Visual Studio )的( 还有 C++ ) 中的便携式Roaring位图。
Bitsets,也称为位图,通常用作快速数据结构。
rust wrapper for rocksdb
具体使用数据库。
RocksDB is an embeddable persistent key-value store for fast storage.
其它:PMMR,是 Prunable Merkle Mountain Range 的缩写形式。
存储以下数据
The grin blockchain includes the following types of data:
- Transaction outputs, which include for each output:
- A Pedersen commitment (33 bytes).
- A range proof (over 5KB at this time).
- Transaction inputs, which are just output references (32 bytes).
- Transaction "proofs", which include for each transaction:
- The excess commitment sum for the transaction (33 bytes).
- A signature generated with the excess (71 bytes average).
- A block header includes Merkle trees and proof of work (about 250 bytes).