Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Port to bn256 #18

Closed
HarryR opened this issue Nov 21, 2017 · 1 comment
Closed

Port to bn256 #18

HarryR opened this issue Nov 21, 2017 · 1 comment
Assignees

Comments

@HarryR
Copy link
Contributor

HarryR commented Nov 21, 2017

Start with a fork which implements as much as possible in isolation, with code to verify basic correctness and assumptions. Then look into pain points, problems and how to make Orbital support both bn256 and secp256k1.

Then need to create a test transaction which can be used to verify implementation of mobius smart contract when it's ported to bn256.

Import code from:

@HarryR
Copy link
Contributor Author

HarryR commented Nov 22, 2017

The following pieces of code can be used as references for using the Go crypto/bn256 module:

EIP background:

The builtins are something like:

add

bn128add(x1, y1, x2, y2) = (x', y')

input data[]:
two points encoded as (x, y), where x and y are 32-byte left-padded integers,
if input is shorter than expected, it's assumed to be right-padded with zero bytes

output:
resulting point (x', y'), where x and y encoded as 32-byte left-padded integers

mul

bn128mul(x, y, s) = (x', y')

input data[]:
point encoded as (x, y) and scalar s, where x, y and s are 32-byte left-padded integers,
if input is shorter than expected, it's assumed to be right-padded with zero bytes

output:
resulting point (x', y'), where x and y encoded as 32-byte left-padded integers

@HarryR HarryR mentioned this issue Nov 23, 2017
@HarryR HarryR self-assigned this Nov 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant