Skip to content

chainec/dcrec: Remove hybrid pubkey support#1155

Merged
davecgh merged 2 commits intodecred:masterfrom
jrick:nohybrids_ec
Mar 22, 2018
Merged

chainec/dcrec: Remove hybrid pubkey support#1155
davecgh merged 2 commits intodecred:masterfrom
jrick:nohybrids_ec

Conversation

@jrick
Copy link
Copy Markdown
Member

@jrick jrick commented Mar 20, 2018

Requires #1154

This is a follow-up to a previous change which removed the ability to
create a dcrutil.Address from a hybrid pubkey. It removes all
secp256k1 hybrid pubkey support from the chainec/dcrec packages since
these pubkeys are not usable when evaluated by OP_CHECKSIG or
OP_CHECKMULTISIG.

While ParsePubKey is called by consensus code and its behavior has
been changed to error when encountering a hybrid secp256k1 pubkey,
this is not a consensus change as every use of ParsePubKey in
consensus code either checks beforehand that the pubkey is compressed
or uncompressed, requires a parsed address to be P2PKH or P2SH, or
checks an address string against the premine ledger (which only
contains P2PKH addresses).

jrick added 2 commits March 20, 2018 17:44
Hybrid pubkeys, which are a relic of OpenSSL used in Bitcoin Core, are
not usable with OP_CHECKSIG and we can potentially prevent creating
unspendable outputs by never allowing the creation of P2PK (or derived
P2PKH) addresses for these pubkeys.
This is a follow-up to a previous change which removed the ability to
create a dcrutil.Address from a hybrid pubkey.  It removes all
secp256k1 hybrid pubkey support from the chainec/dcrec packages since
these pubkeys are not usable when evaluated by OP_CHECKSIG or
OP_CHECKMULTISIG.

While ParsePubKey is called by consensus code and its behavior has
been changed to error when encountering a hybrid secp256k1 pubkey,
this is not a consensus change as every use of ParsePubKey in
consensus code either checks beforehand that the pubkey is compressed
or uncompressed, requires a parsed address to be P2PKH or P2SH, or
checks an address string against the premine ledger (which only
contains P2PKH addresses).
Copy link
Copy Markdown
Member

@dajohi dajohi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@jrick jrick requested a review from davecgh March 20, 2018 22:55
@davecgh davecgh merged commit e944bad into decred:master Mar 22, 2018
@jrick jrick deleted the nohybrids_ec branch March 22, 2018 01:56
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 this pull request may close these issues.

3 participants