{"action":"created","issue":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin/issues/319","labels_url":"https://api.github.com/repos/libbitcoin/libbitcoin/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/libbitcoin/libbitcoin/issues/319/comments","events_url":"https://api.github.com/repos/libbitcoin/libbitcoin/issues/319/events","html_url":"https://github.com/libbitcoin/libbitcoin/issues/319","id":107785973,"number":319,"title":"BIP-32 (HD) key encodings insufficient for altchains.","user":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libbitcoin/libbitcoin/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin/milestones/2","html_url":"https://github.com/libbitcoin/libbitcoin/milestones/3.0","labels_url":"https://api.github.com/repos/libbitcoin/libbitcoin/milestones/2/labels","id":1307371,"number":2,"title":"3.0","description":"","creator":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":0,"state":"open","created_at":"2015-09-15T22:15:40Z","updated_at":"2015-09-22T19:39:21Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-09-22T19:39:21Z","updated_at":"2015-09-22T22:40:59Z","closed_at":null,"body":"HD keys have a network prefix that is distinct for public and private keys (for bitcoin mainnet there is `xpub` / `xprv`). There is also a distinction by altchain (for bitcoin testnet there is `tpub` / `tprv`). But when one intends to derive a public from a private there is a presumption that the derived public is on the same network. This requires a coupling of the network versions for the public-private key pairs. This requires external mapping information, which is generally hard-wired into the application.\r\n\r\nTo avoid hard-coding this mapping **libbitcoin** will require that HD private keys are initialized with both prefixes. This can't be derived deterministically because there are multiple altchain implementations in use and they are designed for cosmetic prefixes. The internal prefix tuple will be parameterized as a 64 bit number with high and low 32 bit parts. Defaults will be for `mainnet` (so `testnet` will require parameterization like any other altchain). This allows public and private keys to be derived along the proper chain once the private key is intialized. Public keys are initialized using only the 32 bit public prefix, since they cannot derive private keys.\r\n\r\nThe **bx** command line parameterization will require this combined value, which will also be configurable in default wallet parameters in the config file."},"comment":{"url":"https://api.github.com/repos/libbitcoin/libbitcoin/issues/comments/142441635","html_url":"https://github.com/libbitcoin/libbitcoin/issues/319#issuecomment-142441635","issue_url":"https://api.github.com/repos/libbitcoin/libbitcoin/issues/319","id":142441635,"user":{"login":"evoskuil","id":1369335,"avatar_url":"https://avatars.githubusercontent.com/u/1369335?v=3","gravatar_id":"","url":"https://api.github.com/users/evoskuil","html_url":"https://github.com/evoskuil","followers_url":"https://api.github.com/users/evoskuil/followers","following_url":"https://api.github.com/users/evoskuil/following{/other_user}","gists_url":"https://api.github.com/users/evoskuil/gists{/gist_id}","starred_url":"https://api.github.com/users/evoskuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evoskuil/subscriptions","organizations_url":"https://api.github.com/users/evoskuil/orgs","repos_url":"https://api.github.com/users/evoskuil/repos","events_url":"https://api.github.com/users/evoskuil/events{/privacy}","received_events_url":"https://api.github.com/users/evoskuil/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T22:40:59Z","updated_at":"2015-09-22T22:40:59Z","body":"I don't necessarily disagree, but then of course something may need to be done about [this](http://bitcoin.stackexchange.com/questions/28380/i-want-to-generate-a-bip32-version-number-for-namecoin-and-other-altcoins)... because what you are saying implies hard-coding the two prefixes.\r\n\r\n\r\n"}}