expose secp256k1_ec_pubkey_combine
madeken opened this issue · comments
One missing functionality I am missing from this library is the ability to combine multiple public keys. This is provided by libsecp256k1 with secp256k1_ec_pubkey_combine.
I will be interested to in that feature, is there somewhere some kind of guidelines on how to do that addition?
I nearly implemented that feature but I fall upon that problem : instance.exports._secp256k1_ec_pubkey_combine is not a function
.
The thing is, I am sure that this method should exist as it is there .
How could I verify its presence in what bitcoin-ts calls?
My implementations follows what that merge request did, and the error comes from that part in src/lib/bin/secp256k1/secp256k1Wasm.ts :
pubkeyCombine: (
contextPtr,
publicKeyPtr,
otherPublicKeyPtr
) =>
instance.exports._secp256k1_ec_pubkey_combine(
contextPtr,
publicKeyPtr,
otherPublicKeyPtr,
)
Some implementations already use it too
Did you by any chance forget to add it to:
By the looks of it, you need to explicitly list each function to export
There was a typo there, thank you !
I am now stuck with some malloc
problems. I think it is due to that special argument that the C asks for :
const secp256k1_pubkey * const *pubnonces
.
I have trouble sending something similar from the JS.
I found a way to resolve that special argument. But now I got a Source is too large problem
.
If you are interested in helping me out, check my fork out. My midifcations are on the feature/publicKey_combine
branch.
I'll add my modifications there !
Solved now by a number of other libraries 👍