Skip to content

feat(docs): signed doc spec 0.04 #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f47890b
fix(docs): correct python type annotations in documentation generator…
stevenj May 15, 2025
3ffc8e5
docs(docs): Better define the document encoding restrictions. (#326)
stevenj May 16, 2025
2971d72
Merge branch 'main' into feat/signed-doc-spec-0.04
stevenj May 20, 2025
e4d0819
feat(docs): Add examples for predefined document schemas (#342)
stevenj May 21, 2025
20d5ac6
Merge branch 'main' into feat/signed-doc-spec-0.04
stevenj Jun 21, 2025
384b49e
format the blueprint.cue
stevenj Jun 6, 2025
3994059
fix(docs): Update module to latest cue version
stevenj Jun 6, 2025
15ee554
feat(docs): WIP formalized definitions of field definitions for json …
stevenj Jun 6, 2025
3ae720a
feat(docs): WIP
stevenj Jun 8, 2025
b181fa6
fix(docs): simplify schema with cue format
stevenj Jun 8, 2025
9d66693
feat(docs): WIP template defs dictionary
stevenj Jun 9, 2025
812ebdb
fix(docs): update python files we don't want in git
stevenj Jun 14, 2025
d7fea02
refactor(docs): reorganize the cue files for better modularity
stevenj Jun 14, 2025
e279691
refactor(docs): Move spec python model for better modularity
stevenj Jun 14, 2025
c1aeb7a
docs(docs): Add base of new spec python workspace and modules
stevenj Jun 14, 2025
9c99d71
fix(docs): remove lin to root ruff.toml which was impacting import so…
stevenj Jun 14, 2025
3390368
refactor(docs): Reorganize the doc generator into the new module stru…
stevenj Jun 14, 2025
9f2d3e7
refactor(docs): Cleanup document specification data structure and met…
stevenj Jun 16, 2025
fe5576a
refactor(docs): Remove last remnants of direct dict accesses.
stevenj Jun 16, 2025
f9b35db
refactor(docs): remove code obsoleted by refactor
stevenj Jun 16, 2025
b61fb38
refactor(docs): large cue refactor to stuff that should be common
stevenj Jun 19, 2025
1f5dc28
docs(docs): Add chain metadata to support chained document references.
stevenj Jun 21, 2025
79bc324
fix(docs): lint issues
stevenj Jun 21, 2025
6bfabdc
fix(docs): lint issues
stevenj Jun 21, 2025
b9e9fae
fix(docs): CI build issues
stevenj Jun 21, 2025
27a258e
docs(docs): wip
stevenj Jun 22, 2025
a9dd911
docs(docs): Add fully generalized, templated parameters documents to …
stevenj Jun 23, 2025
2cd237e
fix(docs): form templates do not have templates
stevenj Jun 23, 2025
ddf75b4
fix(docs): remove the parameters from templates on the parameters doc…
stevenj Jun 23, 2025
b474b05
fix(docs): use common parameters definition
stevenj Jun 23, 2025
1add926
feat(docs): Add Representative Profiles and Nomination Forms
stevenj Jun 24, 2025
64c9e4e
feat(docs): Add Rep Profiles, Nominations and Delegations documents
stevenj Jun 24, 2025
48237bc
Update contest_delegation.cue
stevenj Jun 25, 2025
fdf88f9
fix excess lines in null payload description
stevenj Jun 25, 2025
626a106
fix(docs): contest delegation spacing
nathanbogale Jun 25, 2025
149360a
fix(docs): contest structure fix
nathanbogale Jun 25, 2025
02b27ff
fix(docs): structure quick fix
nathanbogale Jun 25, 2025
61753ff
fix(docs): fixed indentation in contest md
nathanbogale Jun 25, 2025
55791f6
fix(docs): contest cue file fix
nathanbogale Jun 25, 2025
b0140db
fix(docs): quick fix on indentation
nathanbogale Jun 25, 2025
d4eb2d8
fix(docs): markdown indentation fix
nathanbogale Jun 25, 2025
aed490a
fix(docs): minor character and structure fix
nathanbogale Jun 25, 2025
187dc6e
fix(docs): contest cue file fix
nathanbogale Jun 25, 2025
2ea491f
fix(docs): additional indentation fix
nathanbogale Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ ABNF
addrr
addrs
adminer
admon
anypolicy
apskhem
Arissara
asyncio
Attributes
auditability
Auliffe
auxdata
babystep
backpressure
Expand All @@ -21,6 +23,7 @@ blockdiag
blockfetch
blosc
bmac
Bogale
bootstrapper
BROTLI
Cabe
Expand Down Expand Up @@ -80,6 +83,7 @@ elgamal
encryptor
Errno
Eternl
evalv
excalidraw
explicitely
extn
Expand Down Expand Up @@ -160,6 +164,8 @@ ltail
maindbname
mapref
markdownlint
mdformat
mdit
mdlint
mdns
MEMMAP
Expand All @@ -175,6 +181,7 @@ mitigations
mkcron
mkdelay
mkdirat
mkdocs
Mmap
moderations
moka
Expand Down Expand Up @@ -230,6 +237,7 @@ pypackages
pytest
pytype
qpsg
qrcode
quic
rankdir
rapidoc
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
new

## Secrets
**/.secret

Expand Down Expand Up @@ -87,4 +89,10 @@ $RECYCLE.BIN/

# Python stuff
.pytest_cache
__pycache__
__pycache__
py.typed
*.egg-info
.venv
.ruff_cache
dist
*.pyi
3 changes: 2 additions & 1 deletion .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
".config/dictionaries/**",
"**/target/**",
"**/.dart_tool/**",
"**/.pytest_cache/**"
"**/.pytest_cache/**",
"**/.venv"
],
// Set standard config options in `/.markdownlint.jsonc`
"config": {
Expand Down
12 changes: 10 additions & 2 deletions .vscode/settings.recommended.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
// Recommended `settings.json` configuration
"$comment": "Recommended `settings.json` configuration",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true,
Expand Down Expand Up @@ -37,12 +37,20 @@
"rust",
"rust/c509-certificate",
"rust/cardano-chain-follower",
"rust/catalyst-types",
"rust/catalyst-voting",
"rust/immutable-ledger",
"rust/vote-tx-v1",
"rust/vote-tx-v2",
"rust/signed-doc",
"rust/cbork",
"rust/hermes-ipfs",
"rust/rbac-registration",
"rust/cardano-blockchain-types",
"dart",
"docs",
"general"
"general",
"deps"
],
"conventionalCommits.gitmoji": false,
"markdown.extension.toc.unorderedList.marker": "*",
Expand Down
4 changes: 2 additions & 2 deletions blueprint.cue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ global: {
]
providers: {
aws: {
region: "eu-central-1"
region: "eu-central-1"
ecr: registry: "332405224602.dkr.ecr.eu-central-1.amazonaws.com"
role: "arn:aws:iam::332405224602:role/ci"
role: "arn:aws:iam::332405224602:role/ci"
}

docker: credentials: {
Expand Down
1 change: 1 addition & 0 deletions docs/src/architecture/08_concepts/signed_doc/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ nav:
- Specification: spec.md
- Metadata Fields: metadata.md
- Document Types: types.md
- Document Templates: templates.md
- docs
50 changes: 50 additions & 0 deletions docs/src/architecture/08_concepts/signed_doc/cddl/chain.cddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
; chain


; Reference to the previous Signed Document in a sequence.
; * `height` is of the CURRENT block.
; * `document_ref` is *ONLY* omitted in the very first document in a sequence.
chain = [height, ? document_ref]

; The consecutive sequence number of the current document
; in the chain.
; The very first document in a sequence is numbered `0` and it
; *MUST ONLY* increment by one for each successive document in
; the sequence.
;
; The FINAL sequence number is encoded with the current height
; sequence value, negated.
;
; For example the following values for height define a chain
; that has 5 documents in the sequence 0-4, the final height
; is negated to indicate the end of the chain:
; `0, 1, 2, 3, -4`
;
; No subsequent document can be chained to a sequence that has
; a final chain height.
height = int

; Reference to a single Signed Document
document_ref = [
document_id,
document_ver,
document_locator
]

; Document ID
document_id = uuid_v7

; UUIDv7
uuid_v7 = #6.37(bytes .size 16)

; Document Version
document_ver = uuid_v7

; Where a document can be located, must be a unique identifier.
document_locator = {
"cid" => cid
}

; IPLD content identifier
; TODO: add size limits if possible
cid = #6.42(bytes)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
; document_ref


; Reference to another Signed Document
document_ref = [ 1* [
; Reference to a single Signed Document
document_ref = [
document_id,
document_ver,
document_locator
] ]
]

; Document ID
document_id = uuid_v7
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
; document_refs


; Reference to one or more Signed Documents
document_refs = [ 1* document_ref ]

; Reference to a single Signed Document
document_ref = [
document_id,
document_ver,
document_locator
]

; Document ID
document_id = uuid_v7

; UUIDv7
uuid_v7 = #6.37(bytes .size 16)

; Document Version
document_ver = uuid_v7

; Where a document can be located, must be a unique identifier.
document_locator = {
"cid" => cid
}

; IPLD content identifier
; TODO: add size limits if possible
cid = #6.42(bytes)
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,23 @@ COSE_Document_Standard_Headers = (
)

; Supported Content Media Types.
; If uint is used, only CoAP Content Formats that match the string format are allowed.
; If the Media Type is supported by COAP, then the `uint` CoAP encoded
; version of the media type must be used, in preference to the string.
media_type = (
(uint .eq (50 / 60)) /
(uint .eq (0 / 50 / 60 / 20000)) /
(tstr .eq (
"application/cbor" /
"application/cddl" /
"application/json" /
"application/schema+json" /
"application/cbor" /
"application/cddl"
"text/css; charset=utf-8" /
"text/css; charset=utf-8; template=handlebars" /
"text/html; charset=utf-8" /
"text/html; charset=utf-8; template=handlebars" /
"text/markdown; charset=utf-8" /
"text/markdown; charset=utf-8; template=handlebars" /
"text/plain; charset=utf-8" /
"text/plain; charset=utf-8; template=handlebars"
))
)

Expand All @@ -56,13 +65,14 @@ Signed_Document_Metadata_Headers = (
"type" => document_type
"id" => document_id
"ver" => document_ver
?"ref" => document_ref
?"template" => document_ref
?"reply" => document_ref
?"ref" => document_refs
?"template" => document_refs
?"reply" => document_refs
?"section" => section_ref
?"collaborators" => collaborators
?"revocations" => revocations
?"parameters" => document_ref
?"parameters" => document_refs
?"chain" => chain
)

; Document Type
Expand All @@ -80,12 +90,15 @@ uuid_v7 = #6.37(bytes .size 16)
; Document Version
document_ver = uuid_v7

; Reference to another Signed Document
document_ref = [ 1* [
; Reference to one or more Signed Documents
document_refs = [ 1* document_ref ]

; Reference to a single Signed Document
document_ref = [
document_id,
document_ver,
document_locator
] ]
]

; Where a document can be located, must be a unique identifier.
document_locator = {
Expand All @@ -111,6 +124,29 @@ catalyst_id_kid = bytes
; List of revoked versions of this document.
revocations = [ * document_ver ] / true

; Reference to the previous Signed Document in a sequence.
; * `height` is of the CURRENT block.
; * `document_ref` is *ONLY* omitted in the very first document in a sequence.
chain = [height, ? document_ref]

; The consecutive sequence number of the current document
; in the chain.
; The very first document in a sequence is numbered `0` and it
; *MUST ONLY* increment by one for each successive document in
; the sequence.
;
; The FINAL sequence number is encoded with the current height
; sequence value, negated.
;
; For example the following values for height define a chain
; that has 5 documents in the sequence 0-4, the final height
; is negated to indicate the end of the chain:
; `0, 1, 2, 3, -4`
;
; No subsequent document can be chained to a sequence that has
; a final chain height.
height = int

; Generic Header definition
COSE_Generic_Headers = ( * COSE_label => COSE_values )

Expand Down
Loading