-
Notifications
You must be signed in to change notification settings - Fork 635
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
Create near-crypto crate that can be compiled for wasm32 #7137
Comments
This needs some design work: So, what we need here is probably to create a separate crate, This probably wants to be on dev-platform's plate, cc @austinabell |
That being said, Note that this won't be ideal situation for the consumers:
|
Anyone would be able to write this library, it has no dependencies on anything to change here. Is the ask that this be done in such a way that it's plugged into our tools somehow and therefore made sure to be maintained? Is there something else that I'm missing that would be valuable for us to take action on? But yes definitely agree this isn't on nearcore/core team if we build this lib |
There are two points here:
For specifically crypto library, there is randomness used in:
All of these can be wrapped with "rand" or "node" feature of this module. |
tasty |
https://github.com/CosmWasm/drand-verify
|
I don't think any of the developer platform teams has time for this right now. @ijerkovic do you want to work on this yourself? We can certainly help review the pull requests. |
From the side of Calimero, we should be good enough with the NEP-364 which will add both |
wen ? |
@sascha1337 I am not sure how urgent you need this feature. I created a NEAR SDK that works on browser. However, it is not stable. I built for developing dapp with dioxus (Web UI framework). Here is the SDK https://github.com/russellwmy/web3-anywhere. @matklad I mentioned in #6387. |
@russellwmy I would love to hear more, however for us this is currently low priority since we managed to make our contracts work with minimal copy/pasted signature verify code from https://github.com/near/nearcore/blob/4b055712e478675e9b05095f9191c9ba8bfa4022/core/crypto/src/signature.rs All our efforts are currently at testing and preparing bridge contracts for audit, but we can meet and talk about it. |
@russellwmy . I would love to talk about it. What is the best way to contact you? |
@ijerkovic & @nearmax https://calendly.com/d/d2c-w49-fry/30-minute-meeting?month=2022-10 |
We do have a EDIT: Ah, never mind, I didn't read the original issue statement closely enough. |
Did this before quite easy |
We tried including near-crypto as a dependency for our light client contract but we get an error when compiling for wasm32.
This is the error:
the wasm32-unknown-unknown target is not supported by default, you may need to enable the "js" feature. For more information see: [https://docs.rs/getrandom/#webassembly-support](https://www.google.com/url?q=https://docs.rs/getrandom/%23webassembly-support&sa=D&source=docs&ust=1656515658320773&usg=AOvVaw1OyQqyRsfwq8cHsQw1O_c2)
We need the near-crypto for verifying Ed25519 and SECP256k1 signatures.
While we did manage to make signature verifying work in our contract and compile for wasm32 by taking
ed25519-dalek
andlibsecp256k1
crates, it would be great if there existed a wasm32 friendly crate for near-crypto.Also for reference here is how we made it work for us (notice we had to include few versions of random as dev-dependencies):
The text was updated successfully, but these errors were encountered: