CIP-0165? | Canonical Ledger State (#1083)
* Proposal of canonical ledger state format
This proposal defines the Simple Canonical Ledger State (SCLS),
a stable, versioned, and verifiable file format for representing
the Cardano ledger state. It specifies a segmented binary container
with deterministic CBOR encodings, per-chunk commitments, and
a manifest that enables identical snapshots across implementations,
supports external tools (e.g., Mithril), and future-proofs distribution
and verification of state.
> Co-Authored-By: Nicholas Clarke <[email protected]>
> Co-Authored-By: João Santos Reis <[email protected]>
* Update CIP-015x/README.md: fix Discussion topic
Co-authored-by: Ryan <[email protected]>
* Update CIP-015x/README.md: fix link style
Co-authored-by: Ryan <[email protected]>
* Update CIP-015x/README.md
Co-authored-by: Robert Phair <[email protected]>
* CLS: Improve README formatting and link references
update references format
* CLS: Add CBOR vs JSON section
* CLS: Fix more links
* CLS: Fix more links
* CLS: Fix even more links
* CIP: CLS fix terminology block -> record
* Update CIP-015x/README.md
Co-authored-by: Nicholas Clarke <[email protected]>
* Update CIP-015x/README.md
Co-authored-by: Nicholas Clarke <[email protected]>
* Update definition and typography
* Do not try to be clever with links
* Fix more links
* Fix another broken link
* CIP: CLS — upadte META Record structure
Use cbor data in metadata value.
It will allow other software store structured introspectable metadata
in file.
* Update file structure.
Rewrite file structure definition and format.cddl
* Update CIP-015x/README.md
Co-authored-by: Ryan <[email protected]>
* CIP: Canonical Ledger state add example for utxo namespace
Added generated example of the specification
* Update CIP-015x/README.md
Co-authored-by: Ryan <[email protected]>
* Update CIP-015x/README.md
Co-authored-by: Adam Dean <[email protected]>
* Update CIP-015x/README.md
Co-authored-by: Adam Dean <[email protected]>
* Update CIP-015x/README.md
Co-authored-by: Robert Phair <[email protected]>
* Canonical Ledger State, set CIP number
* Update CIP-0165/format.cddl
Co-authored-by: Alexey Kuleshevich <[email protected]>
* Update CIP-0165/namespaces/README.md
Co-authored-by: Alexey Kuleshevich <[email protected]>
* Move to more explicit terms, slot_no instead of transaction
* CIP-0165: be more explicit about data validation
* Add an explicit declaratio that this CIP does not define how ledger stores state
* Add information about the manifest record
Add offset so it would be possible to reconcstruct manifest by reading the file
from the end.
Add number of entries and chunks per-namespace
Add a comment about the spec
* Clarify tombstone and value deletion (#2)
* Clarify tombstone and value deletion
During an implementation it because obvous that it's easier to keep tombstones
an explicit value in delta blocks. In this MR we remove obsolete tombstone/v0
namespaces and update spec
* Explicitly require keys for entries
* Add clarification about tombstone entries
* CIP-0165: specification of the binary file (#5)
* CIP-0165: specification of the binary file
Provide a binary file specification in Kaitai Struct format
as well as html description of the format and svg diagram
Co-authored-by: João Santos Reis <[email protected]>
* Fix format
* Update keys (#6)
* Explicitly describe the length of the record payload
* Drop len_data field, we already know it because we can calculat that from datastructure size
* Introduce structure for the entries and a fixed size keys
This commit introduces a fixed size keys the size of the key depends on the
namespace that is used.
This approach allows us not to waste time on the encoding of the size
for each key and allows to have nice and fast keys for each namespace
used.
* remove tombstone namespace from the list of the namespaces
* Update CIP to explicitly tell how we deal with trees
* Update CIP-0165/README.md
Co-authored-by: João Santos Reis <[email protected]>
* Update CIP-0165/README.md
Co-authored-by: João Santos Reis <[email protected]>
* Fixes in spec
---------
Co-authored-by: João Santos Reis <[email protected]>
* Add metadata record to spec
* Update doc
* Use sizeof<metadata_footer> instead of hardcoded values
* Update .ksy with key length
* Add namespaces definitions (#10)
* Add namespaces
* Update namespaces definitions
* Updates
* Update CIP-0165/README.md
Co-authored-by: Nicholas Clarke <[email protected]>
* Address review comments
---------
Co-authored-by: Nicholas Clarke <[email protected]>
* Update format ksy
sizeof is not supported by ksy
* Apply suggestions from code review
Co-authored-by: Thomas Vellekoop <[email protected]>
* Apply suggestions from code review
Co-authored-by: Thomas Vellekoop <[email protected]>
* Update CDDL specifications
* Fix typo in README.md: change "deletage" to "delegate"
* Fix typo in format.ksy: change "ISO8061" to "ISO8601"
* Update terminology from "block" to "record" in format.ksy
* Update DELTA block information
* Remove null terminator from magic string in README.md
* Fix typos and improve clarity in README.md
* Update heading from "Directory Record" to "DIR Record" for consistency
* Rename 'namespaces_bytes' to 'name' for clarity in format.ksy
* Clarify design approach for streaming
* Clarify mithril scenario
* Fix typo
* Add note about chunk format and compression
* Update and clarify namespace information in README.md
* Fix headings for consistency in README.md
* Clarify description of 'chunk_format' in README.md to specify it indicates the compression scheme
* Place namespaces section on namespaces earlier in the document
* Update headings for consistency in README.md
* Clarify doc for 'offset' in manifest record
* Clarify data types for `root_hash` and `digest`
* Clarify entry digest computation and verification section
* Fix typo in DataEntry description
* Move slot_no to the manifest (#11)
* Move slot_no to the manifest
* Removed slot_no from the delta record
* Add explicit key size definition for namespace in format.ksy
* Revert human readable names to tags
* Update representation utxo
* Remove pots/v0 namespace as it's can be derived from the other parts of the state
* Change footer entries_count type from u64 to u32
Updated footer entry count type from u64 to u32 for consistency.
* Remove network_id enum from format.ksy
Removed network_id enum definitions from format.ksy.
* Clarify namespace ordering and Merkle tree ambiguities
- CHUNK records are ordered by namespace, bytewise/UTF-8
- Merkle nodes use the `0x00` domain separator
- Merkle trees are unbalanced, with a "promote depth" behaviour on
trailing nodes
- Global Merkle root is computed from the per-namespace Merkle roots
- Empty Merkle tree is H("")
---------
Co-authored-by: Ryan <[email protected]>
Co-authored-by: Robert Phair <[email protected]>
Co-authored-by: Nicholas Clarke <[email protected]>
Co-authored-by: Adam Dean <[email protected]>
Co-authored-by: Alexey Kuleshevich <[email protected]>
Co-authored-by: João Santos Reis <[email protected]>
Co-authored-by: João Santos Reis <[email protected]>
Co-authored-by: Thomas Vellekoop <[email protected]>
Co-authored-by: Christopher Harrison <[email protected]>