liquality / chainify

Blockchain abstraction layer
https://liquality.io
MIT License
220 stars 78 forks source link

Support for lowR in BitcoinJsWalletProvider #392

Open matthewjablack opened 3 years ago

matthewjablack commented 3 years ago

bitcoinjs-lib added the ability to always have low R values during transaction creation: https://github.com/bitcoinjs/bitcoinjs-lib/pull/1442

This means signature size is at most 71 bytes, and maxWitnessLen goes from 108 to 107

It also has other benefits, such as saving several bytes on txs for multisigs: https://github.com/bitcoinjs/bitcoinjs-lib/issues/1175#issuecomment-471114180

Would be great if there were a way to force low R values during transaction creation, or default to this for CAL.

matthewjablack commented 3 years ago

This could be as simple as modifying the lowR value in ECPair class when returning keyPair from BitcoinJsWalletProvider: https://github.com/bitcoinjs/bitcoinjs-lib/blob/533d6c2e6d0aa4111f7948b1c12003cf6ef83137/src/ecpair.js#L19

kraikov commented 2 years ago

@monokh any actions here?