0xpolygonhermez / pil-stark Goto Github PK
View Code? Open in Web Editor NEWGenerates a stark from a pil
License: Other
Generates a stark from a pil
License: Other
I notice that in circuits.gl/mux1.circom
, the output of MultiMux1(n)
is like this:
out[i] <== (c[1][i] - c[0][i])*s + c[0][i];
It seemed like a non-deterministic circuit, when "s=0" or "c[1][i] - c[0][i]=0", the other factor can be any value.
I'm not pretty sure, does that sound like a real problem for the team?
const starkStruct = {
"nBits": 10,
"nBitsExt": 11,
"nQueries": 128,
"verificationHashType": "GL",
"steps": [
{"nBits": 11},
{"nBits": 5},
{"nBits": 3},
{"nBits": 1}
]
};
I think nBits
and nBitsExt
are corresponding to domain field size and extension field size, GL
means Goldilocks
field.
What about nQueries
and steps
?
For example: "test fibonacci" output ends with:
1) test fibonacci sm
It should create the pols main:
RangeError: Array buffer allocation failed
at new ArrayBuffer (<anonymous>)
at new BigUint64Array (<anonymous>)
at new BigBuffer (node_modules\pilcom\src\bigbuffer.js:11:36)
at starkGen (src\stark_gen.js:74:20)
at async Context.<anonymous> (test\stark_fibonacci.test.js:51:22)
node_modules/mocha/lib/reporters/base.js:305
Process exited with code 1
Running x64 node v16.17.0, Windows 11, lots of RAM, nothing else running. "test plookup" executes correctly
There are no references to goldenPrime. Seems relevant. Should this be incorporated or is it deprecated?
I really don't understand it:
Line 52 in cfb0914
for (let g = 0; g < pol.length / nX; g++) {
if (si == 0) {
pol2_e[g] = pol[g];
} else {
const ppar = new Array(nX);
for (let i = 0; i < nX; i++) {
ppar[i] = pol[(i * pol2N) + g];
}
const ppar_c = F.ifft(ppar);
polMulAxi(F, ppar_c, F.one, sinv); // Multiplies coefs by 1, shiftInv, shiftInv^2, shiftInv^3, ......
pol2_e[g] = evalPol(F, ppar_c, special_x);
sinv = F.mul(sinv, wi);
}
}
Does it mean that:
Does our "recursive STARK" mean:
"stark_proof_1" -> "snark_proof_1" -> "with input_2 then get stark_proof_2" -> "snark_proof_2" -> ....
OR just:
"stark_proof_1" -> "with input_2 then get stark_proof_2" -> ....
Maybe support bls12381?
TL;DR: The quotient
In the following, we denote by
In Round 6 of our eSTARK, we compute the following polynomial:
where
Notice that when the polynomial is over
Here is a trick1 from the Polygon Zero team to reduce this cost. The idea starts by noticing that an extension field element
Notice that such polynomial
Thus, the prover provides the polynomial
First, both newly introduced polynomials
Second, the minimal polynomial
Unrolling it out for our case, one must solve one of the following:
$$\left. \begin{array}{r} c_0+c_1 \cdot z_0 + z_0' = 0 \\ c_1 \cdot z_1 + z_1' = 0 \\ c_1 \cdot z_2 + z_2' = 0 \end{array} \right\} \qquad \left. \begin{array}{r} c_0+c_1 \cdot z_0 + c_2 \cdot z_0' + z_0'' = 0 \\ c_1 \cdot z_1 + c_2 \cdot z_1' + z_1'' = 0 \\ c_1 \cdot z_2 + c_2 \cdot z_2' + z_2'' = 0 \end{array} \right\}$$ where
$z := (z_0,z_1,z_2), z^2 := (z_0,'z_1',z_2')$ and$z^3 := (z_0'',z_1'',z_2'')$ .
The polynomials
This idea does not overcome the costs of the basic idea if the polynomials involved in the computation of
I explain the trick for those polynomials whose evaluation at $z$ is requested, but the same holds for those whose evaluation at $\omega z$ is requested (in fact, at any other point). โฉ
Line 209 in cfb0914
for (let i = maxDeg + 1; i < lastPol_c.length; i++) {
if (!F.isZero(lastPol_c[i])) return false;
}
for the last low-degree test, should it be i = maxDeg
instead of i = maxDeg + 1
? please check it.
I'm following Jordi Baylina's steps to try to learn our tool.
/usr/local/bin/node --max-old-space-size=32000 src/main_prover.js -m /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.commit -c /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.const -t /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.consttree -p /Users/lanyu/zyd/0xPolygonHermez/pil-stark/test/sm_fibonacci/fibonacci_main.pil -s /Users/lanyu/zyd/0xPolygonHermez/pil-stark/test/sm_fibonacci/fibonacci.starkstruct.json -o /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.proof.json -z /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.proof.zkin.json -b /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.public.json
loading /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.const.. 0 of 0.001953125
loading /Users/lanyu/zyd/0xPolygonHermez/pil-stark/tmp/fibonacci.commit.. 0 of 0.001953125
The "offset" argument must be of type number. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: The "offset" argument must be of type number. Received an instance of Object
at read (node:internal/fs/promises:478:5)
at fsCall (node:internal/fs/promises:313:18)
at FileHandle.read (node:internal/fs/promises:154:12)
at MerkleHash.readFromFile (/Users/lanyu/zyd/0xPolygonHermez/pil-stark/src/merklehash_p.js:246:18)
at async run (/Users/lanyu/zyd/0xPolygonHermez/pil-stark/src/main_prover.js:65:23)
Process exited with code 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.