Skip to content

Commit a77b522

Browse files
authored
add signature documentation page (#123)
1 parent 1b53e3b commit a77b522

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [The backend structure of a POD]()
1111
- [Backend types](./backendtypes.md)
1212
- [MerkleTree](./merkletree.md)
13+
- [Signature](./signature.md)
1314
- [Deductions](./deductions.md)
1415
- [Statements](./statements.md)
1516
- [Statements involving compound types and Merkle trees](./merklestatements.md)

book/src/signature.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Signature
2+
3+
4+
Current signature scheme used is proof-based signatures using Plonky2 proofs, following [https://eprint.iacr.org/2024/1553](https://eprint.iacr.org/2024/1553) and [https://jdodinh.io/assets/files/m-thesis.pdf](https://jdodinh.io/assets/files/m-thesis.pdf). This comes from [Polygon Miden's RPO STARK-based](https://github.com/0xPolygonMiden/crypto/blob/d2a67396053fded90ec72690404c8c7728b98e4e/src/dsa/rpo_stark/signature/mod.rs#L129) signatures.
5+
6+
In future iterations we may replace it by other signature schemes (either elliptic curve based scheme on a Golilocks-prime friendly curve, or a lattice based scheme).
7+
8+
9+
10+
### generate_params()
11+
$pp$: plonky2 circuit prover params<br>
12+
$vp$: plonky2 circuit verifier params<br>
13+
return $(pp, vp)$
14+
15+
### keygen()
16+
secret key: $sk \xleftarrow{R} \mathbb{F}^4$<br>
17+
public key: $pk := H(sk)$ [^1]<br>
18+
return $(sk, pk)$
19+
20+
### sign(pp, sk, m)
21+
$pk := H(sk)$<br>
22+
$s := H(pk, m)$<br>
23+
$\pi = plonky2.Prove(pp, sk, pk, m, s)$<br>
24+
return $(sig:=\pi)$
25+
26+
### verify(vp, sig, pk, m)
27+
$\pi = sig$<br>
28+
$s := H(pk, m)$<br>
29+
return $plonky2.Verify(vp, \pi, pk, m, s)$
30+
31+
32+
### Plonky2 circuit
33+
private inputs: $(sk)$<br>
34+
public inputs: $(pk, m, s)$<br>
35+
$pk \stackrel{!}{=} H(sk)$<br>
36+
$s \stackrel{!}{=} H(pk, m)$
37+
38+
39+
<br><br>
40+
41+
[^1]: The [2024/1553 paper](https://eprint.iacr.org/2024/1553) uses $pk:=H(sk||0^4)$ to have as input (to the hash) 8 field elements, to be able to reuse the same instance of the RPO hash as the one they use later in the signature (where it hashes 8 field elements).

book/src/signedpod.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A SignedPod consists of the following fields:
55
- it can only contain [`ValueOf` statements](./statements.md).
66
- the Signer's public key is one of the key-values in the `kvs`.
77
- `id`: the Root of the `kvs` MerkleTree
8-
- `signature`: a signature over the `id`
8+
- `signature`: a [signature](./signature.md) over the `id`
99
- `signer`: the public key attached to the digital signature `signature`
1010
- `type`: the constant `SIGNATURE`
1111

0 commit comments

Comments
 (0)