davxy / arkworks-substrate-examples

Example implementation of curve arithmetic for the ark-substrate curves

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Substrate Arkworks Examples

Examples using Arkworks curve arithmetic via Substrate framework.

The benchmarks are offered in two flavors:

  • Using the Arkworks upstream curves: in this way the full set of curves arithmetic is built and run in wasm directly by the pallet code.
  • Using the Arkworks Substrate curves: in this way some of the more computationally expensive curves arithmetic operations are delegated to the host to be run at native speed.

Host functions are provided for:

  • Pairings
  • Multi scalar multiplication.
  • Point scalar multiplication.

Benchmarking

You can run the included benchmarks of the Substrate extrinsics on your local machine with:

cargo build -p node-ark-demo --features runtime benchmarks

# List all avaiable benchmarks
./benchmark.sh

# Run all 'ark-pallet' benchmarks
./benchmarks.sh all

# Run a specific benchmark (e.g. 'ed_on_bls12_377_mul_affine_opt')
./benchmarks.sh ed_on_bls12_377_mul_affine_opt

The results are then written in the results/<datetime>/results.csv file.

About

Example implementation of curve arithmetic for the ark-substrate curves

License:MIT No Attribution


Languages

Language:Rust 96.8%Language:Handlebars 2.7%Language:Shell 0.5%