namecoin-core icon indicating copy to clipboard operation
namecoin-core copied to clipboard

Parent coinbase addresses shouldn't use Namecoin prefix

Open JeremyRand opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe.

The addresses field of the parent coinbase transaction in AuxPoW headers is displayed using Namecoin's prefixes (e.g. a P2PKH address will start with N). This is not really useful for the use cases that I typically have for that data. Usually when I'm processing addresses from the parent coinbase transaction, it's for the purpose of cross-referencing with the parent chain.

Describe the solution you'd like

I'd prefer that the default displayed prefixes for such addresses be based on Bitcoin mainnet (e.g. a P2PKH address will start with 1, and a Bech32 address will start with bc1). It might be reasonable to add an extra optional argument that lets the caller choose what the P2PKH, P2SH, and Bech32 prefixes are, although personally I have no need for that (100% of my usage so far has been with the Bitcoin prefixes; I've never needed it to be Namecoin prefixes or any other parent chain).

Describe alternatives you've considered

At the moment the metrics code I'm developing for Cyphrs is pulling in Electrum-NMC's Python library as dependencies just so I can convert the addreses to Bitcoin form. This is not exactly a desirable dependency to pull in just for that functionality.

Additional context

N/A.

JeremyRand avatar Feb 05 '21 13:02 JeremyRand