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

Can not build rust-secp256k1 inside CosmWasm contracts #162

Closed
raress96 opened this issue Oct 11, 2024 · 4 comments
Closed

Can not build rust-secp256k1 inside CosmWasm contracts #162

raress96 opened this issue Oct 11, 2024 · 4 comments

Comments

@raress96
Copy link

Hello, as described here rust-bitcoin/rust-secp256k1#748 (comment), it seems that the rust-secp256k1 library can not be built using rust-optimizer when in WASM context.

The library should support running in WASM context, but I am not quite sure where the error could reside...

@chipshort
Copy link
Contributor

Hi, the rust-secp256k1 library uses a C library under the hood, which seems not well supported for the wasm target. Does the crate claim to work for the wasm target?
Does it work if you just build using cargo build --target wasm32-unknown-unknown?

@chipshort
Copy link
Contributor

chipshort commented Oct 11, 2024

Also: Do you have this problem because it's somewhere in your dependency tree or do you want to use the crate directly?
Because if you just need secp256k1, then you can use the corresponding APIs we provide: https://docs.rs/cosmwasm-std/2.1.4/cosmwasm_std/trait.Api.html#tymethod.secp256k1_verify

@raress96
Copy link
Author

Unfortunately it is somewhere in the dependency tree... The library should support other wasm targets, I will have to check exactly what the problem is here.

@chipshort
Copy link
Contributor

While looking at their repo, it looks like they only support wasm32-wasi, not wasm32-unknown-unknown (which is what CosmWasm contracts use), so I'll close here, since it's not an optimizer issue.

@chipshort chipshort closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
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

No branches or pull requests

2 participants