Skip to content
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 mainnet address version. #80

Merged
merged 5 commits into from
Oct 28, 2017
Merged

Conversation

h4x3rotab
Copy link
Member

@h4x3rotab h4x3rotab commented Oct 24, 2017

  • Prefix 38 (G) for P2PKH.
  • Prefix 23 (A) for P2SH.
  • Convert tool: bgold-cli -testnet=false -convertaddress=<old-address>

Status:

  • Change format version for mainnet.
  • All test cases
  • Tool to convert addresses from old to new format.

- Prefix 38 (G) for P2PKH.
- Prefix 90 (d) for P2SH.
@leto
Copy link
Contributor

leto commented Oct 24, 2017

@h4x3rotab any reason to use d instead of g which I think would be more intuitive for users. Is that already taken by something?

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,0);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,38); // prefix: G
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,90); // prefix: d
Copy link
Collaborator

Choose a reason for hiding this comment

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

Better to use both capital letters

Copy link

Choose a reason for hiding this comment

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

Actually, as was offered by h4x3rotab, G and g could be used, anyone who has met bitcoin notices that the address is written in different registers, not a big deal if it will be same letter, because users copy-paste them. Many users still didn't understand difference between 1 and 3. Maybe you can consider A (decimal -> 23) as the title referenced to Aurum (gold in periodic table of element).

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to "G" and "A"

@h4x3rotab
Copy link
Member Author

@h4x3rotab any reason to use d instead of g which I think would be more intuitive for users. Is that already taken by something?

Same letter might be a bit confusing.

Also fixed unit tests.
@h4x3rotab h4x3rotab mentioned this pull request Oct 26, 2017
@h4x3rotab h4x3rotab merged commit 7a2c74d into BTCGPU:master Oct 28, 2017
@h4x3rotab h4x3rotab changed the title [WIP] Change mainnet address version. Change mainnet address version. Oct 28, 2017
@Ayms
Copy link

Ayms commented Oct 30, 2017

FYI, see simple conversion (and BIP32 wallets) tool: https://github.com/Ayms/bitcoin-wallets#use---convert-bitcoin-addresses

Copy link

@wizzfile wizzfile left a comment

Choose a reason for hiding this comment

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

1

@MEEMxyz
Copy link

MEEMxyz commented Nov 10, 2017

Doubt: So, I have converted my BTC address to a the BTG address format successfully.

How about the private key? I tried the same command and it did not work... or that one remains exactly the same?

Thanks!

@idemin
Copy link

idemin commented Nov 10, 2017

Private key remains the same.

@sexyjono
Copy link

sexyjono commented Mar 1, 2020

#****

Copy link

@wizzfile wizzfile left a comment

Choose a reason for hiding this comment

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

l

bool operator()(const CNoDestination& no) const { return false; }
};

} // namespace

bool CBitcoinAddress::Set(const CKeyID& id)
{
SetData(Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS), &id, 20);
return true;
return Set(id, Params());

Choose a reason for hiding this comment

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

return Set(id, Params());

bool operator()(const CKeyID& id) const { return addr->Set(id); }
bool operator()(const CScriptID& id) const { return addr->Set(id); }
bool operator()(const CKeyID& id) const { return addr->Set(id, params); }
bool operator()(const CScriptID& id) const { return addr->Set(id, params); }
bool operator()(const CNoDestination& no) const { return false; }
};

} // namespace

bool CBitcoinAddress::Set(const CKeyID& id)

Choose a reason for hiding this comment

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

bool CBitcoinAddress::Set(const CKeyID& id)

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.

None yet

10 participants