-
Notifications
You must be signed in to change notification settings - Fork 334
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
Conversation
- Prefix 38 (G) for P2PKH. - Prefix 90 (d) for P2SH.
@h4x3rotab any reason to use |
src/chainparams.cpp
Outdated
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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"
Same letter might be a bit confusing. |
Also fixed unit tests.
Usage: `bgold-cli -testnet=false -convertaddress=<address>`
FYI, see simple conversion (and BIP32 wallets) tool: https://github.com/Ayms/bitcoin-wallets#use---convert-bitcoin-addresses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1
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! |
Private key remains the same. |
#**** |
There was a problem hiding this 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()); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
bgold-cli -testnet=false -convertaddress=<old-address>
Status: