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

Change coinbase transaction from P2PK to P2PKH #945

Closed
bitcartel opened this Issue May 19, 2016 · 4 comments

Comments

Projects
None yet
5 participants
@bitcartel
Contributor

bitcartel commented May 19, 2016

The coinbase transaction is currently pay to pubkey (inherited from bitcoind):

https://github.com/zcash/zcash/blob/zc.v0.11.2.latest/src/miner.cpp#L402

Example output from Alpha 3:

"vout" : [
        {
            "value" : 40.00000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "039091ff4d147534477c739bf775cabe1b000eb9f0ef2ac0276559636b51870309 OP_CHECKSIG",
...
                "type" : "pubkey",
                "addresses" : [
                    "motcDxSUuZhhECog8D8AQBR51HbP8EwTHM"

However the trend in Bitcoin has been for miners to use P2PKH as it hides their public key until they are ready to spend their coins. Not leaking this information might be a good idea. More info here:

@bitcartel bitcartel changed the title from Change coinbase transaction from P2PK to P2PKH to Consider changing coinbase transaction from P2PK to P2PKH May 19, 2016

@nathan-at-least

This comment has been minimized.

Contributor

nathan-at-least commented Jun 27, 2016

This doesn't affect consensus in any way, but is just a miner choice, correct? In that case, we won't prioritize this before the 1.0 launch.

@bitcartel

This comment has been minimized.

Contributor

bitcartel commented Jun 27, 2016

Yep, this doesn't affect consensus but miners might expect to see a P2PKH transaction since that is the norm in the Bitcoin world.

@str4d

This comment has been minimized.

Contributor

str4d commented Sep 10, 2016

I would like to reconsider our including this in 1.0, for three reasons:

  • The block explorer does not support viewing P2PK transactions, instead treating them as P2PKH outputs (due to default rendering) and unparseable inputs (when they get spent).
  • The Bitcore patches applied to zcashd do not support indexing P2PK transactions, which has already resulted in numerous user questions about why addresses in the block explorer are empty despite having coinbase sent to them. See this early Bitcoin block vs the corresponding coinbase address to see that it is an upstream issue (and unlikely to be changed, given that Bitcoin Core have dropped their internal miner, and all other transactions are P2PKH).
  • It is a trivial one-line change in miner.cpp (plus adjusting any affected tests), and thus should be considerably less work than patching Bitcore and Insight to support P2PK transactions.
@daira

This comment has been minimized.

Contributor

daira commented Sep 11, 2016

I'm +1 on this.

@nathan-at-least nathan-at-least added this to the 1.0.1 stabilization milestone Sep 12, 2016

@daira daira modified the milestones: 1.0.1 stabilization, Wishlist - Soon After 1.0.1 Oct 18, 2016

str4d added a commit to str4d/zcash that referenced this issue Dec 23, 2016

@str4d str4d modified the milestones: 1.0.5, Wishlist - Soon After 1.0.[Soon] Dec 23, 2016

@str4d str4d added the has PR label Dec 23, 2016

@ebfull ebfull modified the milestones: 1.0.5, 1.0.6 Jan 19, 2017

str4d added a commit to str4d/zcash that referenced this issue Jan 26, 2017

str4d added a commit to str4d/zcash that referenced this issue Jan 27, 2017

str4d added a commit to str4d/zcash that referenced this issue Jan 29, 2017

str4d added a commit to str4d/zcash that referenced this issue Jan 30, 2017

str4d added a commit to str4d/zcash that referenced this issue Feb 6, 2017

zkbot added a commit that referenced this issue Feb 9, 2017

Auto merge of #1965 - str4d:1955-single-address-mining, r=bitcartel
Switch miner to P2PKH, add -mineraddress option

Closes #945 and #1955.

@zkbot zkbot closed this in #1965 Feb 9, 2017

@daira daira changed the title from Consider changing coinbase transaction from P2PK to P2PKH to Change coinbase transaction from P2PK to P2PKH Feb 10, 2017

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