The zk Script Library is a collection of Python scripts that generate Bitcoin SV Scripts compatible with Bitcoin SV version 1.1.0.
The library supports the generation of Groth16 verification scripts and ancillary operations.
The following scripts are currently implemented:
The library currenly contains implementations of pairings and Groth16 for:
Make sure you are using Python 3.11 or later versions.
You can check your Python version with
python --versionAfter cloning the repository, you can install all the dependencies with
pip install -r requirements.txtThe folder test contains scripts generating Bitcoin Scripts
for all the implemented operations.
Groth16 locking scripts are generated by test_groth16.py.
You can generate the script verifying Groth16 for BLS12-281 and MNT4-753 with pytest:
pytest .\tests\groth16\test_groth16.py --save-to-jsonWhen the --save-to-json option is set (as shown above), scripts are saved in the data/ folder.
A transaction spending an output locked by a Groth16 verifier can be found here.
The script sizes for Groth16 are:
| Curve | # public statements | Unlocking script size | Locking script size | Modulo threshold | Total |
|---|---|---|---|---|---|
BLS12-381 |
2 | ~ 60 KB | ~ 473 KB | 200B | ~ 533 KB |
MNT4-753 |
1 | ~ 400 KB | ~ 658 KB | 200B | ~ 1.06 MB |
Note: the unlocking script is dependent on the public statements.
The code and resources within this repository are intended for research and educational purposes only.
Please note:
- No guarantees are provided regarding the security or the performance of the code.
- Users are responsible for validating the code and understanding its implications before using it in any capacity.
- There may be edge cases causing bugs or unexpected behaviours. Please contact us if you find any bug.
The code is released under the attached LICENSE. If you would like to use it for commercial purposes, please contact [email protected].