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

ecc library invalid #136

Open
bucko13 opened this issue May 3, 2024 · 0 comments · May be fixed by #137
Open

ecc library invalid #136

bucko13 opened this issue May 3, 2024 · 0 comments · May be fixed by #137

Comments

@bucko13
Copy link

bucko13 commented May 3, 2024

I'm trying to use this to init bitcoinjs-lib. When running in a test (see #62) I get an error : ecc library invalid.

Versions:

tiny-secp256k1@2.2.3
bitcoinjs-lib@6.1.5

When digging in to this a little, I was able to get the validation to pass by changing the isUint8Array function. If that becomes a no_op then the rest of the validations pass. If I change it to:

function isUint8Array(value) {
    return value instanceof Buffer
}

it passes.

It's possible there's some weird polyfill going on in my environment which is why it's passing for some and not others. That said, when looking at the validation in bitcoinjs-lib (which maybe this should be filed there?) it does convert a point hex to a Buffer but then the validation library here checks to see if it's an instance of Uint8Array.

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

Successfully merging a pull request may close this issue.

1 participant