Aleo Testnet 3

Bird's Eye View

blockHash0

blockHash1

blockHashk \(= B_k\)

  • Who will add the next block?
    • Decide by creating a puzzle
    • Whoever solves it first wins the race to add the new block
  • The puzzle must be a function of the block hash
    • Should it be deterministic w.r.t. block hash?

Miner \(M\)

Solution \(1\)

Solution \(2\)

Solution \(c\)

\(\vdots\)

Bird's Eye View

blockHash0

blockHash1

blockHashk \(= B_k\)

Miner \(M\)

Solution \(1\)

Solution \(2\)

Solution \(c\)

\(\vdots\)

\textsf{mine}(B_k, M, c)
p = \textsf{createPuzzle}(B_k)
s = \textsf{solvePuzzle}(p, B_k, M, c)
\text{if } \ \textsf{meetsTarget}(s):
\text{return } \ s
\text{else} :
\textsf{mine}(B_k, M, c+1)

Bird's Eye View

\textsf{createPuzzle}(B_k)
\textsf{solvePuzzle}(p, B_k, M, c)
R = [\dots]
\text{// register table}
I_N = \textsf{sampleInst}(B_k, R)
\text{// sample $N$ instructions}
S = \textsf{createStack}(I_N)
p = \textsf{program}(S, R)
\text{return } \ p
\text{// move instructions to an empty stack}
\textsf{rng} = \textsf{sha256}(\textsf{sha256}(B_k, M, c))
\text{// create a random number generator}
x = \textsf{randomInputs}(p, \textsf{rng})
\text{// generates random inputs, } x \in \mathbb{B}/\mathbb{F}/i8/i16/i32/i64/i128
t = \textsf{r1cs}(y = p(x))
\text{// generates r1cs trace}
L = \textsf{toBits}(t)
\text{// creates leaves by converting the trace to bits}
\text{return } \ \textsf{merkleRoot}_{8, 8}(L)
\text{// solution is merkle root of depth-8, arity-8 tree}

Bird's Eye View

\textsf{createPuzzle}(B_k)
\textsf{solvePuzzle}(p, B_k, M, c)
R = [\dots]
I_N = \textsf{sampleInst}(B_k, R)
S = \textsf{createStack}(I_N)
p = \textsf{program}(S, R)
\text{return } \ p
\textsf{rng} = \textsf{sha256}(\textsf{sha256}(B_k, M, c))
x = \textsf{randomInputs}(p, \textsf{rng})
t = \textsf{r1cs}(y = p(x))
L = \textsf{toBits}(t)
\text{return } \ \textsf{merkleRoot}_{8, 8}(L)
  • What are the instruction types?
  • What is the distribution?
  • Can we predict leaves based on the distribution?
  • Sizes of random inputs are known.
  • We don't need to "build" circuit, just need witnesses.
  • Padding in merkle-tree with arity 8.
  • Leaves are 0 or 1.
L
\frac{L}{4}
\frac{L}{8}

Convolution

3@128x128

364@128x128

364@128x128

364@128x128

48@128x128

48@1x1

N Convolution layers

Convolution

Avg pooling

Fully connected