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

VIP: Add support for Alt_Bn128 precompile curve operations #1650

Open
fubuloubu opened this issue Oct 24, 2019 · 1 comment
Open

VIP: Add support for Alt_Bn128 precompile curve operations #1650

fubuloubu opened this issue Oct 24, 2019 · 1 comment

Comments

@fubuloubu
Copy link
Member

Simple Summary

Add support for precompiled opcode for alt_bn128 pairing calculation

Motivation

We already have support for ecadd and ecmul which perform the corresponding alt_bn128 curve operations (and which should perhaps be renamed to bn128_ecadd and bn128_ecmul), but we do not have support for bn128 pairing operations, which allows the verification of Zero-Knowledge proofs using the alt-bn128 curve, such as in zk-SNARK implementations. This would allow ZKP verifier contracts to be created in Vyper (such as the ones ZoKrates can create).

Specification

alt-bn128 elliptic curve pairing operations were already added as of Byzantium via EIP-197 (with gas costs to be updated in Istanbul via EIP-1108). A reference implementation is provided here: https://github.com/ethereum/py-evm/blob/master/eth/precompiles/ecpairing.py

Backwards Compatibility

No backwards incompatibilities

Dependencies

No dependencies

Copyright

Copyright and related rights waived via CC0

@fubuloubu
Copy link
Member Author

Note: might be best to add the gas cost change via #1230 ruleset switch so it tracks appropiately under both Istanbul and pre-Istanbul rules

@fubuloubu fubuloubu changed the title Add support for Alt_Bn128 precompile curve operations VIP: Add support for Alt_Bn128 precompile curve operations Oct 27, 2019
@fubuloubu fubuloubu added the VIP: Approved VIP Approved label Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant