bip32, bip43, bip44 initial commit

pull/137/head
Andreas M. Antonopoulos 10 years ago
parent 7a4539732a
commit 51c319c54c

@ -462,9 +462,10 @@ Another method for making keys is _deterministic key generation_. Here you deriv
Wallets contain keys, not coins. The coins are stored on the blockchain in the form of transaction-outputs (often noted as _vout_ or _txout_). Each user has a wallet containing keys. Wallets are really keychains containing pairs of private/public keys (See <<public key>>). Users sign transactions with the keys, thereby proving they own the transaction outputs (their coins).
====
[[random wallet]]
==== Non-Deterministic (Random) Wallets
In the first implementations of bitcoin clients, wallets were simply collections of randomly generated private keys. The types of wallets are called _Type-0 Non-Deterministic Wallets_. For example, the Bitcoin Core Client pre-generates 100 random private keys when first started and generates more keys as needed, trying to use each key only once. This type of wallet is nicknamed "Just a Bunch Of Keys", or JBOK, and such wallets are being replaced with deterministic wallets because they are cumbersome to manage, backup and import. The disadvantage of random keys is that if you generate many of them you must keep copies of all of them, meaning that the wallet must be backed-up frequently. Each key must be backed-up, or the funds it controls are irrevocably lost if the wallet becomes inaccessible. This conflicts directly with the principle of avoiding address re-use, by using each bitcoin address for only one transaction. Address re-use reduces privacy by associating multiple transactions and addresses with each other. A Type-0 non-deterministic wallet is a poor choice of wallet, especially if you want to avoid address re-use as that means managing many keys, which creates the need for very frequent backups. The Bitcoin Core Client includes a wallet that is implemented as a Type-0 wallet, but the use of this wallet is actively discouraged by the Bitcoin Core developers.
In the first implementations of bitcoin clients, wallets were simply collections of randomly generated private keys. This type of wallet is called a _Type-0 Non-Deterministic Wallets_. For example, the Bitcoin Core Client pre-generates 100 random private keys when first started and generates more keys as needed, using each key only once. This type of wallet is nicknamed "Just a Bunch Of Keys", or JBOK, and such wallets are being replaced with deterministic wallets because they are cumbersome to manage, backup and import. The disadvantage of random keys is that if you generate many of them you must keep copies of all of them, meaning that the wallet must be backed-up frequently. Each key must be backed-up, or the funds it controls are irrevocably lost if the wallet becomes inaccessible. This conflicts directly with the principle of avoiding address re-use, by using each bitcoin address for only one transaction. Address re-use reduces privacy by associating multiple transactions and addresses with each other. A Type-0 non-deterministic wallet is a poor choice of wallet, especially if you want to avoid address re-use as that means managing many keys, which creates the need for frequent backups. While the Bitcoin Core Client includes a wallet that is implemented as a Type-0 wallet, the use of this wallet is actively discouraged by developers of the Bitcoin Core.
[[Type0_wallet]]
.Type-0 Non-Deterministic (Random) Wallet: A Collection of Randomly Generated Keys
@ -474,7 +475,8 @@ image::images/non-deterministic_wallet.png["non-deterministic wallet"]
Deterministic, or "seeded" wallets are wallets that contain private keys which are all derived from a common seed, through the use of a one-way hash function. The seed is a randomly generated number which is combined with other data, such as an index number or "chain code" (see <<hd_wallets>>) to derive the private keys. In a deterministic wallet, the seed is sufficient to recover all the derived keys and therefore a single backup at creation time is sufficient. The seed is also sufficient for a wallet export or import, allowing for easy migration of all the user's keys between different wallet implementations.
==== Mnemonic Code Words (DRAFT:BIP0039)
[[mnemonic_code_words]]
==== Mnemonic Code Words
Mnemonic codes are English word sequences that represent (encode) a random number used as a seed to derive a deterministic wallet. The sequence of words is sufficient to re-create the seed and from there re-create the wallet and all the derived keys. A wallet application that implements deterministic wallets with mnemonic code will show the user a sequence of 12-24 words when first creating a wallet. That sequence of words is the wallet backup and can be used to recover and re-create all the keys in the same or any compatible wallet application. Mnemonic code words make it easier for users to back up wallets, as they are easy to read and correctly transcribe, as compared to a random sequence of numbers.
@ -520,19 +522,157 @@ luggage oxygen faint major edit measure invite love trap field dilemma oblige
fcf473bee22fce540af281bf7cdeade0dd2c1c795bd02f1e4049e205a0158906c343
|=======
==== Deterministic Chains (Electrum Key Chains)
[[Type1_wallet]]
.Type-1 Deterministic Wallet: A Chain of Keys Generated from a Seed
image::images/chained_wallet.png["chained wallet"]
[[hd_wallets]]
==== Deterministic Trees (BIP0032)
==== Hierarchical Deterministic Wallets (BIP0032/BIP0044)
Deterministic wallets were developed to make it easy to derive many keys from a single "seed". The most advanced form of deterministic wallets is the _Hierarchical Deterministic Wallet_ or _HD Wallet_ defined by the BIP0032 standard. Hierarchical deterministic wallets contain keys derived in a tree structure, such that a parent key can derive a sequence of children keys, each of which can derive a sequence of grandchildren keys and so on to an infinite depth. This tree structure is illustrated below:
[[Type2_wallet]]
.Type-2 Hierarchical Deterministic Wallet: A Tree of Keys Generated from a Seed
image::images/HD_wallet.png["HD wallet"]
[TIP]
====
If you are implementing a bitcoin wallet, it should be built as an HD wallet following the BIP0032 and BIP0044 standards.
====
HD wallets offer two major advantages over random (non-deterministic) keys. First, the tree structure can be used to express additional organizational meaning, such as when a specific branch of sub-keys is used to receive incoming payments and a different branch is used to receive change from outgoing payments. Branches of keys can also be used in a corporate setting, allocating different branches to departments, subsidiaries, specific functions or accounting categories.
The second advantage of HD wallets is that users can create a sequence of public keys without having access to the corresponding private keys. This allows HD wallets to be used on an insecure server or in a receive-only capacity, issuing a different public key for each transaction. The public keys do not need to be pre-loaded or derived in advance, yet the server doesn't have the private keys that can spend the funds.
===== Creating an HD wallet from a seed
HD wallets are created from a single _root seed_, which is a 128, 256 or 512 bit random number. Everything else in the HD wallet is deterministically derived from this root seed, which makes it possible to re-create the entire HD wallet from that seed in any compatible HD wallet. This makes it easy to backup, restore, export and import HD wallets containing thousands or even millions of keys by simply transferring only the root seed. The root seed is most often represented by a _mnemonic word sequence_, as described in the previous section <<mnemonic_code_words>>, to make it easier for people to transcribe and store it.
The process of creating the master keys and master chain code for an HD wallet is shown below:
[[HDWalletFromSeed]]
.Hierarchical Deterministic Wallet: Creating master keys and chain code from a root seed
image::images/HDWalletFromRootSeed.svg["HDWalletFromRootSeed"]
The root seed is input into the HMAC-SHA512 algorithm and the resulting hash is used to create a _master private key_ (m) and a _master chain code_. The master private key (m) then generates a corresponding master public key (M), using the normal elliptic curve multiplication process +m * G+ that we saw previously in this chapter. The chain code is used to introduce entropy in the function that creates child keys from parent keys, as we will see in the next section.
===== Deriving child private keys
Hierarchical Deterministic wallets use a _child key derivation_ (CKD) function to derive children keys from parent keys.
The child key derivation functions are based on one-way hash functions that combines:
* A parent private or public key (ECDSA uncompressed key)
* A seed called a chain code (256 bits)
* An index number (32 bits)
The chain code is used to introduce seemingly random data to the process, so that the index is not sufficient to derive other child keys. Thus, having a child key does not make it possible to find its siblings, unless you also have the chain code. The initial chain code seed (at the root of the tree) is made from random data, while subsequent chain codes are derived from each parent chain code.
These three items are combined and hashed to generate children keys, as follows:
The parent public key, chain code and the index number are combined and hashed with the HMAC-SHA512 algorithm to produce a 512 bit hash. The resulting hash is split into two halfs. The right-half 256 bits of the hash output become the chain code for the child. The left-half 256 bits of the hash and the index number are added to the parent private key to produce the child private key. In the diagram below, we see this illustrated with the index set to 0 to produce the 0'th (first by index) child of the parent.
[[CKDpriv]]
.Hierarchical Deterministic Wallet: Extending a parent private key to create a child private key
image::images/ChildPrivateDerivation.svg["ChildPrivateDerivation"]
Changing the index allows us to extend the parent and create the other children in the sequence, e.g. Child 0, Child 1, Child 2 etc. Each parent key can have 2 billion children keys.
Repeating the process one level down the tree, each child can become a parent and in combination with the child chain code and an index can create it's own children, in an infinite number of generations.
===== Using derived child keys
Child private keys are indistinguishable from non-deterministic (random) keys. Because the derivation function is a one way function, the child key cannot be used to find the parent key. The child key can also not be used to find any siblings. If you have the n~th~ child, you cannot find its siblings, such as the n-1 child or the n+1 child, or any other children that are part of the sequence. Only the parent key and chain code can derive all the children. Without the child chain code, the child key cannot be used to derive any grandchildren either. You need both the child private key and the child chain code to start a new branch and derive grandchildren.
So what can the child private key be used for, on its own? It can be used to make a public key and a bitcoin address. Then, it can be used to sign transactions to spend anything paid to that address.
[TIP]
====
A child private key, the corresponding public key and the bitcoin address are all indistinguishable from keys and addresses created randomly. The fact that they are part of a sequence is not visible, outside of the HD wallet function that created them. Once created, they operate exactly as "normal" keys.
====
===== Extended keys
As we saw above, the key derivation function can be used to create children at any level of the tree, based on the three inputs: a key, a chain code and the index of the desired child. The two essential ingredients are the key and chain code and combined these are called an _extended key_. The term "extended key" could also be thought of as "extensible key" because such a key can be used to derive children.
Extended keys are stored and represented simply as the concatenation of the 256 bit key and 256 bit chain code into a 512 bit sequence. There are two types of extended keys: An extended private key is the combination of a private key and chain code and can be used to derive child private keys (and from them, child public keys). An extended public key is a public key and chain code, which can be used to create child public keys, as described in <<public_key_derivation>>.
Think of an extended key as the root of a branch in the tree structure of the HD wallet. With the root of the branch, you can derive the rest of the branch. The extended private key can create a complete branch, whereas the extended public key can only create a branch of public keys.
[TIP]
====
An extended key consists of a key and chain code and is the root of one of the branches in an HD wallet tree structure. With an extended key you can derive all the nodes in that branch.
====
[[public_key_derivation]]
===== Deriving child public keys
As mentioned above, a very useful characteristic of hierarchical deterministic wallets is the ability to derive public child keys from public parent keys, _without_ having the private keys. A child public key derived directly from the parent public key is exactly the same as if you first derived the child private key from the parent private key and then computed the child public key corresponding to it.
An extended public key can be used, therefore, to derive all of the _public_ keys (and only the public keys) in that branch of the HD wallet structure.
This shortcut can be used to create very secure public-key-only deployments where a server or application has a copy of an extended public key and no private keys whatsoever. That kind of deployment can produce an infinite number of public keys and bitcoin addresses but cannot spend any of the money sent to those addresses. Meanwhile, on another more secure server, the extended private key can derive all the corresponding private keys to sign transactions and spend the money.
One common application of this solution is to install an extended public key on a web server that serves an e-commerce application. The web server can use the public key derivation function to create a new bitcoin address for every transaction (e.g. for a customer shopping cart). The web server will not have any private keys that would be vulnerable to theft. Without HD wallets, the only way to do this is to generate thousands of bitcoin addresses on a separate secure server and then pre-load them on the e-commerce server. That approach is cumbersome and requires constant maintenance to ensure that the e-commerce server doesn't "run out" of keys.
Another common application of this solution is for cold-storage or hardware wallets. In that scenario, the extended private key can be stored on a paper wallet or hardware device (such as a Trezor hardware wallet), while the extended public key can be kept online. The user can create "receive" addresses at will, while the private keys are safely stored offline. To spend the funds, they can use the extended private key on an offline signing bitcoin client or sign transactions on the hardware wallet device (e.g. Trezor).
[[CKDpub]]
.Hierarchical Deterministic Wallet: Extending a parent public key to create a child public key
image::images/ChildPublicDerivation.svg["ChildPublicDerivation"]
===== Hardened derivation and notation
The ability to derive a branch of public keys from an extended public key is very useful, but it comes with a potential risk. Access to an extended public key does not give access to child private keys. However, because the extended public key contains the chain code, if a child private key is known, or somehow leaked, it can be used with the chain code to derive all the other child private keys. A single leaked child private key, together with a parent chain code, reveals all the private keys of all the children. Worse, the child private key together with a parent chain code can be used to deduce the parent private key.
To counter this risk, HD wallets use an alternative derivation function called _hardened derivation_, which "breaks" the relationship between parent public key and child chain code. The hardened derivation function uses the parent private key to derive the child chain code, instead of the parent public key. This creates a "firewall" in the parent/child sequence, with a chain code that cannot be used to compromise a parent or sibling private key. The hardened derivation function looks almost identical to the normal child private key derivation, except that the parent private key is used as input to the hash function, instead of the parent public key, as shown in the diagram below:
[[CKDprime]]
.Hierarchical Deterministic Wallet: Hardened derivation of a child key, omits the parent public key
image::images/ChildHardPrivateDerivation.svg["ChildHardPrivateDerivation"]
When the hardened private derivation function is used, the resulting child private key and chain code are completely different from what would result from the normal derivation function. The resulting "branch" of keys can be used to produce extended public keys which are not vulnerable, since the chain code they contain cannot be exploited to reveal any private keys. Hardened derivation is therefore used to create a "gap" in the tree above the level where extended public keys are used. In simple terms, if you want to use the convenience of an extended public key to derive branches of public keys, without exposing yourself to the risk of a leaked chain code, you should derive it from a hardened parent, rather than a normal parent. As a best practice, the level-1 children of the master keys are always derived through the hardened derivation, to prevent compromise of the master keys.
===== Index numbers for normal and hardened derivation
The index number used int he derivation function is a 32-bit integer. To easily distinguish between keys derived through the normal derivation function versus keys derived through hardened derivation, this index number is split into two ranges. Index numbers between 0 and 2^31^ (0x0 to 0x80000000) are used _only_ for normal derivation. Index numbers between 2^31^ and 2^32^ (0x80000000 to 0x8FFFFFFF) are used _only_ for hardened derivation. Therefore, if the index number is less than 2^31^, that means the child is normal, whereas if the index number is above 2^31^, the child is hardened.
To make the index number easier to read and display, the index number for hardened children is displayed starting from zero, but with a prime symbol ('). The first normal child key is therefore displayed as 0, whereas the first hardened child (index 0x80000000) is displayed as 0'. In sequence then, the second hardened key would have index 0x80000001 and would be displayed as 1', and so on. When you see an HD wallet index i', that means 2^31^+i
===== HD key identifier (path)
Keys in an HD wallet are identified using a "path" naming convention, with each level of the tree separated by a slash (/) character. Private keys derived from the master private key start with "m". Public keys derived from the master public key start with "M". Each level of the tree shows the index number of the child key. The key identified by the path is the right most index with its "ancestry" read from right to left up to the master key from which it was derived. For example, identifier m/x/y/z describes the key which is the z-th child of key m/x/y, which is the y-th child of key m/x, which is the x-th child of m.
.HD wallet path indicating derived keys
|=======
| m/0 | The first (0) child private key from the master private key (m)
| m/0/0 | The first grandchild private key of the first child.
| m/0'/0 | The first normal grandchild of the first _hardened_ child (m/0')
| m/1/0 | The first grandchild private key of the second child (m/1).
| M/23/17/0/0 | The first great-great-grandchild public key of the first great-grandchild of the 18th grandchild of the 24th child.
|=======
===== Navigating the HD wallet tree structure
The HD wallet tree structure offers tremendous flexibility. Each parent extended key can have 4 billion children: 2 billion normal children and 2 billion hardened children. Each of those children can have another 4 billion children and so on. The tree can be as deep as you want, with an infinite number of generations. With all that flexibility, however, it becomes quite difficult to navigate this infinite tree. It is especially difficult to transfer HD wallets between implementations, because the possibilities for internal organization into branches and sub-branches are endless.
Two Bitcoin Improvement Proposals (BIPs) offer a solution to this complexity, by creating some proposed standards for the structure of HD wallet trees. BIP0043 proposes the use of the first hardened child index as a special identifier that signifies the "purpose" of the tree structure. Based on BIP0043, an HD wallet should use only one level-1 branch of the tree, with the index number identifying the structure and namespace of the rest of the tree by defining its purpose. For example, an HD wallet using only branch m/i'/, is intended to signify a specific purpose and that purpose is identified by index number "i".
Extending that specification, BIP0044 proposes a multi-account structure as "purpose" number +44'+ under BIP0043. All HD wallets following the BIP0044 structure are identified by the fact that they only used one branch of the tree: m/44'/.
BIP0044 specifies the structure as consisting of five pre-defined tree levels:
+m / purpose' / coin_type' / account' / change / address_index+
The first level "purpose" is always set to +44'+. The second level "coin_type" specifies the type of crypto-currency coin, allowing for multi-currency HD wallets where each currency has it's own subtree under the second level. There are three currencies defined for now: Bitcoin is m/44'/0', Bitcoin Testnet is m/44'/1' and Litecoin is m/44'/2'.
The third level of the tree is "account", which allows users to subdivide their wallets into separate logical sub-accounts, for accounting or organizational purposes. For example, an HD wallet might contain two bitcoin "accounts": m/44'/0'/0' and m/44'/0'/1'. Each account is the root of its own sub-tree.
On the fourth level "change", an HD wallet has two sub-trees, one for creating receiving addresses and one for creating change addresses. Note that whereas the previous levels used hardened derivation, this level uses normal derivation. This is to allow this level of the tree to export extended public keys for use in an non-secured environment. Usable addresses are derived by the HD wallet as children of the fourth level, making the fifth level of the tree the "address_index". For example, the third receiving address for bitcoin payments in the primary account would be M/44'/0'/0'/0/2. Here are a few more examples:
.BIP0044 HD wallet structure examples
|=======
| M/44'/0'/0'/0/2 | The third receiving public key for the primary bitcoin account
| M/44'/0'/3'/1/14 | The fifteenth change-address public key for the fourth bitcoin account
| m/44'/2'/0'/0/1 | The first private key in the Litecoin main account, for signing transactions
|=======
=== Advanced Keys and Addresses
==== Encrypted Private Keys (BIP0038)

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 123 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 134 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 104 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 30 KiB

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.26.3 (20100126.1600)
-->
<!-- Title: extended Pages: 1 -->
<svg width="450pt" height="156pt"
viewBox="0.00 0.00 450.00 155.87" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph1" class="graph" transform="scale(0.628492 0.628492) rotate(0) translate(4 244)">
<title>extended</title>
<polygon fill="white" stroke="white" points="-4,5 -4,-244 713,-244 713,5 -4,5"/>
<text text-anchor="middle" x="354" y="-25.4" font-family="Sans" font-size="14.00"> </text>
<text text-anchor="middle" x="354" y="-8.4" font-family="Sans" font-size="14.00">Normal Hierarchical Deterministic (HD) Key Derivation (BIP32)</text>
<g id="graph2" class="cluster"><title>cluster_parent</title>
</g>
<!-- parent_private_key -->
<g id="node2" class="node"><title>parent_private_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="278,-224 132,-224 132,-188 278,-188 278,-224"/>
<text text-anchor="middle" x="205" y="-201.9" font-family="Sans" font-size="14.00">Parent Private Key</text>
</g>
<!-- child_private_key -->
<g id="node5" class="node"><title>child_private_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="576,-224 442,-224 442,-188 576,-188 576,-224"/>
<text text-anchor="middle" x="509" y="-201.9" font-family="Sans" font-size="14.00">Child Private Key</text>
</g>
<!-- parent_private_key&#45;&gt;child_private_key -->
<g id="edge15" class="edge"><title>parent_private_key&#45;&gt;child_private_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M278.202,-206C324.606,-206 384.552,-206 431.72,-206"/>
<polygon fill="black" stroke="black" points="431.886,-209.5 441.886,-206 431.886,-202.5 431.886,-209.5"/>
</g>
<!-- hmac -->
<g id="node9" class="node"><title>hmac</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="419,-177 301,-177 301,-141 419,-141 419,-177"/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="313,-177 301,-165 "/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="301,-153 313,-141 "/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="407,-141 419,-153 "/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="419,-165 407,-177 "/>
<text text-anchor="middle" x="360" y="-154.9" font-family="Sans" font-size="14.00">One&#45;Way Hash</text>
</g>
<!-- parent_private_key&#45;&gt;hmac -->
<!-- parent_chain_code -->
<g id="node3" class="node"><title>parent_chain_code</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="278,-177 132,-177 132,-141 278,-141 278,-177"/>
<text text-anchor="middle" x="205" y="-154.9" font-family="Sans" font-size="14.00">Parent Chain Code</text>
</g>
<!-- parent_chain_code&#45;&gt;hmac -->
<g id="edge21" class="edge"><title>parent_chain_code&#45;&gt;hmac</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M278.415,-159C282.322,-159 286.244,-159 290.139,-159"/>
<polygon fill="black" stroke="black" points="290.362,-162.5 300.362,-159 290.362,-155.5 290.362,-162.5"/>
</g>
<!-- parent_public_key -->
<g id="node4" class="node"><title>parent_public_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="273,-130 137,-130 137,-94 273,-94 273,-130"/>
<text text-anchor="middle" x="205" y="-107.9" font-family="Sans" font-size="14.00">Parent Public Key</text>
</g>
<!-- child_public_key -->
<g id="node7" class="node"><title>child_public_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="571,-130 447,-130 447,-94 571,-94 571,-130"/>
<text text-anchor="middle" x="509" y="-107.9" font-family="Sans" font-size="14.00">Child Public Key</text>
</g>
<!-- parent_public_key&#45;&gt;child_public_key -->
<g id="edge17" class="edge"><title>parent_public_key&#45;&gt;child_public_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M273.603,-112C321.996,-112 386.725,-112 436.057,-112"/>
<polygon fill="black" stroke="black" points="436.339,-115.5 446.339,-112 436.339,-108.5 436.339,-115.5"/>
</g>
<!-- parent_public_key&#45;&gt;hmac -->
<g id="edge19" class="edge"><title>parent_public_key&#45;&gt;hmac</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M269.613,-130.115C275.163,-131.741 280.685,-133.384 286,-135 289.101,-135.943 292.271,-136.92 295.47,-137.916"/>
<polygon fill="black" stroke="black" points="294.524,-141.288 305.113,-140.949 296.624,-134.61 294.524,-141.288"/>
</g>
<!-- rel2 -->
<g id="node11" class="node"><title>rel2</title>
<text text-anchor="middle" x="653" y="-171.9" font-family="Sans" font-size="14.00">Derived</text>
<text text-anchor="middle" x="653" y="-154.9" font-family="Sans" font-size="14.00">Mathematical</text>
<text text-anchor="middle" x="653" y="-137.9" font-family="Sans" font-size="14.00">Relationship</text>
</g>
<!-- child_private_key&#45;&gt;rel2 -->
<g id="edge9" class="edge"><title>child_private_key&#45;&gt;rel2</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M564.262,-187.963C572.044,-185.423 580.101,-182.793 588.044,-180.201"/>
<polygon fill="black" stroke="black" points="589.227,-183.497 597.648,-177.066 587.055,-176.842 589.227,-183.497"/>
</g>
<!-- child_chain_code -->
<g id="node6" class="node"><title>child_chain_code</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="576,-177 442,-177 442,-141 576,-141 576,-177"/>
<text text-anchor="middle" x="509" y="-154.9" font-family="Sans" font-size="14.00">Child Chain Code</text>
</g>
<!-- child_chain_code&#45;&gt;rel2 -->
<!-- child_public_key&#45;&gt;rel2 -->
<g id="edge13" class="edge"><title>child_public_key&#45;&gt;rel2</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M573.865,-133.171C581.806,-135.763 589.864,-138.393 597.648,-140.934"/>
<polygon fill="black" stroke="black" points="574.855,-129.813 564.262,-130.037 572.683,-136.467 574.855,-129.813"/>
</g>
<!-- i_norm -->
<g id="node8" class="node"><title>i_norm</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="262,-78 148,-78 148,-42 262,-42 262,-78"/>
<text text-anchor="middle" x="205" y="-55.9" font-family="Sans" font-size="14.00">Index Number</text>
</g>
<!-- i_norm&#45;&gt;hmac -->
<g id="edge25" class="edge"><title>i_norm&#45;&gt;hmac</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M262.317,-73.0124C270.556,-76.0017 278.704,-79.6258 286,-84 307.108,-96.6552 326.469,-116.725 340.089,-132.92"/>
<polygon fill="black" stroke="black" points="337.631,-135.444 346.667,-140.976 343.053,-131.016 337.631,-135.444"/>
</g>
<!-- hmac&#45;&gt;child_private_key -->
<g id="edge29" class="edge"><title>hmac&#45;&gt;child_private_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M417.181,-177.037C425.321,-179.605 433.753,-182.265 442.059,-184.884"/>
<polygon fill="black" stroke="black" points="441.136,-188.263 451.726,-187.934 443.242,-181.587 441.136,-188.263"/>
</g>
<!-- hmac&#45;&gt;child_chain_code -->
<g id="edge31" class="edge"><title>hmac&#45;&gt;child_chain_code</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M419.745,-159C423.73,-159 427.774,-159 431.828,-159"/>
<polygon fill="black" stroke="black" points="431.9,-162.5 441.9,-159 431.9,-155.5 431.9,-162.5"/>
</g>
<!-- hmac&#45;&gt;child_public_key -->
<g id="edge27" class="edge"><title>hmac&#45;&gt;child_public_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M417.181,-140.963C425.321,-138.395 433.753,-135.735 442.059,-133.116"/>
<polygon fill="black" stroke="black" points="443.242,-136.413 451.726,-130.066 441.136,-129.737 443.242,-136.413"/>
</g>
<!-- rel1 -->
<g id="node10" class="node"><title>rel1</title>
<text text-anchor="middle" x="55" y="-163.4" font-family="Sans" font-size="14.00">Mathematical</text>
<text text-anchor="middle" x="55" y="-146.4" font-family="Sans" font-size="14.00">Relationship</text>
</g>
<!-- rel1&#45;&gt;parent_private_key -->
<g id="edge3" class="edge"><title>rel1&#45;&gt;parent_private_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M120.192,-181.787C121.471,-182.198 122.741,-182.603 124,-183 129.158,-184.628 134.517,-186.266 139.911,-187.876"/>
<polygon fill="black" stroke="black" points="120.86,-178.324 110.267,-178.54 118.683,-184.976 120.86,-178.324"/>
</g>
<!-- rel1&#45;&gt;parent_chain_code -->
<!-- rel1&#45;&gt;parent_public_key -->
<g id="edge7" class="edge"><title>rel1&#45;&gt;parent_public_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M110.267,-139.46C114.902,-137.918 119.525,-136.412 124,-135 125.934,-134.39 127.897,-133.778 129.879,-133.166"/>
<polygon fill="black" stroke="black" points="131.358,-136.375 139.911,-130.124 129.326,-129.677 131.358,-136.375"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.7 KiB

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.26.3 (20100126.1600)
-->
<!-- Title: extended Pages: 1 -->
<svg width="450pt" height="148pt"
viewBox="0.00 0.00 450.00 147.86" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph1" class="graph" transform="scale(0.714286 0.714286) rotate(0) translate(4 203)">
<title>extended</title>
<polygon fill="white" stroke="white" points="-4,5 -4,-203 627,-203 627,5 -4,5"/>
<text text-anchor="middle" x="311" y="-8.4" font-family="Sans" font-size="14.00">Creation Of The Master Keys</text>
<g id="graph2" class="cluster"><title>cluster_y</title>
</g>
<g id="graph3" class="cluster"><title>cluster_x</title>
</g>
<!-- entropy -->
<g id="node1" class="node"><title>entropy</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="96,-174 3.55271e-14,-174 0,-98 96,-98 96,-174"/>
<text text-anchor="middle" x="48" y="-157.4" font-family="Sans" font-size="14.00">128, 256,</text>
<text text-anchor="middle" x="48" y="-140.4" font-family="Sans" font-size="14.00">Or 512 Bits</text>
<text text-anchor="middle" x="48" y="-123.4" font-family="Sans" font-size="14.00">Of Entropy</text>
<text text-anchor="middle" x="48" y="-106.4" font-family="Sans" font-size="14.00">(The Seed)</text>
</g>
<!-- hmac -->
<g id="node2" class="node"><title>hmac</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="194,-165.5 114,-165.5 114,-106.5 194,-106.5 194,-165.5"/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="126,-165.5 114,-153.5 "/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="114,-118.5 126,-106.5 "/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="182,-106.5 194,-118.5 "/>
<polyline fill="none" stroke="black" stroke-width="1.75" points="194,-153.5 182,-165.5 "/>
<text text-anchor="middle" x="154" y="-148.9" font-family="Sans" font-size="14.00">512&#45;Bit</text>
<text text-anchor="middle" x="154" y="-131.9" font-family="Sans" font-size="14.00">One&#45;Way</text>
<text text-anchor="middle" x="154" y="-114.9" font-family="Sans" font-size="14.00">Hash</text>
</g>
<!-- entropy&#45;&gt;hmac -->
<g id="edge2" class="edge"><title>entropy&#45;&gt;hmac</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M96.0377,-136C98.5335,-136 101.044,-136 103.547,-136"/>
<polygon fill="black" stroke="black" points="103.737,-139.5 113.737,-136 103.737,-132.5 103.737,-139.5"/>
</g>
<!-- private_key -->
<g id="node5" class="node"><title>private_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="371,-183 277,-183 277,-141 371,-141 371,-183"/>
<text text-anchor="middle" x="324" y="-166.4" font-family="Sans" font-size="14.00">Master</text>
<text text-anchor="middle" x="324" y="-149.4" font-family="Sans" font-size="14.00">Private Key</text>
</g>
<!-- hmac&#45;&gt;private_key -->
<g id="edge4" class="edge"><title>hmac&#45;&gt;private_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M194.288,-142.162C215.852,-145.46 242.783,-149.579 266.509,-153.207"/>
<polygon fill="black" stroke="black" points="266.042,-156.677 276.457,-154.729 267.101,-149.757 266.042,-156.677"/>
<text text-anchor="middle" x="231" y="-156.4" font-family="Sans" font-size="14.00">256 Bits</text>
</g>
<!-- chain_code -->
<g id="node7" class="node"><title>chain_code</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="371,-127 277,-127 277,-85 371,-85 371,-127"/>
<text text-anchor="middle" x="324" y="-110.4" font-family="Sans" font-size="14.00">Master</text>
<text text-anchor="middle" x="324" y="-93.4" font-family="Sans" font-size="14.00">Chain Code</text>
</g>
<!-- hmac&#45;&gt;chain_code -->
<g id="edge6" class="edge"><title>hmac&#45;&gt;chain_code</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M194.074,-125.147C198.81,-123.864 202,-123 202,-123 202,-123 234.754,-118.436 266.319,-114.038"/>
<polygon fill="black" stroke="black" points="267.061,-117.468 276.482,-112.621 266.095,-110.535 267.061,-117.468"/>
<text text-anchor="middle" x="231" y="-127.4" font-family="Sans" font-size="14.00">256 Bits</text>
</g>
<!-- public_key -->
<g id="node9" class="node"><title>public_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="476,-183 390,-183 390,-141 476,-141 476,-183"/>
<text text-anchor="middle" x="433" y="-166.4" font-family="Sans" font-size="14.00">Master</text>
<text text-anchor="middle" x="433" y="-149.4" font-family="Sans" font-size="14.00">Public Key</text>
</g>
<!-- private_key&#45;&gt;public_key -->
<g id="edge10" class="edge"><title>private_key&#45;&gt;public_key</title>
<path fill="none" stroke="black" stroke-width="1.75" stroke-dasharray="5,2" d="M371.809,-162C374.412,-162 377.035,-162 379.655,-162"/>
<polygon fill="black" stroke="black" points="379.69,-165.5 389.69,-162 379.69,-158.5 379.69,-165.5"/>
</g>
<!-- extended_private_key -->
<g id="node11" class="node"><title>extended_private_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="605,-99.5 511,-99.5 511,-40.5 605,-40.5 605,-99.5"/>
<text text-anchor="middle" x="558" y="-82.9" font-family="Sans" font-size="14.00">Master</text>
<text text-anchor="middle" x="558" y="-65.9" font-family="Sans" font-size="14.00">Extended</text>
<text text-anchor="middle" x="558" y="-48.9" font-family="Sans" font-size="14.00">Private Key</text>
</g>
<!-- private_key&#45;&gt;extended_private_key -->
<g id="edge16" class="edge"><title>private_key&#45;&gt;extended_private_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M371.615,-141.8C382.023,-137.384 390,-134 390,-134 390,-134 452.085,-110.348 500.771,-91.8015"/>
<polygon fill="black" stroke="black" points="502.208,-94.9994 510.307,-88.1686 499.716,-88.4579 502.208,-94.9994"/>
</g>
<!-- chain_code&#45;&gt;extended_private_key -->
<g id="edge12" class="edge"><title>chain_code&#45;&gt;extended_private_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M366.157,-84.9214C374.113,-80.9433 380,-78 380,-78 380,-78 492,-71 492,-71 492,-71 495.274,-70.9504 500.363,-70.8733"/>
<polygon fill="black" stroke="black" points="500.439,-74.3726 510.385,-70.7214 500.333,-67.3734 500.439,-74.3726"/>
</g>
<!-- extended_public_key -->
<g id="node12" class="node"><title>extended_public_key</title>
<polygon fill="none" stroke="black" stroke-width="1.75" points="601,-171.5 515,-171.5 515,-112.5 601,-112.5 601,-171.5"/>
<text text-anchor="middle" x="558" y="-154.9" font-family="Sans" font-size="14.00">Master</text>
<text text-anchor="middle" x="558" y="-137.9" font-family="Sans" font-size="14.00">Extended</text>
<text text-anchor="middle" x="558" y="-120.9" font-family="Sans" font-size="14.00">Public Key</text>
</g>
<!-- chain_code&#45;&gt;extended_public_key -->
<g id="edge14" class="edge"><title>chain_code&#45;&gt;extended_public_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M371.635,-113.329C410.235,-119.267 464.599,-127.631 504.654,-133.793"/>
<polygon fill="black" stroke="black" points="504.353,-137.288 514.769,-135.349 505.417,-130.369 504.353,-137.288"/>
</g>
<!-- public_key&#45;&gt;extended_public_key -->
<g id="edge18" class="edge"><title>public_key&#45;&gt;extended_public_key</title>
<path fill="none" stroke="black" stroke-width="1.75" d="M476.018,-155.117C485.348,-153.624 495.321,-152.029 504.984,-150.482"/>
<polygon fill="black" stroke="black" points="505.581,-153.932 514.903,-148.896 504.475,-147.019 505.581,-153.932"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

Loading…
Cancel
Save