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

High performance ECDH #737

Closed
dcousens opened this issue Dec 17, 2016 · 2 comments
Closed

High performance ECDH #737

dcousens opened this issue Dec 17, 2016 · 2 comments

Comments

@dcousens
Copy link
Contributor

ecurve is slow, but battle tested.

Related #350
#623
#459
#508
#407

@dcousens
Copy link
Contributor Author

dcousens commented Nov 28, 2017

bip32 will be using the secp256k1 library on release (soon)... but I haven't yet finalized an ECC API that I am happy with in bitcoinjs-lib itself.

We want to move to secp256k1 before Christmas 😄 .

I like the idea of keeping the .sign() object function so that users can swap in whatever library they need with abstractions like TransactionBuilder etc.
But, in ECPair, with getAddress gone, the utility of the abtraction has dropped to near zero.

I don't want to pass a Buffer(Length: 32) private key to TransactionBuilder.prototype.sign though... so what should we do?

An idea was to leave it entirely up to the user:

let keyPair = ECPair.makeRandom()

// ...
txb.sign(i, SIGHASH_ALL, function (hash) {
   return keyPair.sign(hash) // returns 64 bytes R|S encoded
})

Where we can offer a easy-sauce secp256k1 compatible ECPair abstraction that provides .sign etc as available now, and then users who don't use that can simply do whatever they want, provided they return a 64-byte R|S encoded signature.

@dcousens
Copy link
Contributor Author

dcousens commented Apr 30, 2018

Closing in favour of #1048, #1045 and #1049 (and #1046)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants