Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new native contract to support ec curve operations and zk-SNARK verification #808

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kunxian-xia
Copy link
Contributor

@kunxian-xia kunxian-xia commented Mar 15, 2019

This new contract has six functions:

  • ECAdd(): add two ec points on the alt_bn128 curve
  • TwistECAdd(): add two ec points on the twist curve
  • ECMul(): scalar multiplication on the alt_bn128 curve
  • TwistECMul(): scalar multiplication on the twist curve
  • PairingCheck(): check if e(a1, b1) ... e(ak, bk) == 1 where ai are points on the alt_bn128 curve and bi are points on the twist curve.
  • PHGR13Verify(vk, proof, input): verify if a proof is a valid PHGR13 zk-SNARKs proof corresponding to the vk.

@Honglei-Cong
Copy link
Member

fixes #810

@Honglei-Cong
Copy link
Member

@kunxian-xia
Is there any project requiring this feature?
If not, suggest to commit to branch shard-common.
What you think? @kunxian-xia @laizy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants