or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Hash-based Signature Aggregation
1. Hash-based Signature Parameter
We use Poseidon2 instantiation with the following parameter:
The implementation of this specific instantiation could be found here.
2. Approach - zkVM
2.1. With
succinctlabs/sp1
(based onplonky3
)2.2. With
openvm-org/openvm
(based onplonky3
)3. Approach - Circuit
3.1. With
plonky3
3.1.1. Introduction
In order to handle non-uniform computations efficiently, we split the circuit into multiple AIR traces and use lookup to connect input/output between each other.
AIR traces are:
Main
Chain
MerkleTree
Decomposition
RangeCheck
3.1.1.1.
Main
The
Main
is mainly used to synchronize other AIR traces, it does 3 things:(sig_idx, msg_hash)
toDecomposition
to make sure thex
are decomposed frommsg_hash
.(sig_idx, parameter)
toChain
to make sure it's using the sameparameter
as others.(sig_idx, parameter, msg_hash, merkle_root)
toMerkleTree
to make sure themsg_hash
is computed from the sameparameter
as others, and at the same time send to expectedmerkle_root
to be checked forsigs[sig_idx]
.And
parameter
andmerkle_root
parts are the statement of this aggregation circuit, verifier can calculate their polynomial evaluations in \(O(n\log n)\) tiem by FFT.3.1.1.2.
Chain
The
Chain
receivesx
(msg_hash
chunks) fromDecomposition
, computes rest of the chain if theone_time_sig_i
ofi
-th chain is not yet the end, then sends theone_time_pk_i
toMerkleTree
.We ignore the chain if it's already in the end, so the number of rows for a signature could be constant (equal to the target sum).
A sample trace with
x = (0, 2, 1, 3, 3, 0, ..., 1, 3, 3)
might look like:3.1.1.3.
MerkleTree
The
MerkleTree
receives 2 things:one_time_pk_i
wherex_i
is not yet end fromChain
, and hashes them withone_time_pk_i
wherex_i
is already end intomerkle_leaf_hash
, and then computes themerkle_root
to be used latter.(parameter, merkle_root, msg_hash)
as synchronization, where themerkle_root
is computed frommerkle_leaf_hash
andsiblings
,parameter
is used in all tweakable hashes, andmsg_hash
is computed separately in the next adjacent row.A sample trace with
epoch = 0b0...01
might look like:3.1.1.4.
Decomposition
The
Decomposition
receivesmsg_hash
asvalues
, and calculates(((values[4] * P) + values[3]) * P + ...) * P + values[0]
, then decompose it into base2w
chunks and send non-ending chunk toChain
.A sample trace with
x = (0, 2, 1, 3, 3, 0, ..., 1, 3, 3)
might look like:3.1.1.5.
RangeCheck
The
RangeCheck
is filled by range0..212
to receiveslimb
fromDecomposition
as range check.3.1.1.6. Other gadgets used in the chips
See https://hackmd.io/@tcoratger/SyWbmVPckx for more details.
3.1.2. Benchmark
124
(degree-4 extension of KoalaBear)256 / R
The benchmark aggregates 8192 signatures, to reproduce please run the following script in
<repo>/circuit
:R
T
PT
TP
PS
PM
VT
1
4
5.33 s
1536
1.68 MB
5.76 GB
94.04 ms
1
8
3.00 s
2729
1.68 MB
5.78 GB
99.68 ms
1
16
2.65 s
3086
1.68 MB
5.17 GB
94.55 ms
1
24
2.19 s
3745
1.68 MB
5.93 GB
96.09 ms
2
4
8.59 s
953
930.96 kB
8.91 GB
49.09 ms
2
8
4.98 s
1644
933.96 kB
8.81 GB
59.41 ms
2
16
4.24 s
1932
933.71 kB
8.97 GB
72.45 ms
2
24
3.36 s
2439
933.96 kB
12.48 GB
50.08 ms
3
4
14.99 s
546
672.30 kB
16.07 GB
53.88 ms
3
8
8.75 s
936
671.24 kB
16.27 GB
35.08 ms
3
16
7.22 s
1134
670.96 kB
16.18 GB
40.86 ms
3
24
6.17 s
1327
671.02 kB
16.21 GB
34.79 ms
R
: Log 1/rateT
: ThreadsPT
: Proving timeTP
: Throughput (sig/s)PS
: Proof sizePM
: Peak proving memoryVT
: Verifying time