Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: pakavat on May 31, 2019, 04:09:04 PM



Title: Is there a way to recover those funds? Error is BIP143 rejects uncompressed
Post by: pakavat on May 31, 2019, 04:09:04 PM
I happened to have old WIF for the uncompressed public key.

Then I made a p2sh segwit address out of it, using bitcoinjs v3:

Code:
      let keyPair = bitcoin.ECPair.fromWIF(secret);
      let pubKey = keyPair.getPublicKeyBuffer();
      let witnessScript = bitcoin.script.witnessPubKeyHash.output.encode(bitcoin.crypto.hash160(pubKey));
      let scriptPubKey = bitcoin.script.scriptHash.output.encode(bitcoin.crypto.hash160(witnessScript));
      address = bitcoin.address.fromOutputScript(scriptPubKey);


And sent some bitcoins there.
Now apparently it is unspendable..? Or is there a way to recover those funds?
Error Im getting is BIP143 rejects uncompressed public keys in P2WPKH or P2WSH

Thanks!


Title: Re: Is there a way to recover those funds? Error is BIP143 rejects uncompressed
Post by: HCP on May 31, 2019, 09:46:25 PM
Did you read BIP143?

Restrictions on public key type

As a default policy, only compressed public keys are accepted in P2WPKH and P2WSH. Each public key passed to a sigop inside version 0 witness program must be a compressed key: the first byte MUST be either 0x02 or 0x03, and the size MUST be 33 bytes. Transactions that break this rule will not be relayed or mined by default.

Since this policy is preparation for a future softfork proposal, to avoid potential future funds loss, users MUST NOT use uncompressed keys in version 0 witness programs.

Looks like your coins are stuck... :-\