"2" address unexpectedly changed to "m" address in Testnet #17616

issue wilsonpc opened this issue on November 26, 2019
  1. wilsonpc commented at 7:22 PM on November 26, 2019: none

    Using Bitcoin Core 0.18

    Testing a change I made to my local NOMP pool software.

    • My Bitcoin Core bitcoin-cli getnewaddress gave me the address that NOMP used to communicate with the Bitcoin Test Network (2N5tv3gJzBD1zZ2hri2ffYbHsm1AEhpNQFz);
    • I began mining;
    • I found 6 blocks, but at the heights found, instead of having my "2" address, it showed all were found by the (random?) "m" address in the link below:

    Found these blocks on Testnet (other transactions shown are test transactions with faucet coins)

    I have no idea where this "m" address came from or how or why it "changed" from my "2" address; it doesn't belong to my Bitcoin Core wallet and I have no access to the funds (not an issue but it would be nice to return faucet coins).

    Concern is whether something like this can occur on Mainnet.

  2. sipa commented at 7:24 PM on November 26, 2019: member

    This looks like whatever software interpreted the address does not support P2SH addresses, and even worse, treats them like P2PKH addresses (ignoring its version byte). This is potentially a serious bug, but I doubt it's related to Bitcoin Core.

  3. wilsonpc commented at 7:38 PM on November 26, 2019: none

    treats them like P2PKH addresses (ignoring its version byte) @sipa Please tell me what about the situation made you say the version byte might be ignored

    Also, when I used an "m" address for the pool address, everything worked fine and funds found their way to my wallet.

    In checking, I see that version in the block header is 0100. Is a "2" address allowed with version 1? If the pool software changed the address, I would expect that it would be a wallet address. I'll dig through some code. If a P2SH address is not allowed with version 1, what does Bitcoin Core do? Change it? Unlikely but it might.

  4. sipa commented at 8:21 PM on November 26, 2019: member

    Something (NOMP?) accepted a P2SH address (which was created by Bitcoin Core), but apparently interpreted it as a P2PKH address. This is a bug I've seen before in custom, undertested software. The symptom is that you see a transaction to a seemingly unrelated P2PKH address, which seems to be what is happening here.

    The rest of your questions make no sense: the "2" in the address is the (encoding of) the version number. Nothing is allowed to change it. Doing so will cause loss of funds.

  5. wilsonpc commented at 8:46 PM on November 26, 2019: none

    Thanks. I misunderstood/misread your reference to version byte. When I saw your comment it stood out because I previously noticed that the 4-byte version number in the block header was a 1 and I was wondering whether that was incompatible with a P2SH address. I now see that you were referring to the address version byte.

  6. sipa commented at 9:47 PM on November 26, 2019: member

    Oh, yes, the address version byte, sorry!

  7. laanwj added the label Questions and Help on Nov 27, 2019
  8. wilsonpc commented at 2:44 PM on November 27, 2019: none

    I found the same or very similar issue reported 4 times in other NOMP forks, so I agree that this is not related to Bitcoin Core. Thanks for your help

  9. wilsonpc closed this on Nov 27, 2019

  10. MarcoFalke locked this on Dec 16, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me