hello everyone , I’m developing ethereum lightclient on ICP, I need verify the signature of ethereum commutee on consensus. so I import the ic_bls12_381 for it. then I can compile the canister . but when i extract the did file, I got a error:
Error: unknown import: __wbindgen_placeholder__::__wbindgen_describe has not been defined
The ic_bls12_381 canister was created for use within the IC replicas, we (at least on the cryptography team) have not tested it in canisters at all. The crate is pure Rust so I’m not sure what the problem might be in terms of compiling it for webassembly.
I was reminded that we do use ic_bls12_381 in a couple of canisters such as VetKD API mock canister, without any apparent problems. Can you post some kind of minimal example that replicates the problem you’re seeing?
when I import this:
use ic_bls12_381::{
hash_to_curve::{ExpandMsgXmd, HashToCurve},
multi_miller_loop, G1Affine, G1Projective, G2Affine, G2Prepared, G2Projective, Gt, Scalar,
};
I got the error above
Here is an example canister which has similar imports
This compiles without issue, so I imagine there is something else going on. I would need more details, ideally a repository with a full reproducing testcase, in order to assist.
It’s probably that ic_bls12_381 has some optional dependency that depends on the getrandom crate.
In the example canister from Jack above, the crate only turns on the experimentalfeature instead of turning on all default features.
Could you try if you can do the same thing in your project?
If the getrandom dependency is inevitable, you can try the solution here.