Skip to content

Commit

Permalink
docs: Voting ledger design (#709)
Browse files Browse the repository at this point in the history
* add initial ledger schema

* add blake tags specefication

* update block structure

* cleanup

* update

* fix

* fix CI

* fix spelling

* fix

* fix

* wip

* fix

* wip

* add image

* fix

* fix

* wip

* wip

* fix

* fix

* wip

* fix

* fix

* fix

* fix CI

* fix cddl

* fix spelling

* Update docs/src/architecture/08_concepts/immutable_ledger/ledger.md

Co-authored-by: bkioshn <[email protected]>

* Update docs/src/architecture/08_concepts/immutable_ledger/ledger.md

Co-authored-by: bkioshn <[email protected]>

* Update docs/src/architecture/08_concepts/immutable_ledger/ledger.md

Co-authored-by: bkioshn <[email protected]>

* fix

* cleanup

* update from feedback

---------

Co-authored-by: bkioshn <[email protected]>
Co-authored-by: Steven Johnson <[email protected]>
Co-authored-by: Oleksandr Prokhorenko <[email protected]>
  • Loading branch information
4 people authored Sep 19, 2024
1 parent 2d32951 commit fc7943a
Show file tree
Hide file tree
Showing 10 changed files with 1,730 additions and 0 deletions.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
".config/dictionaries/cspell/markdown/cspell-ext.json"
],
"ignorePaths": [
"*.excalidraw",
".config/dictionaries/**",
"tmp/**",
"cspell.json",
Expand Down
3 changes: 3 additions & 0 deletions docs/src/architecture/08_concepts/immutable_ledger/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: Immutable Ledger
arrange:
- ledger.md
31 changes: 31 additions & 0 deletions docs/src/architecture/08_concepts/immutable_ledger/cddl/block.cddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
block = [
block_header,
block_data: ~encoded-cbor, ; deterministically encoded CBOR
validator_signature,
]

block_header = [
chain_id: ULID,
height: int,
timestamp: ~#6.1(uint .ge 1722470400), ; Epoch-based date/time
prev_block_id: hash_bytes, ; hash of the previous block
?ledger_type: UUID,
?purpose_id: ULID / UUID,
?validator,
~metadata,
]

UUID = #6.37(bytes) ; UUID type
ULID = #6.32780(bytes) ; ULID type

hash_bytes = (
#6.32781(bytes) \ ; Blake3 hash
#6.32782(bytes) \ ; Blake2b hash
#6.32783(bytes) ; Blake2s hash
)
kid = hash_bytes ; hash of the x509/c509 certificate

validator = (kid / [2* kid])
metadata = [ *Any ]

validator_signature = (bytes / [2* bytes])
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
genesis_to_prev_hash = [
chain_id: ULID,
timestamp: ~#6.1(uint .ge 1722470400), ; Epoch-based date/time
ledger_type: UUID,
purpose_id: ULID / UUID,
validator,
]

UUID = #6.37(bytes) ; UUID type
ULID = #6.32780(bytes) ; ULID type

validator = (kid / [2* kid])
kid = hash_bytes ; hash of the x509/c509 certificate
hash_bytes = (
#6.32781(bytes) \ ; Blake3 hash
#6.32782(bytes) \ ; Blake2b hash
#6.32783(bytes) ; Blake2s hash
)
Loading

0 comments on commit fc7943a

Please sign in to comment.