question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BIP143 rejects uncompressed public keys in P2WPKH or P2WSH

See original GitHub issue

Not sure if I am misunderstanding something here but does this not only check if the output is p2wpkh and not p2wsh as well?

i.e. is correct?

if (kpPubKey.length !== 33 &&
      (input.signType === scriptTypes.P2WPKH || input.signType === scriptTypes.P2WSH)) throw new Error('BIP143 rejects uncompressed public keys in P2WPKH or P2WSH')

https://github.com/bitcoinjs/bitcoinjs-lib/blob/86cd4a44a1524686d993f35b02a1ed331aaa551f/src/transaction_builder.js#L709

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dabura667commented, Jan 16, 2018

I think what he means is:

Segwit enforces compressed public keys for ALL instances of pubkeys in the witness stack. Multisig and single sig.

His question is: It looks like this one line is only checking for single sig. allowing multisig segwit with uncompressed pubkeys to pass and make an invalid transaction. Is he right in his assessment that this is a bug, or are we checking somewhere else and he doesn’t notice it?

0reactions
dcousenscommented, Jan 17, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to recover those funds? Error is BIP143 rejects ...
I happened to have old WIF for the uncompressed public key. ... Im getting is BIP143 rejects uncompressed public keys in P2WPKH or...
Read more >
bitcoinbook/ch07.asciidoc at develop
Multisignature scripts set a condition where N public keys are recorded in the ... uncompressed public key to a P2WPKH witness script.
Read more >
Segregated Witness Wallet Development Guide - Bitcoin Core
P2SH-P2WPKH uses the same public key format as P2PKH, with a very important exception: the public key used in P2SH-P2WPKH MUST be compressed,...
Read more >
Chapter 7: 'Advanced Transactions and Scripting' · GitBook
Uncompressed public keys are nonstandard in segwit and may be explicitly disabled by a future soft fork. If the hash used in the...
Read more >
getting public key from any raw transaction - what to take care ...
i need to retrieve public key of transaction sender. now i know there are 03 compressed pubkeys and 04 uncompressed ones. but how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found