Skip to content

Commit 2b77fa8

Browse files
authored
CIP-0137 | Fix protocol specifications (#1094)
* Update implementation plan * Update CDDL for DMQ message * Fix typo * Update CDDLs for n2c local message notification * Fix CDDLs for n2c local message notification
1 parent 1bf33db commit 2b77fa8

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

CIP-0137/README.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ messageList = [ * message ]
151151
messageSizeInBytes = word32
152152
kesSignature = bstr
153153
kesPeriod = word32
154-
operationalCertificate = [ bstr, word64, word64, bstr ]
154+
operationalCertificate = [ bstr .size 32, word64, word64, bstr .size 64 ]
155155
coldVerificationKey = bstr .size 32
156156
expiresAt = word32
157157
@@ -162,9 +162,9 @@ messagePayload = [
162162
, expiresAt
163163
]
164164
message = [
165-
bstr .cbor messagePayload
165+
messagePayload
166166
, kesSignature
167-
, bstr .cbor operationalCertificate
167+
, operationalCertificate
168168
, coldVerificationKey
169169
]
170170
```
@@ -245,7 +245,7 @@ For a total of **3,100** Cardano SPOs on the `mainnet`, on an average **50%** of
245245

246246
##### Message authentication mechanism
247247

248-
The payload part of the message (message id, message body, KES period and expiration timestamp fields encoded as CBOR) is signed with the KES key of the SPO. The message is composed of the aforementioned payload (encoded as CBOR bytes), the KES signature (raw bytes), the operational certificate (the KES public key, the issue number of the operational certificate, the KES period at the time of creation of the operational certificate and their cold signing key signature, encoded as CBOR bytes) and the cold verification key (raw bytes) are appended to the message.
248+
The payload part of the message (message id, message body, KES period and expiration timestamp fields) is signed with the KES key of the SPO (the message signed is the CBOR encoding of the payload: `bstr .cbor messagePayload`). The message is composed of the aforementioned payload (encoded as an array), the KES signature (raw bytes), the operational certificate (the KES public key, the issue number of the operational certificate, the KES period at the time of creation of the operational certificate and their cold signing key signature, encoded as an array) and the cold verification key (raw bytes) are appended to the message.
249249

250250
Before being diffused to other peers, an incoming message must be verified by the receiving node. This is done with the following steps:
251251

@@ -479,7 +479,7 @@ messageId = bstr
479479
messageBody = bstr
480480
kesSignature = bstr
481481
kesPeriod = word64
482-
operationalCertificate = [ bstr, word64, word64, bstr ]
482+
operationalCertificate = [ bstr .size 32, word64, word64, bstr .size 64 ]
483483
coldVerificationKey = bstr .size 32
484484
expiresAt = word32
485485
@@ -490,9 +490,9 @@ messagePayload = [
490490
, expiresAt
491491
]
492492
message = [
493-
bstr .cbor messagePayload
493+
messagePayload
494494
, kesSignature
495-
, bstr .cbor operationalCertificate
495+
, operationalCertificate
496496
, coldVerificationKey
497497
]
498498
```
@@ -511,10 +511,6 @@ The protocol follows a simple request-response pattern:
511511

512512
#### State machine
513513

514-
| Agency | |
515-
| ----------------- | ---------------------------------------- |
516-
| Client has Agency | StIdle |
517-
| Server has Agency | StBusyNonBlocking,StBusyBlocking, StDone |
518514
| Agency | |
519515
| ----------------- | ---------------------------------------- |
520516
| Client has Agency | StIdle |
@@ -568,15 +564,15 @@ localMessageNotificationMessage
568564
/ msgClientDone
569565
570566
msgRequestMessages = [0, isBlocking]
571-
msgReplyMessagesNonBlocking = [1, messages, hasMore]
572-
msgReplyMessagesBlocking = [2, messages]
567+
msgReplyMessagesNonBlocking = [1, [* message], hasMore]
568+
msgReplyMessagesBlocking = [2, [+ message]]
573569
msgClientDone = [3]
574570
575571
messageId = bstr
576572
messageBody = bstr
577573
kesSignature = bstr
578574
kesPeriod = word64
579-
operationalCertificate = [ bstr, word64, word64, bstr ]
575+
operationalCertificate = [ bstr .size 32, word64, word64, bstr .size 64 ]
580576
coldVerificationKey = bstr .size 32
581577
expiresAt = word32
582578
@@ -587,15 +583,14 @@ messagePayload = [
587583
, expiresAt
588584
]
589585
message = [
590-
bstr .cbor messagePayload
586+
messagePayload
591587
, kesSignature
592-
, bstr .cbor operationalCertificate
588+
, operationalCertificate
593589
, coldVerificationKey
594590
]
595591
596592
hasMore = false / true
597593
isBlocking = false / true
598-
messages = [* message]
599594
```
600595

601596
## Rationale: how does this CIP achieve its goals?
@@ -706,15 +701,15 @@ the KES key.
706701
- [x] Validate protocol behaviour with all relevant parties (Network and Node teams).
707702
- [x] Make the current Cardano Network Diffusion Layer general and reusable so a new, separate Mithril Diffusion Layer can be instantiated.
708703
- See [here](https://github.com/IntersectMBO/ouroboros-network/wiki/Reusable-Diffusion-Investigation) and [here](https://github.com/IntersectMBO/ouroboros-network/pull/5016)
709-
- [ ] Implement DMQ Node that is able to run general diffusion (i.e. without the mini-protocols).
704+
- [x] Implement DMQ Node that is able to run general diffusion (i.e. without the mini-protocols).
710705
- See [here](https://github.com/IntersectMBO/ouroboros-network/pull/5109)
711-
- [ ] Implement the n2n and n2c mini-protocols:
712-
- [ ] Haskell DMQ Node:
713-
- [ ] n2c mini-protocols
714-
- [ ] n2n mini-protocols
715-
- [ ] Pallas Library (TxPipe):
706+
- [x] Implement the n2n and n2c mini-protocols:
707+
- [x] Haskell DMQ Node:
708+
- [x] n2c mini-protocols
709+
- [x] n2n mini-protocols
710+
- [x] Pallas Library (TxPipe):
716711
- [x] n2c mini-protocols
717-
- [ ] n2n mini-protocols
712+
- [x] ~~n2n mini-protocols~~ (will be done in a separate stream of work)
718713
- [x] Implement the n2c mini-protocols in Mithril nodes:
719714
- [x] Mithril signer
720715
- [x] Mithril aggregator

0 commit comments

Comments
 (0)