Skip to content

Commit 547e2c6

Browse files
committed
address PR review comments
1 parent 1e9db24 commit 547e2c6

4 files changed

Lines changed: 65 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
### WIP
66

7-
- Add abstract BLS primitives and a strict total order on key hashes to `CryptoStructure`, and the voting-key expiry period `BlsKeyMaxAgeᶜ` to `GlobalConstants` (CIP-164).
87
- Move cert-deposit helpers from `Utxo` to `Certs`.
98
- Fix `updateCertDeposits`: use `foldl` (CERTS is head-first).
109
- Add `HasCoin-UTxOState` and `HasCoin-LedgerState` instances; the latter sums UTxO total, rewards balance, and all three deposit fields.

src/Ledger/Core/Specification/Crypto.lagda.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Ledger.Core.Specification.Crypto where
1616
1717
open import Ledger.Prelude hiding (T)
1818
open import Ledger.Prelude.Numeric.UnitInterval
19-
open import Relation.Binary using (IsStrictTotalOrder)
2019
2120
record isHashableSet (T : Type) : Type₁ where
2221
constructor mkIsHashableSet
@@ -81,21 +80,6 @@ record CryptoStructure : Type₁ where
8180
field VRF : Type
8281
⦃ DecEq-VRF ⦄ : DecEq VRF
8382
84-
-- Byte-wise ascending order on key hashes; the Leios committee tie-break.
85-
field _<ᵏʰ_ : KeyHash → KeyHash → Type
86-
<ᵏʰ-isSTO : IsStrictTotalOrder _≡_ _<ᵏʰ_
87-
⦃ Dec-<ᵏʰ ⦄ : _<ᵏʰ_ ⁇²
88-
89-
-- BLS12-381 signature scheme used for Leios voting (CIP-0164).
90-
field BlsVKey BlsSig BlsPoP : Type
91-
isValidPoP : BlsVKey → BlsPoP → Type
92-
isSignedByAggregate : List BlsVKey → Ser → BlsSig → Type
93-
⦃ DecEq-BlsVKey ⦄ : DecEq BlsVKey
94-
⦃ DecEq-BlsSig ⦄ : DecEq BlsSig
95-
⦃ DecEq-BlsPoP ⦄ : DecEq BlsPoP
96-
⦃ Dec-isValidPoP ⦄ : isValidPoP ⁇²
97-
⦃ Dec-isSignedByAggregate ⦄ : isSignedByAggregate ⁇³
98-
9983
-- TODO: KES
10084
```
10185
-->

src/Ledger/Dijkstra/Specification.lagda.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ import Ledger.Dijkstra.Specification.Chain
5656
import Ledger.Dijkstra.Specification.Chain.Properties
5757
```
5858

59+
## Abstract cryptographic primitives
60+
61+
```agda
62+
import Ledger.Dijkstra.Specification.Crypto
63+
```
64+
5965
## Enactment
6066

6167
```agda
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
source_branch: master
3+
source_path: src/Ledger/Dijkstra/Specification/Crypto.lagda.md
4+
---
5+
6+
# Dijkstra Cryptographic Primitives
7+
8+
<!--
9+
```agda
10+
11+
{-# OPTIONS --safe #-}
12+
module Ledger.Dijkstra.Specification.Crypto where
13+
14+
open import Ledger.Prelude
15+
open import Relation.Binary using (IsStrictTotalOrder)
16+
open import Ledger.Core.Specification.Crypto hiding (CryptoStructure)
17+
```
18+
-->
19+
20+
## Leios Voting Crypto
21+
22+
In Leios the committee consists of a certain number of pools with the largest
23+
stake, with ties broken by pool id. Therefore the `KeyHash`{AgdaDatatype} type
24+
carries a strict total order, the implementation's byte-wise comparison.
25+
(See the [Epoch Boundary section] of [CIP-0164].)
26+
27+
```agda
28+
record CryptoStructure : Type₁ where
29+
field pkk : PKKScheme
30+
31+
open PKKScheme pkk public
32+
33+
field ⦃ khs ⦄ : isHashableSet VKey
34+
ScriptHash : Type; ⦃ DecEq-ScriptHash ⦄ : DecEq ScriptHash ; ⦃ Show-ScriptHash ⦄ : Show ScriptHash
35+
36+
open isHashableSet khs renaming (THash to KeyHash) hiding (DecEq-T) public
37+
38+
field VRF : Type
39+
⦃ DecEq-VRF ⦄ : DecEq VRF
40+
41+
-- Byte-wise ascending order on key hashes; the Leios committee tie-break.
42+
field _<ᵏʰ_ : KeyHash → KeyHash → Type
43+
<ᵏʰ-isSTO : IsStrictTotalOrder _≡_ _<ᵏʰ_
44+
⦃ Dec-<ᵏʰ ⦄ : _<ᵏʰ_ ⁇²
45+
46+
-- BLS12-381 signature scheme used for Leios voting (CIP-0164).
47+
field BlsVKey BlsSig BlsPoP : Type
48+
isValidPoP : BlsVKey → BlsPoP → Type
49+
isSignedByAggregate : List BlsVKey → Ser → BlsSig → Type
50+
⦃ DecEq-BlsVKey ⦄ : DecEq BlsVKey
51+
⦃ DecEq-BlsSig ⦄ : DecEq BlsSig
52+
⦃ DecEq-BlsPoP ⦄ : DecEq BlsPoP
53+
⦃ Dec-isValidPoP ⦄ : isValidPoP ⁇²
54+
⦃ Dec-isSignedByAggregate ⦄ : isSignedByAggregate ⁇³
55+
56+
```
57+
58+
[CIP-164]: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0164/README.md
59+
[Epoch Boundary section]: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0164/README.md#epoch-boundary

0 commit comments

Comments
 (0)