github.com/badrootd/nibiru-cometbft@v0.37.5-0.20240307173500-2a75559eee9b/abci/example/kvstore/README.md (about) 1 # KVStore 2 3 There are two app's here: the KVStoreApplication and the PersistentKVStoreApplication. 4 5 ## KVStoreApplication 6 7 The KVStoreApplication is a simple merkle key-value store. 8 Transactions of the form `key=value` are stored as key-value pairs in the tree. 9 Transactions without an `=` sign set the value to the key. 10 The app has no replay protection (other than what the mempool provides). 11 12 ## PersistentKVStoreApplication 13 14 The PersistentKVStoreApplication wraps the KVStoreApplication 15 and provides two additional features: 16 17 1) persistence of state across app restarts (using CometBFT's ABCI-Handshake mechanism) 18 2) validator set changes 19 20 The state is persisted in leveldb along with the last block committed, 21 and the Handshake allows any necessary blocks to be replayed. 22 Validator set changes are effected using the following transaction format: 23 24 ```md 25 "val:pubkey1!power1,pubkey2!power2,pubkey3!power3" 26 ``` 27 28 where `pubkeyN` is a base64-encoded 32-byte ed25519 key and `powerN` is a new voting power for the validator with `pubkeyN` (possibly a new one). 29 To remove a validator from the validator set, set power to `0`. 30 There is no sybil protection against new validators joining.