scipr-lab / dizk Goto Github PK
View Code? Open in Web Editor NEWJava library for distributed zero knowledge proof systems
License: Other
Java library for distributed zero knowledge proof systems
License: Other
Are the following applications mentioned in README.md and paper contained in the library? I didn't find it anywhere...
If they are contained, could you refer me to those circuits and the commands for running them? If not, will those be open-sourced?
In fact, I found some keywords of the ML models like Covariance and Regression under the profiling folder which seems like the ML application. However, the operations about photo proof are not found at all. Another question is that is the circuit portable to libsnark?
I followed the four steps and find errors when running mvn test
The I use mvn text -x
for printing out logs, the error log is below:
Tests run: 71, Failures: 0, Errors: 10, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.968 s
[INFO] Finished at: 2020-02-21T21:40:08+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project dizk: There are test failures.
[ERROR]
[ERROR] Please refer to /home/silverpoker/github/dizk/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project dizk: There are test failures.
Please refer to /home/silverpoker/github/dizk/target/surefire-reports for the individual test results.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
Please refer to /home/silverpoker/github/dizk/target/surefire-reports for the individual test results.
at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution (SurefireHelper.java:83)
at org.apache.maven.plugin.surefire.SurefirePlugin.writeSummary (SurefirePlugin.java:176)
at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary (SurefirePlugin.java:150)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked (AbstractSurefireMojo.java:650)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute (AbstractSurefireMojo.java:586)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
All of the following 4 errors on unit tests are nullPointerExceptions coming from what appear to be an issue with algebra.curves.barreto_naehrig.BNG1.one and algebra.curves.barreto_naehrig.BNG1.zero.
I am not overly familiar with Java development, but wonder if this could be a result of my java --version
(which is 11). Otherwise, I am stumped on how to continue here.
Results of mvn test:
Tests in error:
DistributedBN254bProofSystemTest(zk_proof_systems.zkSNARK.DistributedzkSNARKTest)
SerialBN254bProofSystemTest(zk_proof_systems.zkSNARK.SerialzkSNARKTest)
BN254bTest(algebra.curves.CurvesTest)
BN254bTest(algebra.curves.BilinearityTest)
Tests run: 71, Failures: 0, Errors: 4, Skipped: 0
BN254bTest(algebra.curves.BilinearityTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:113)
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:17)
at algebra.groups.AbstractGroup.mul(AbstractGroup.java:35)
at algebra.groups.AbstractGroup.mul(AbstractGroup.java:54)
etc...
BN254bTest(algebra.curves.CurvesTest) Time elapsed: 0 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:113)
at algebra.curves.barreto_naehrig.BNG1.zero(BNG1.java:17)
at algebra.curves.CurvesTest.GroupTest(CurvesTest.java:33)
at algebra.curves.CurvesTest.BN254bTest(CurvesTest.java:93)
etc...
SerialBN254bProofSystemTest(zk_proof_systems.zkSNARK.SerialzkSNARKTest) Time elapsed: 0.077 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.one(BNG1.java:117)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:121)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:17)
at zk_proof_systems.zkSNARK.SerialSetup.generate(SerialSetup.java:89)
at zk_proof_systems.zkSNARK.SerialzkSNARKTest.SerialBNProofSystemTest(SerialzkSNARKTest.java:82)
at zk_proof_systems.zkSNARK.SerialzkSNARKTest.SerialBN254bProofSystemTest(SerialzkSNARKTest.java:142)
etc...
DistributedBN254bProofSystemTest(zk_proof_systems.zkSNARK.DistributedzkSNARKTest) Time elapsed: 3.362 sec <<< ERROR!
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.one(BNG1.java:117)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:121)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:17)
at zk_proof_systems.zkSNARK.DistributedSetup.generate(DistributedSetup.java:82)
at zk_proof_systems.zkSNARK.DistributedzkSNARKTest.DistributedBNProofSystemTest(DistributedzkSNARKTest.java:103)
at zk_proof_systems.zkSNARK.DistributedzkSNARKTest.DistributedBN254bProofSystemTest(DistributedzkSNARKTest.java:163)
etc...
Hi all,
I think there is a problem with the evaluate() method in relations.objects.LinearCombination
.
This line seems fishy if the condition is true:
final FieldT value = index == 0 ? one : input.get((int) index).mul(terms.get(i).value());
If index == 0
, we want to add the constant value of the linear combination, which should be
terms.get(i).value()
, not one
.
DIZK is an awesome concept, and I'd really want to try this out for some of the larger constraint systems I work on - some of these are in libsnark.
It would be awesome if we could read in R1CS constraint systems as they are serialized in libsnark, so DIZK could be used with a lot of the existing circuits out there.
Follow the steps of building, when executing mvn test
java.lang.NullPointerException
at algebra.curves.barreto_naehrig.BNG1.one(BNG1.java:117)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:121)
at algebra.curves.barreto_naehrig.BNG1.random(BNG1.java:17)
at zk_proof_systems.zkSNARK.DistributedSetup.generate(DistributedSetup.java:82)
There are 4 locations where this error occurs.
Tests in error:
DistributedBN254bProofSystemTest(zk_proof_systems.zkSNARK.DistributedzkSNARKTest)
SerialBN254bProofSystemTest(zk_proof_systems.zkSNARK.SerialzkSNARKTest)
BN254bTest(algebra.curves.BilinearityTest)
BN254bTest(algebra.curves.CurvesTest)
In FFTAuxiliary.java, line 197 has a bad equality test.
if (omega_i == t) {
should be replaced by
if (omega_i.equals(t)) {
Currently, the construction of the polynomial will fail when evaluated at a root of unity.
Based on the Profiler script
dizk/src/main/java/profiler/scripts/profile.sh
Lines 8 to 11 in 81d72a3
with APP=zksnark-large
and size range limited to 15..19 we get the following output file
Verifier-for--4exec-2cpu-10mem-16partitions.csv
Size (inputs),Verifier (sec),isValid
32768,0.957887561,1
65536,1.446744197,0
131072,0.977929921,0
262144,1.144847189,0
524288,0.917492237,1
How much code here duplicates code in other sipr-labs repositories? I suppose the base differs and then everything else above must change as a result?
I'm asking because one rust clone of Spark is being developed https://github.com/rajasekarv/native_spark although I suspect they should figure out async ala rajasekarv/vega#71 before one uses it for much.
I think there is a bug in the Window Table calculation in the SerialSetup.java.
Around line 90, there is this block of code that initializes the window table.
config.beginLog("Generating G1 MSM Window Table");
final G1T generatorG1 = g1Factory.random(config.seed(), config.secureSeed());
final int scalarCountG1 = nonZeroAt + nonZeroBt + numVariables;
final int scalarSizeG1 = generatorG1.bitSize();
final int windowSizeG1 = FixedBaseMSM.getWindowSize(scalarCountG1, generatorG1);
final List<List<G1T>> windowTableG1 = FixedBaseMSM
.getWindowTable(generatorG1, scalarSizeG1, windowSizeG1);
config.endLog("Generating G1 MSM Window Table");
The scalarSizeG1
is set to the size of the generator, and this returns the minimum number of bits that can represent generatorG1
. If I pick this to be g1Factory.one()
(a valid generator), the scalarSizeG1
would be 2 and the window table would be too small. I did some basic tests for batchMSM
with such a table (with scalars between 1 and 10) and it could not accurately compute the multiples of generatorG1
, because it did not inspect all the bits of the scalars.
I think this should not really depend on the generator but be an attribute of the type used. Otherwise, even when uniformly sampling the generator, we should get a wrong number of bits with reasonable probability.
I did a quick fix for my particular use case (non-generic) like this. A better fix should be capable of taking the type into account:
scalarSizeG1 = (int) BN254aFields.BN254aFr.FrParameters.numBits();
Missing else condition in the distributed and serial profiling apps that throws, or at least logs, an error when appName is not listed.
dizk/src/main/java/profiler/utils/SparkUtils.java
Lines 31 to 54 in e98dd9c
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.