Skip to content

A generic KZG commitment library, for use within the Apollo ZKP generation network.

License

Notifications You must be signed in to change notification settings

apollozkp/fourier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apollo ZK library

Discord Chat License: MIT example workflow Coverage Status

Website

To use

  1. Install from git
pip install git+http://github.com/apollozkp/fourier.git
  1. Import client
from fourier import Client
  1. Start client
client = Client(port=1337)

API

Start

Start the Rust RPC server and ping it to check if it is running.

client.start()

Stop

Stop the Rust RPC server.

client.stop()

Ping

Ping the Rust RPC server.

client.ping()
# {'jsonrpc': '2.0', 'result': 'pong', 'id': 1}

Commit

Compute a commitment to a polynomial.

# base64 encoded coefficients of polynomial
poly = ["AQB...", ..., "AQB..."]
client.commit(poly=poly)
# {'jsonrpc': '2.0', 'result': {'commitment': '123...efg'}, 'id': 1}

Open

Open a polynomial at a point.

# base64 encoded coefficients of polynomial
poly = ["AQB...", ..., "AQB..."]
# base64 encoded point
x = "AQB..."
client.open(poly=poly, x=x)
# {'jsonrpc': '2.0', 'result': {'proof': '123...efg'}, 'id': 1}

Verify

Verify a proof of polynomial at a point.

# base64 encoded proof
proof = "AQB..."
# base64 encoded point
x = "AQB..."
# base64 encoded value of polynomial at x
y = "AQB..."
# base64 encoded commitment
commitment = "AQB..."
client.verify(proof=proof, x=x, y=y, commitment=commitment)
# {'jsonrpc': '2.0', {'valid': True}, 'id': 1}

RandomPoly

Generate a random polynomial.

# degree of polynomial
degree = 10
client.random_poly(degree=degree)
# {'jsonrpc': '2.0', 'result': {'poly': ['123...efg', ..., '123...efg']}, 'id': 1}

About

A generic KZG commitment library, for use within the Apollo ZKP generation network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published