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

Implement safe APIs for bn128 APIs #644

Open
austinabell opened this issue Nov 24, 2021 · 7 comments
Open

Implement safe APIs for bn128 APIs #644

austinabell opened this issue Nov 24, 2021 · 7 comments

Comments

@austinabell
Copy link
Contributor

austinabell commented Nov 24, 2021

Similar to #642, not really sure there is a strong use case for this so I wouldn't jump into this yet, just adding the issue for tracking. bn128 is pairing cryptography used in zk proofs in ethereum. I assume these syscalls were added since they are precompiles for Ethereum and needed for Aurora, but I'm sure we can create an API that makes this consumable outside of this context!

I have no idea what this API would look like, whether it's a thin wrapper around the syscall or not. Open to ideas or thoughts.

@austinabell
Copy link
Contributor Author

Related, but now out of date implementation #188

The API added in this is very low level, and we might want to have a higher-level abstraction for zk proofs. Or maybe we stay unopinionated and let libraries be built on top of this interface.

(Would be nice to get Igor's input on this, but I don't know his github username to tag him)

@itegulov
Copy link
Contributor

itegulov commented Mar 9, 2022

@austinabell are you talking about Igor Gulamov? If so, I believe he is the original author of #188

@austinabell
Copy link
Contributor Author

@austinabell are you talking about Igor Gulamov? If so, I believe he is the original author of #188

Nope, Igor that just joined and is working on zk

@PandaRR007
Copy link

PandaRR007 commented May 19, 2022

I see bn128 APIs are supported in nearcore and near-sdk-js with nightly feature, but not in near-sdk-rs. We need this feature in our rust contract, and I think more and more projects need it. Is there any plan to implement these APIs in near-sdk-rs recently? Will it be supported in next release? Thanks.

@austinabell
Copy link
Contributor Author

We will add higher-level APIs once the protocol change is upgraded on mainnet. The plan for the host function is to come in the next protocol upgrade (not this upcoming one that will happen on Tuesday).

The host function definition exists in near-sys currently which is accessible from the SDK or by itself, so anyone is able to easily create an API on top of this externally.

It's not quite clear what this API looks like to be helpful in a general use case.

@PandaRR007
Copy link

Got it, thanks @austinabell .

@frol
Copy link
Collaborator

frol commented Jun 28, 2023

FYI, we exposed raw alt_bn128 methods in #1028. There is no high-level API for it yet, so this issue should not be closed, but I don't think it is a priority for near-sdk-rs team as none of us have experience with these APIs to design nice safe APIs.

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

4 participants