diff --git a/docs/src/architecture/08_concepts/immutable_ledger/.pages b/docs/src/architecture/08_concepts/immutable_ledger/.pages new file mode 100644 index 00000000000..088320ec002 --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/.pages @@ -0,0 +1,3 @@ +title: Immutable Ledger +arrange: + - ledger.md \ No newline at end of file diff --git a/docs/src/architecture/08_concepts/immutable_ledger/cddl/block.cddl b/docs/src/architecture/08_concepts/immutable_ledger/cddl/block.cddl new file mode 100644 index 00000000000..5b9b832c8b4 --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/cddl/block.cddl @@ -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]) diff --git a/docs/src/architecture/08_concepts/immutable_ledger/cddl/genesis_to_prev_hash.cddl b/docs/src/architecture/08_concepts/immutable_ledger/cddl/genesis_to_prev_hash.cddl new file mode 100644 index 00000000000..f6b22766eb5 --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/cddl/genesis_to_prev_hash.cddl @@ -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 +) \ No newline at end of file diff --git a/docs/src/architecture/08_concepts/immutable_ledger/images/ledger_schema.excalidraw b/docs/src/architecture/08_concepts/immutable_ledger/images/ledger_schema.excalidraw new file mode 100644 index 00000000000..b0357b95bd5 --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/images/ledger_schema.excalidraw @@ -0,0 +1,897 @@ +{ + "type": "excalidraw", + "version": 2, + "source": "https://excalidraw.com", + "elements": [ + { + "id": "LZaz6nUSvw4D3MKiGf-6N", + "type": "rectangle", + "x": 409, + "y": 612, + "width": 126.00000000000003, + "height": 106, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b1I", + "roundness": { + "type": 3 + }, + "seed": 998749129, + "version": 180, + "versionNonce": 488028033, + "isDeleted": false, + "boundElements": [ + { + "id": "60WFwdimNvf7qHAl1Qx-l", + "type": "arrow" + } + ], + "updated": 1724062455821, + "link": null, + "locked": false + }, + { + "type": "rectangle", + "version": 448, + "versionNonce": 1870983471, + "index": "b1m", + "isDeleted": false, + "id": "2y_gKpt1yYgzb2ulJxSIH", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 418.6477595119575, + "y": 188.42732687658784, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 115255241, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "OjDpkXlr89sdrgoJXWZKl", + "type": "arrow" + }, + { + "id": "yWC7J7W90hNhY3n8YeI0R", + "type": "arrow" + } + ], + "updated": 1724183543948, + "link": null, + "locked": false + }, + { + "id": "yWC7J7W90hNhY3n8YeI0R", + "type": "arrow", + "x": 470.7966443874382, + "y": 312.4273268765878, + "width": 1.7887145032737521, + "height": 82.51369398294639, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b1o", + "roundness": { + "type": 2 + }, + "seed": 1642089769, + "version": 800, + "versionNonce": 912563369, + "isDeleted": false, + "boundElements": null, + "updated": 1723817518325, + "link": null, + "locked": false, + "points": [ + [ + 0, + 0 + ], + [ + -1.7887145032737521, + 82.51369398294639 + ] + ], + "lastCommittedPoint": null, + "startBinding": { + "elementId": "2y_gKpt1yYgzb2ulJxSIH", + "focus": 0.1536117236497505, + "gap": 18.000000000000014, + "fixedPoint": null + }, + "endBinding": { + "elementId": "_Mqz3jLZxw94Y9d_DmU0j", + "focus": -0.05650178014706318, + "gap": 9.60349941250422, + "fixedPoint": null + }, + "startArrowhead": null, + "endArrowhead": "arrow", + "elbowed": false + }, + { + "type": "rectangle", + "version": 289, + "versionNonce": 1513389985, + "index": "b1v", + "isDeleted": false, + "id": "8AxtoYDOM72Qp47EdPXHe", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 627.5, + "y": 609.2004468287341, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 150552359, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "-aKd0G117FN4NQt4vAhp4", + "type": "arrow" + }, + { + "id": "OjcadhzxebNls4hpPSNFu", + "type": "arrow" + }, + { + "id": "EIWoqkyVxQEyenX_x-Vw8", + "type": "arrow" + } + ], + "updated": 1724183567733, + "link": null, + "locked": false + }, + { + "type": "rectangle", + "version": 519, + "versionNonce": 1372912463, + "index": "b1x", + "isDeleted": false, + "id": "0BQ-1JHgWMGHcu8wZpeFv", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 637.1477595119575, + "y": 185.62777370532197, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 181592423, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "-aKd0G117FN4NQt4vAhp4", + "type": "arrow" + } + ], + "updated": 1724183555017, + "link": null, + "locked": false + }, + { + "type": "arrow", + "version": 1207, + "versionNonce": 1062648175, + "index": "b1z", + "isDeleted": false, + "id": "-aKd0G117FN4NQt4vAhp4", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 690.1406383907372, + "y": 308.62777370532194, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 0.9800121696592896, + "height": 86.86891320320751, + "seed": 332985255, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724183555019, + "link": null, + "locked": false, + "startBinding": { + "elementId": "0BQ-1JHgWMGHcu8wZpeFv", + "focus": 0.16976697626318282, + "gap": 17.000000000000014, + "fixedPoint": null + }, + "endBinding": { + "elementId": "JkGOAkU87OVn06Dh_dfoC", + "focus": 0.026898977589213263, + "gap": 6.248280192243101, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + 0.9800121696592896, + 86.86891320320751 + ] + ], + "elbowed": false + }, + { + "type": "rectangle", + "version": 506, + "versionNonce": 1834369199, + "index": "b2k", + "isDeleted": false, + "id": "6XEgzMFi4hOd4lH063yLo", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 179.33426655457095, + "y": 189.49632349854818, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 491506505, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [], + "updated": 1724183542834, + "link": null, + "locked": false + }, + { + "type": "rectangle", + "version": 547, + "versionNonce": 178222087, + "index": "b2o", + "isDeleted": false, + "id": "_Mqz3jLZxw94Y9d_DmU0j", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 408.2753527268211, + "y": 404.5445202720384, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 163039495, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "yWC7J7W90hNhY3n8YeI0R", + "type": "arrow" + }, + { + "id": "60WFwdimNvf7qHAl1Qx-l", + "type": "arrow" + } + ], + "updated": 1723817524427, + "link": null, + "locked": false + }, + { + "type": "rectangle", + "version": 600, + "versionNonce": 29665703, + "index": "b2p", + "isDeleted": false, + "id": "JkGOAkU87OVn06Dh_dfoC", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 626.7753527268211, + "y": 401.74496710077256, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 1040650279, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "-aKd0G117FN4NQt4vAhp4", + "type": "arrow" + }, + { + "id": "OjcadhzxebNls4hpPSNFu", + "type": "arrow" + } + ], + "updated": 1723817533761, + "link": null, + "locked": false + }, + { + "type": "arrow", + "version": 873, + "versionNonce": 1953822465, + "index": "b2r", + "isDeleted": false, + "id": "60WFwdimNvf7qHAl1Qx-l", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 470.4895212990359, + "y": 522.509716928435, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 1.7887145032737521, + "height": 85.22413242346852, + "seed": 339776265, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724062426444, + "link": null, + "locked": false, + "startBinding": { + "elementId": "_Mqz3jLZxw94Y9d_DmU0j", + "focus": -0.00901044815406656, + "gap": 11.965196656396529, + "fixedPoint": null + }, + "endBinding": { + "elementId": "LZaz6nUSvw4D3MKiGf-6N", + "focus": -0.07020664971080574, + "gap": 4.266150648096527, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -1.7887145032737521, + 85.22413242346852 + ] + ], + "elbowed": false + }, + { + "type": "arrow", + "version": 942, + "versionNonce": 671820719, + "index": "b2s", + "isDeleted": false, + "id": "OjcadhzxebNls4hpPSNFu", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 691.5227670213574, + "y": 513.549505359382, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 1.7623687083646473, + "height": 94.65094146935212, + "seed": 916830311, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724062426445, + "link": null, + "locked": false, + "startBinding": { + "elementId": "JkGOAkU87OVn06Dh_dfoC", + "focus": -0.04442061726814883, + "gap": 5.804538258609455, + "fixedPoint": null + }, + "endBinding": { + "elementId": "8AxtoYDOM72Qp47EdPXHe", + "focus": -0.02727222461108075, + "gap": 1, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -1.7623687083646473, + 94.65094146935212 + ] + ], + "elbowed": false + }, + { + "type": "arrow", + "version": 914, + "versionNonce": 472300769, + "index": "b3R", + "isDeleted": false, + "id": "fqZcWUsThJ-rpdspkAuJr", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 238.97131516756298, + "y": 302.7762905138317, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 2.6466637127085164, + "height": 82.51369398294639, + "seed": 386853647, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724062504444, + "link": null, + "locked": false, + "startBinding": null, + "endBinding": { + "elementId": "_MIQzK0BU_NTy7Fp2Zv98", + "focus": -0.05650178014706404, + "gap": 9.60349941250422, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -2.6466637127085164, + 82.51369398294639 + ] + ], + "elbowed": false + }, + { + "type": "rectangle", + "version": 596, + "versionNonce": 321717505, + "index": "b3S", + "isDeleted": false, + "id": "_MIQzK0BU_NTy7Fp2Zv98", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 174.97228126065949, + "y": 394.89348390928234, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 1866248495, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "fqZcWUsThJ-rpdspkAuJr", + "type": "arrow" + } + ], + "updated": 1724062504444, + "link": null, + "locked": false + }, + { + "type": "rectangle", + "version": 361, + "versionNonce": 811994433, + "index": "b3T", + "isDeleted": false, + "id": "S0X6nWW1CJo4M_I62jOld", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 625.6836663780216, + "y": 819.1309366933118, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 130846191, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "EIWoqkyVxQEyenX_x-Vw8", + "type": "arrow" + } + ], + "updated": 1724183571602, + "link": null, + "locked": false + }, + { + "type": "arrow", + "version": 1150, + "versionNonce": 1972682017, + "index": "b3U", + "isDeleted": false, + "id": "EIWoqkyVxQEyenX_x-Vw8", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 688.2286911530929, + "y": 724.9577374702459, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 1.0070187505272088, + "height": 93.1731992230657, + "seed": 33749007, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724183571602, + "link": null, + "locked": false, + "startBinding": { + "elementId": "8AxtoYDOM72Qp47EdPXHe", + "focus": 0.011291554948495208, + "gap": 9.757290641511759, + "fixedPoint": null + }, + "endBinding": { + "elementId": "S0X6nWW1CJo4M_I62jOld", + "focus": -0.0321777046504664, + "gap": 1.0000000000002274, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -1.0070187505272088, + 93.1731992230657 + ] + ], + "elbowed": false + }, + { + "id": "UamvVhpP8556RAnEGTOMx", + "type": "text", + "x": 217.4034240988359, + "y": 106.97128723714539, + "width": 53.90400314331055, + "height": 20, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b3W", + "roundness": null, + "seed": 1070147407, + "version": 64, + "versionNonce": 1386620175, + "isDeleted": false, + "boundElements": null, + "updated": 1724184151611, + "link": null, + "locked": false, + "text": "Chain 1", + "fontSize": 16, + "fontFamily": 5, + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Chain 1", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "eZdaYUlv1ggIn_8Xr-Cg6", + "type": "text", + "x": 447.8714473764261, + "y": 102.6575947844726, + "width": 58.272003173828125, + "height": 20, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b3X", + "roundness": null, + "seed": 75853729, + "version": 62, + "versionNonce": 119664719, + "isDeleted": false, + "boundElements": null, + "updated": 1724184154061, + "link": null, + "locked": false, + "text": "Chain 2", + "fontSize": 16, + "fontFamily": 5, + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Chain 2", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "id": "46e5QYSSn975Q1qBDqtE8", + "type": "text", + "x": 663.9206510497119, + "y": 101.1798525381862, + "width": 56.80000305175781, + "height": 20, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b3Y", + "roundness": null, + "seed": 1237485615, + "version": 58, + "versionNonce": 1498990575, + "isDeleted": false, + "boundElements": null, + "updated": 1724184163278, + "link": null, + "locked": false, + "text": "Chain 3", + "fontSize": 16, + "fontFamily": 5, + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Chain 3", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "type": "text", + "version": 63, + "versionNonce": 847436207, + "index": "b3j", + "isDeleted": false, + "id": "N5hTW0O5gndupZRM4ArBN", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 208.99215794348254, + "y": 132.25537493209856, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 74.1919937133789, + "height": 40, + "seed": 1846551439, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1724184148992, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 5, + "text": "Purpose id\n0xabc612", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Purpose id\n0xabc612", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "type": "text", + "version": 80, + "versionNonce": 966785615, + "index": "b3k", + "isDeleted": false, + "id": "5871CJITKyjY_BqMcB97n", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 444.3760250735433, + "y": 130.8373998289054, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 74.1919937133789, + "height": 40, + "seed": 1922001039, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1724184166295, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 5, + "text": "Purpose id\n0xabc612", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Purpose id\n0xabc612", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "type": "text", + "version": 86, + "versionNonce": 2101475407, + "index": "b3l", + "isDeleted": false, + "id": "nH3zTQCXz75-xQ1B_7Pa-", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 657.072290552514, + "y": 130.8373998289054, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 74.1919937133789, + "height": 40, + "seed": 504785281, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1724184161127, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 5, + "text": "Purpose id\n0xabc612", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Purpose id\n0xabc612", + "autoResize": true, + "lineHeight": 1.25 + } + ], + "appState": { + "gridSize": 20, + "gridStep": 5, + "gridModeEnabled": false, + "viewBackgroundColor": "#ffffff" + }, + "files": {} +} \ No newline at end of file diff --git a/docs/src/architecture/08_concepts/immutable_ledger/images/ledger_schema.svg b/docs/src/architecture/08_concepts/immutable_ledger/images/ledger_schema.svg new file mode 100644 index 00000000000..1853e905b11 --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/images/ledger_schema.svg @@ -0,0 +1,13 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1cXGlX28hcdTAwMTL9nl/BYb5cdTAwMGWa7urqLd9YXHUwMDAzZIBcdTAwMTAgLO/N4Si2sFx1MDAxZIRkbLHOyX9/1Vx1MDAwNqzNcmxiJ5p5cU44tjaXuuveure75b/fLCwsJlx1MDAwZt1g8e3CYnDf8MNOs+ffLf7utt9cdTAwMDa9fieOaFx1MDAxN1xmPvfjm15jcGQ7Sbr9t3/8kZ7hNeKrp7OCMLhcbqKkT8f9hz4vLPw9+Et7Ok137p9n/qOKjlx1MDAwZW7vcE3svO+8u1hSu4NTXHUwMDA3XHUwMDA3vVx1MDAwNNNcdTAwMGJcdTAwMWGJXHUwMDFmtcIg3XVP25HZ4edcdTAwMDf6rDhcZj/fdZpJm7ZxUFx1MDAxZcu+xPCQdtBptVx1MDAxM3dcZlPDjU9f83aBXHK39JNefFx1MDAxOazGYdxzsfzGXHUwMDAz9y+N5LPfuGz14puoOTwm6flRv+v36NbT4y46YXiQPFxmrk7NR021WPiO45eYXHUwMDBi26vOoi9ttaOg38+dXHUwMDEzd/1GJ3lcdTAwMTjcV3pcdTAwMTcuwu5Wc9BcdTAwMTN/pTH1/Ktgy3VFdFx1MDAxM4bDzZ2oXHUwMDE5uFx1MDAwNl78zLdyX1x1MDAxNzWfv+6lXHUwMDFm005cdTAwMTLPW76mwVx1MDAwN4G7srVGo+WQ9lWaS9yw4tbdOFx1MDAxYeRcdTAwMTVcdTAwMWHDwDCR9lenv0b5lFxmLnrhh/0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ZiOiR5aAgWTa/bZOSnRPXHUwMDEwZp5cdTAwMTFaWEuin+rV/CamXoVgXHUwMDBiZEk4+7lcYiabbF+1XHUwMDAy6Vx1MDAxN4KnRXDl3DJwN8YhcXRcdTAwMTlcdTAwMGUnh3C0KVx1MDAxZVx1MDAwZvdXT1x1MDAxZbVcXLrf5yvn+oO/VHNcYpNz95hcdTAwMDa3XHUwMDA2hixcdTAwMDEvXHUwMDE24TojWDIk5lx1MDAwNTOD2bHvXHUwMDAwMOdTPVx1MDAxM/RcdTAwMGLAQ1x1MDAwML95XHUwMDFld170u92DhNp18WViYPG2XHUwMDEz3K2UU+i3i8HLTSVcdTAwMGXg7yBcdTAwMTVcZmZmvr75+j/Hc5tcdTAwMTQifQ== + + + + + Chain 1Chain 2Chain 3Purpose id0xabc612Purpose id0xabc612Purpose id0xabc612 \ No newline at end of file diff --git a/docs/src/architecture/08_concepts/immutable_ledger/images/temporary_chain.excalidraw b/docs/src/architecture/08_concepts/immutable_ledger/images/temporary_chain.excalidraw new file mode 100644 index 00000000000..6ac99526d6b --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/images/temporary_chain.excalidraw @@ -0,0 +1,486 @@ +{ + "type": "excalidraw", + "version": 2, + "source": "https://excalidraw.com", + "elements": [ + { + "type": "rectangle", + "version": 525, + "versionNonce": 706880097, + "index": "b1x", + "isDeleted": false, + "id": "0BQ-1JHgWMGHcu8wZpeFv", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 637.1477595119575, + "y": 185.62777370532197, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 181592423, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "-aKd0G117FN4NQt4vAhp4", + "type": "arrow" + }, + { + "type": "text", + "id": "ztxOaqO2nACMyuCo41TT9" + } + ], + "updated": 1724411765588, + "link": null, + "locked": false + }, + { + "id": "ztxOaqO2nACMyuCo41TT9", + "type": "text", + "x": 659.7557574062446, + "y": 228.62777370532197, + "width": 80.78400421142578, + "height": 20, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b1xV", + "roundness": null, + "seed": 1366198799, + "version": 15, + "versionNonce": 2089624047, + "isDeleted": false, + "boundElements": null, + "updated": 1724411768249, + "link": null, + "locked": false, + "text": "Final block", + "fontSize": 16, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "0BQ-1JHgWMGHcu8wZpeFv", + "originalText": "Final block", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "type": "arrow", + "version": 1361, + "versionNonce": 79857743, + "index": "b1z", + "isDeleted": false, + "id": "-aKd0G117FN4NQt4vAhp4", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 700.1406383907372, + "y": 295.62777370532194, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 2.502788755468373, + "height": 78.86891320320751, + "seed": 332985255, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724411746124, + "link": null, + "locked": false, + "startBinding": { + "elementId": "0BQ-1JHgWMGHcu8wZpeFv", + "focus": 0.028074821332862033, + "gap": 4.000000000000014, + "fixedPoint": null + }, + "endBinding": { + "elementId": "MwGedbcYMTL-31ZrpCyid", + "focus": -0.03506656979648994, + "gap": 1, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + 2.502788755468373, + 78.86891320320751 + ] + ], + "elbowed": false + }, + { + "type": "rectangle", + "version": 374, + "versionNonce": 967448481, + "index": "b3m", + "isDeleted": false, + "id": "vgLRytLdKqTx11SHt2RnV", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 644.2635924814804, + "y": 580.2337821688373, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 1052207649, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "MrQ8EOYMz3pjVo4Eol_iQ", + "type": "arrow" + }, + { + "id": "jhCh3yXlSwnv-qmxRtreW", + "type": "arrow" + } + ], + "updated": 1724411736683, + "link": null, + "locked": false + }, + { + "type": "rectangle", + "version": 694, + "versionNonce": 1540247361, + "index": "b3n", + "isDeleted": false, + "id": "MwGedbcYMTL-31ZrpCyid", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 643.5389452083016, + "y": 372.7783024408757, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 1869053441, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "MrQ8EOYMz3pjVo4Eol_iQ", + "type": "arrow" + }, + { + "id": "-aKd0G117FN4NQt4vAhp4", + "type": "arrow" + } + ], + "updated": 1724411736683, + "link": null, + "locked": false + }, + { + "type": "arrow", + "version": 1239, + "versionNonce": 1498456623, + "index": "b3o", + "isDeleted": false, + "id": "MrQ8EOYMz3pjVo4Eol_iQ", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 708.2863595028377, + "y": 484.58284069948513, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 1.7623687083646473, + "height": 94.65094146935212, + "seed": 1554650593, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724411738220, + "link": null, + "locked": false, + "startBinding": { + "elementId": "MwGedbcYMTL-31ZrpCyid", + "focus": -0.04442061726814763, + "gap": 5.804538258609455, + "fixedPoint": null + }, + "endBinding": { + "elementId": "vgLRytLdKqTx11SHt2RnV", + "focus": -0.027272224611082207, + "gap": 1, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -1.7623687083646473, + 94.65094146935212 + ] + ], + "elbowed": false + }, + { + "type": "rectangle", + "version": 440, + "versionNonce": 547544097, + "index": "b3p", + "isDeleted": false, + "id": "3lEZu9SwS4PMBe7uAkrOJ", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 642.447258859502, + "y": 790.164272033415, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 126.00000000000003, + "height": 106, + "seed": 1502523841, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 3 + }, + "boundElements": [ + { + "id": "jhCh3yXlSwnv-qmxRtreW", + "type": "arrow" + }, + { + "type": "text", + "id": "g1_1V7ammpJ8hJwbxdWZt" + } + ], + "updated": 1724411771407, + "link": null, + "locked": false + }, + { + "id": "g1_1V7ammpJ8hJwbxdWZt", + "type": "text", + "x": 663.6072548922168, + "y": 833.164272033415, + "width": 83.68000793457031, + "height": 20, + "angle": 0, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "groupIds": [], + "frameId": null, + "index": "b3pV", + "roundness": null, + "seed": 1429902415, + "version": 27, + "versionNonce": 1902577071, + "isDeleted": false, + "boundElements": null, + "updated": 1724411778513, + "link": null, + "locked": false, + "text": "First block", + "fontSize": 16, + "fontFamily": 5, + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "3lEZu9SwS4PMBe7uAkrOJ", + "originalText": "First block", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "type": "arrow", + "version": 1415, + "versionNonce": 476258927, + "index": "b3q", + "isDeleted": false, + "id": "jhCh3yXlSwnv-qmxRtreW", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 705.5132368875218, + "y": 695.9910728103491, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 1.3406931967199398, + "height": 93.1731992230657, + "seed": 724881825, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1724411738220, + "link": null, + "locked": false, + "startBinding": { + "elementId": "vgLRytLdKqTx11SHt2RnV", + "focus": 0.013288735774937478, + "gap": 9.757290641511872, + "fixedPoint": null + }, + "endBinding": { + "elementId": "3lEZu9SwS4PMBe7uAkrOJ", + "focus": -0.03217770465046808, + "gap": 1.0000000000002274, + "fixedPoint": null + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -1.3406931967199398, + 93.1731992230657 + ] + ], + "elbowed": false + }, + { + "type": "text", + "version": 111, + "versionNonce": 743176097, + "index": "b3r", + "isDeleted": false, + "id": "NTjua3sL1oQNf6AZFW2RR", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 666.1077893109996, + "y": 86.64251359178576, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 68.16000366210938, + "height": 20, + "seed": 646862113, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1724411784149, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 5, + "text": "Chain 25", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": "Chain 25", + "autoResize": true, + "lineHeight": 1.25 + }, + { + "type": "text", + "version": 129, + "versionNonce": 638475137, + "index": "b3s", + "isDeleted": false, + "id": "ArYNPbKLizqJUIR7jSVNU", + "fillStyle": "solid", + "strokeWidth": 1, + "strokeStyle": "dotted", + "roughness": 1, + "opacity": 100, + "angle": 0, + "x": 661.2594288138016, + "y": 112.30006088250497, + "strokeColor": "#1e1e1e", + "backgroundColor": "transparent", + "width": 74.1919937133789, + "height": 40, + "seed": 858327297, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1724411784149, + "link": null, + "locked": false, + "fontSize": 16, + "fontFamily": 5, + "text": " tree id\n0xabc612", + "textAlign": "left", + "verticalAlign": "top", + "containerId": null, + "originalText": " tree id\n0xabc612", + "autoResize": true, + "lineHeight": 1.25 + } + ], + "appState": { + "gridSize": 20, + "gridStep": 5, + "gridModeEnabled": false, + "viewBackgroundColor": "#ffffff" + }, + "files": {} +} \ No newline at end of file diff --git a/docs/src/architecture/08_concepts/immutable_ledger/images/temporary_chain.svg b/docs/src/architecture/08_concepts/immutable_ledger/images/temporary_chain.svg new file mode 100644 index 00000000000..d660b8017c4 --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/images/temporary_chain.svg @@ -0,0 +1,13 @@ + + + eyJ2ZXJzaW9uIjoiMSIsImVuY29kaW5nIjoiYnN0cmluZyIsImNvbXByZXNzZWQiOnRydWUsImVuY29kZWQiOiJ4nO1aa1fbSFx1MDAxMv2eX+Hj+Vx1MDAxYTT9fuRcdTAwMWJhQ1x1MDAxMlx1MDAwMiQ8XHUwMDA2NszMmSOsxlaQJSHL2DAn/32rZdDDkoxcdTAwMWTMjHd2TU6O6W61StV1b91S8eerTqeb3sWm+6bTNdOeXHUwMDFi+F7iTrqv7fitSUZ+XHUwMDE0wlx1MDAxNMl+XHUwMDFmReOkl61cdTAwMWOkaTx68/PPxVx1MDAxNU4vXHUwMDFhzq4ygVx1MDAxOZowXHUwMDFkwbpf4fdO58/s/9J9XHUwMDEy00vdsFx1MDAxZpjsgmyquFx1MDAxNSd8fvQwXG6z20oklEJIy3yBXHUwMDFmemZqt7zE02Izf/QvMFwiNVx1MDAxZcxcXLnByFx1M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MDAxMVwiV2vl/JdcdTAwMTUubVCxn3mQXHUwMDE029W01Sp1S1VcdTAwMDOVeFx1MDAxNbf3m1x1MDAxOcVStJQsyfK0enj6bezS0T6Ojlx1MDAwZa/E9sXuOTk+3nBaXHUwMDE1QjhAm1LBMSGtdfWdrFx1MDAxMlx1MDAwZchDoF2uMahcdTAwMDEp5lxmW1x1MDAxZq1cblx1MDAwNUrUXHUwMDE2K0JcdTAwMTAwhC7+XHUwMDEznFx1MDAwN1x1MDAxZYVqWMFyvIZcdTAwMTc+lYmVXGJcdTAwMTMqplx1MDAxZvvzkZWFkHXizlx1MDAwMFx1MDAwNE2H8G5lJldAgblKXHUwMDE3XGKkNIrb1FHF4nkpVL/runRQK1xcSesrW1x1MDAwMUWqhJhshOtoebhuJ19cdTAwMGa/XFx+2vfvb/Z++Xgsv52cXHUwMDFk/rLxcLVcdTAwMWXVXGbyXCKmar6FgjFxKIBIIFx1MDAwNeJcdTAwMDKxXHUwMDE3/PtLyVx1MDAxY6wtqUts26jFYeVwZTW4Kq4o1Jolq/7xcFx1MDAwNWhcdTAwMTjT8b3fQjR1L3tcdTAwMDKTv1x1MDAxNriL7r8yhF895OSuXHUwMDFixycp+DVXTd1b30ze1kPop6vsY9+bZFx1MDAwNGBBZTLZ+v3V9/9cdTAwMDBcYqdBXHUwMDFlIn0= + + + + + Final blockFirst blockChain 25 tree id0xabc612 \ No newline at end of file diff --git a/docs/src/architecture/08_concepts/immutable_ledger/ledger.md b/docs/src/architecture/08_concepts/immutable_ledger/ledger.md new file mode 100644 index 00000000000..b2a53966798 --- /dev/null +++ b/docs/src/architecture/08_concepts/immutable_ledger/ledger.md @@ -0,0 +1,169 @@ +# Immutable Ledger Design + +--- + +Title: Immutable Ledger Design + +Status: Proposed + +Authors: + - Alex Pozhylenkov + +Created: 2024-08-19 + +--- + +## Abstract + +This document describes a specification of the immutable ledger for various purposes of project "Catalyst". + +## Motivation + +Project "Catalyst" requires a solution for storing people votes and any other data, +in a transparent, verifiable, scalable and immutable way. + +## Specification + +### Ledger structure + +![Ledger schema](images/ledger_schema.svg){ align=right } + +Ledger will be represented as a collection of distinct, unconnected chains, +processed and run in parallel. +The only common thing for all these chains will be a "tree" identifier, +so these chains will serve and form an overall ledger state. + +Obviously, given approach leads to data duplication, +as each chain, will not know anything about others. +And it also requires that the overall ledger state, +could be deterministically defined at any point of time, +considering potential transaction overlapping or duplication. + +To achieve an immutability of data inside each chain +Each particular chain, will be a common sequence of blocks. +To achieve an immutability of data inside each chain, +cryptographic hashing is applied. +So each block from the chain reference to the hash of previous one. +It is a widely used technic to prevent a modification of some data from previous blocks, +without affecting structure of the current one. + +The described approach allows to easily scale and increase throughput of the network on demand at any time, +just by starting to process new chains. + +
+ + +### Temporary chains + +![Temporary chain schema](images/temporary_chain.svg){ align=right } + +It's a common thing for blockchains to have a starting block (genesis), +but it's unusual to have a final block for a chain. +After which no any block could be produced. + +And that's a main distinguish for this Immutable Ledger design, +it has a final block. + +So any chain will be bounded by some period of time. +Which is well suited where it comes to process some temporary event e.g. voting. + +
+ + +### Block structure + + +??? note "Block CDDL definition: `block.cddl`" + + ```CDDL + {{ include_file('src/architecture/08_concepts/immutable_ledger/cddl/block.cddl', indent=4) }} + ``` + + +Header: + +* `chain_id` - unique identifier of the chain. +* `height` - block's height. + Also is used to identify the block type: *genesis*, *regular*, *final* + (in more details described in [validation section](#block-validation-rules)). +* `timestamp` - block's timestamp. +* `prev_block_id` - previous block hash. +* `ledger_type` - unique identifier of the ledger type. + In general, this is the way to strictly bound and specify `block_data` of the ledger for the specific `ledger_type`. + But such rules will be a part of the specific ledger type definition, + and not specified by this document. +* `purpose_id` - unique identifier of the purpose. + As it was stated before, + each Ledger instance will have a strict time boundaries, + so each of them will run for different purposes. + This is the way to distinguish them. +* `validator` - identifier or identifiers of the entity who was produced and processed a block. +* `metadata` - fully optional field, to add some arbitrary metadata to the block. + +Block: + +* `block_header` - block header described above, +* `block_data` - an array of some CBOR encoded data +* `validator_signature` - a signature or signatures of the validator's. + +### Block validation rules + +* `chain_id` **MUST** be the same as for the previous block (except for genesis). +* `height` **MUST** be incremented by `1` from the previous block height value (except for genesis and final block). + *Genesis* block **MUST** have `0` value. + *Final* block **MUST** hash be incremented by `1` from the previous block height and changed the sign to negative. + E.g. previous block height is `9` and the *Final* block height is `-10`. +* *Final* block is the last one for the specific chain and any other block could not be referenced to the *Final* one. + +* `timestamp` **MUST** be greater or equals than the `timestamp` of the previous block (except for genesis). +* `prev_block_id` **MUST** be a hash of the previous block bytes (except for genesis). + +* `ledger_type` **MUST** be the same as for the previous block if present (except for genesis). + **MANDATORY** field for *Genesis* and *Final* blocks. +* `purpose_id` **MUST** be the same as for the previous block if present (except for genesis). + **MANDATORY** field for *Genesis* and *Final* blocks. +* `validator` **MUST** be the same as for the previous block if present (except for genesis). + **MANDATORY** field for *Genesis* and *Final* blocks. +* `prev_block_id`'s CBOR tag value and `bstr` size **MUST** be the same as for the previous block (except for genesis). + Means that the hash function type and hash size itself must be the same. +* `prev_block_id` and `validator_signature` **MUST** use the same hash function, defined with the + `hash_bytes`. + +* `prev_block_id` for the *Genesis* block **MUST** be a hash of the `genesis_to_prev_hash` bytes. + +* `block_data` **MUST** be a [deterministically][CBOR-deterministically-encoded] encoded CBOR. + + +??? note "Genesis to previous block hash CDDL definition: `genesis_to_prev_hash.cddl`" + + ```CDDL + {{ include_file('src/architecture/08_concepts/immutable_ledger/cddl/genesis_to_prev_hash.cddl',indent=4) }} + ``` + + +#### Signature rules + +`validator_signature` +**MUST** be a signature of the hashed `block_header` bytes and the `block_data` bytes +(with the order the same as defined for `block`). +Signed by the validator's keys defined in the corresponding certificates referenced by the `validator`. +Signature algorithm is defined by the certificate. +The format and size of this field **MUST** be totally the same as `validator` field: + +* if `validator` is only one id => `validator_signature` contains only 1 signature; +* if `validator` is array => `validator_signature` contains an array with the same length; +* order of signatures from the `validator_signature`'s array corresponds to the validators order of `validator`'s array. + +## Rationale + +## Path to Active + +### Acceptance Criteria + + +### Implementation Plan + + + + +[CBOR-deterministically-encoded]: https://datatracker.ietf.org/doc/html/rfc8949#name-deterministically-encoded-c