Qapver Error
Closed this issue · 2 comments
iamtrask commented
I successfully compiled qaptools and python-libsnark and installed pysnark. However, i can't seem to verify the snark (And i'm not sure it's producing all the files it should)
atrask-macbookpro3:examples atrask$ python cube.py 3
The cube of 3 is 27
*** Trying to read pysnark_ek
*** PySNARK: generating proof pysnark_log (sat=True, #io=2, #witness=2, #constraint=3)
*** Public inputs: 3 27
*** Verification status: True
atrask-macbookpro3:examples atrask$ python -m pysnark.qaptools.runqapver
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysnark/qaptools/runqapver.py", line 60, in <module>
run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysnark/qaptools/runqapver.py", line 55, in run
raise RuntimeError("qapver failed")
RuntimeError: qapver failed
atrask-macbookpro3:examples atrask$ ls
bench.py cs2 kaplanmeier.py snarkprofile.py
binarycircuit.py cube-qaptools.py manysquares.py sudoku.py
binarycircuit_example.txt cube.py pysnark_ek test.py
branch2.py cube_json.py pysnark_log test2.py
compare.py factorial.py pysnark_vk testarray.py
cs index.html secretsanta.py testcomm.py
atrask-macbookpro3:examples atrask$
meilof commented
It seems you are using the libsnark backend to make the proof but using the qapver tool from qaptools to verify. The two backends use different and mutually incompatible sets of files to store the keys and proofs. If you use the libsnark backend (which is the default) then you can use for example snarkjs to verify the proofs (see https://meilof.github.io/pysnark/ <https://meilof.github.io/pysnark/>). You can also use the qaptools backend (e.g., by doing “PYSNARK_BACKEND=qaptools python3 cube.py 33”, in which case the runqapver command you mention should work. But I agree this is not directly clear from the documentation.
Hope that helps!
Op vr 20 dec. 2019 02:49 schreef Andrew Trask <notifications@github.com <mailto:notifications@github.com>>:
I successfully compiled qaptools and python-libsnark and installed pysnark. However, i can't seem to verify the snark (And i'm not sure it's producing all the files it should)
atrask-macbookpro3:examples atrask$ python cube.py 3
The cube of 3 is 27
*** Trying to read pysnark_ek
*** PySNARK: generating proof pysnark_log (sat=True, #io=2, #witness=2, #constraint=3)
*** Public inputs: 3 27
*** Verification status: True
atrask-macbookpro3:examples atrask$ python -m pysnark.qaptools.runqapver
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysnark/qaptools/runqapver.py", line 60, in <module>
run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysnark/qaptools/runqapver.py", line 55, in run
raise RuntimeError("qapver failed")
RuntimeError: qapver failed
atrask-macbookpro3:examples atrask$ ls
bench.py cs2 kaplanmeier.py snarkprofile.py
binarycircuit.py cube-qaptools.py manysquares.py sudoku.py
binarycircuit_example.txt cube.py pysnark_ek test.py
branch2.py cube_json.py pysnark_log test2.py
compare.py factorial.py pysnark_vk testarray.py
cs index.html secretsanta.py testcomm.py
atrask-macbookpro3:examples atrask$
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#4?email_source=notifications&email_token=ACAJUUYZ3U3XPCF73CQGAOTQZQQDJA5CNFSM4J5U7VK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IB2J7JA>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACAJUU3BHYU2YAQIO6776IDQZQQDJANCNFSM4J5U7VKQ>.
iamtrask commented
Excellent! Thank you so much! I'll let you know how it goes.
Great work on the library by the way.
…On Fri, Dec 20, 2019 at 7:50 PM meilof ***@***.***> wrote:
It seems you are using the libsnark backend to make the proof but using
the qapver tool from qaptools to verify. The two backends use different and
mutually incompatible sets of files to store the keys and proofs. If you
use the libsnark backend (which is the default) then you can use for
example snarkjs to verify the proofs (see
https://meilof.github.io/pysnark/ <https://meilof.github.io/pysnark/>).
You can also use the qaptools backend (e.g., by doing
“PYSNARK_BACKEND=qaptools python3 cube.py 33”, in which case the runqapver
command you mention should work. But I agree this is not directly clear
from the documentation.
Hope that helps!
Op vr 20 dec. 2019 02:49 schreef Andrew Trask ***@***.***
***@***.***>>:
I successfully compiled qaptools and python-libsnark and installed
pysnark. However, i can't seem to verify the snark (And i'm not sure it's
producing all the files it should)
atrask-macbookpro3:examples atrask$ python cube.py 3
The cube of 3 is 27
*** Trying to read pysnark_ek
*** PySNARK: generating proof pysnark_log (sat=True, #io=2, #witness=2,
#constraint=3)
*** Public inputs: 3 27
*** Verification status: True
atrask-macbookpro3:examples atrask$ python -m pysnark.qaptools.runqapver
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py",
line 193, in _run_module_as_main
"__main__", mod_spec)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py",
line 85, in _run_code
exec(code, run_globals)
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysnark/qaptools/runqapver.py",
line 60, in <module>
run()
File
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pysnark/qaptools/runqapver.py",
line 55, in run
raise RuntimeError("qapver failed")
RuntimeError: qapver failed
atrask-macbookpro3:examples atrask$ ls
bench.py cs2 kaplanmeier.py snarkprofile.py
binarycircuit.py cube-qaptools.py manysquares.py sudoku.py
binarycircuit_example.txt cube.py pysnark_ek test.py
branch2.py cube_json.py pysnark_log test2.py
compare.py factorial.py pysnark_vk testarray.py
cs index.html secretsanta.py testcomm.py
atrask-macbookpro3:examples atrask$
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <
#4?email_source=notifications&email_token=ACAJUUYZ3U3XPCF73CQGAOTQZQQDJA5CNFSM4J5U7VK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IB2J7JA>,
or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ACAJUU3BHYU2YAQIO6776IDQZQQDJANCNFSM4J5U7VKQ>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4?email_source=notifications&email_token=ABBAZES3W5AMN75F7BSIML3QZUOYXA5CNFSM4J5U7VK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHN7V3I#issuecomment-568064749>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBAZEWLYJUJX53PT2LNQ7TQZUOYXANCNFSM4J5U7VKQ>
.