Skip to content
This repository has been archived by the owner on Feb 6, 2021. It is now read-only.

SadPencil/code0k-cc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code0k-cc: Zero-Knowledge Compiler for zk-SNARKs

Warning: This project is still at very early stage. The compiler may crash, producing a wrong output, or having potential bugs. Do NOT use it until this project goes to alpha phase.

Get the compiler

Download

After this project goes to alpha phase, a pre-compiled binary will be provided for common platforms.

And place the executable file to /usr/local/bin, naming code0k-cc.

Compile the compiler by hand

Prerequisite

Compile

dotnet publish -r <RUNTIME_IDENTIFIER> -c Release -p:PublishSingleFile=true

where the <RUNTIME_IDENTIFIER> might be one of the following.

win-x64
win-arm64
linux-x64
linux-arm64
osx-x64

Although supported, do not compile it to a 32-bit platform, e.g. win-x86. The compiler requires plenty of memory, compared to traditional compilers.

Take an example.

dotnet publish -r linux-x64 -c Release -p:PublishSingleFile=true

And place the executable file to /usr/local/bin, naming code0k-cc.

Compile the zero-knowledge code

For convenience, the input file is called input.c0k.c. You may get an example file from Examples folder.

Pre-Process

You may use gcc to pre-process the file. This enabling #include #ifdef and removing the comment of the source code.

# command on Bash
gcc -E input.c0k.c | grep -v "^#" > input.c0k.i
REM command on Windows cmd
gcc -E input.c0k.c | findstr -V "^#" > input.c0k.i

Compile

code0k-cc input.c0k.i

And the output file will be input.c0k.i.arith and input.c0k.i.in.txt.

Edit input.c0k.i.in.txt. Provide input & nizk-input values by replacing <to-be-filled-by-user>.

In the future, a helper program will be provided to help user provide input & nizk-input values with more complex types and values.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages