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

No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance #1889

Closed
MadhuraJoshi1 opened this issue Feb 24, 2023 · 1 comment

Comments

@MadhuraJoshi1
Copy link

I am able to get transaction hex to send bitcoins from native segwit address to legacy , nested segwit and native segwit address but when i try to send bitcoin from native segwit to taproot address I am not able to add the outputs.

Here I am trying to add output for taproot address but it throws " No ECC Library provided. You must call initEccLib() with a valid TinySecp256k1Interface instance " error .

psbt.addOutput({
address: tb1p.......,
value: amount
});

@junderw
Copy link
Member

junderw commented Feb 24, 2023

As you can see here:
https://github.com/bitcoinjs/bitcoinjs-lib/blob/v6.1.0/test/integration/taproot.spec.ts#L3-L15

You need to import an ecc library that is compatible with bitcoinjs-lib, and call initEccLib (which is at the root of this library) to load in an ecc library to calculate the address correctly.

If you can't use WASM in your project, then other people have suggested alternative implementations.
#1781 (comment)

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