Key Derivation polish

- Fix address encoding diagram
- Add key derivation diagrams
- Clean up text for key formatting
This commit is contained in:
mDuo13
2019-10-10 17:19:24 -07:00
parent db451108ab
commit 4f6579f1ce
8 changed files with 692 additions and 105 deletions

View File

@@ -4,76 +4,22 @@
<element>
<id>UMLObject</id>
<coordinates>
<x>60</x>
<y>50</y>
<w>110</w>
<h>70</h>
</coordinates>
<panel_attributes>Passphrase
--
(Optional)
Any string
lt=.</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>320</x>
<y>50</y>
<w>130</w>
<h>70</h>
</coordinates>
<panel_attributes>Seed
--
(16 bytes)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>160</x>
<x>40</x>
<y>70</y>
<w>180</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=&lt;.
SHA512, keep
first 16 bytes</panel_attributes>
<additional_attributes>160.0;20.0;10.0;20.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>60</x>
<y>180</y>
<w>220</w>
<h>70</h>
</coordinates>
<panel_attributes>Public Key
<panel_attributes>Master Public Key
--
33 bytes (secp256k1)
0xED + 32 bytes (Ed25519)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>160</x>
<y>80</y>
<w>600</w>
<h>120</h>
</coordinates>
<panel_attributes>lt=&lt;-
Public Key
Derivation</panel_attributes>
<additional_attributes>10.0;100.0;10.0;70.0;580.0;70.0;580.0;10.0;550.0;10.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>360</x>
<y>270</y>
<x>340</x>
<y>160</y>
<w>180</w>
<h>80</h>
</coordinates>
@@ -85,8 +31,8 @@ Derivation</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>270</x>
<y>180</y>
<x>250</x>
<y>70</y>
<w>220</w>
<h>160</h>
</coordinates>
@@ -105,8 +51,8 @@ RIPEMD160 of SHA-256
<element>
<id>UMLObject</id>
<coordinates>
<x>690</x>
<y>270</y>
<x>670</x>
<y>160</y>
<w>180</w>
<h>80</h>
</coordinates>
@@ -119,22 +65,22 @@ Checksum (4 bytes)</panel_attributes>
<element>
<id>UMLObject</id>
<coordinates>
<x>60</x>
<y>270</y>
<x>40</x>
<y>160</y>
<w>190</w>
<h>80</h>
</coordinates>
<panel_attributes>Type Prefix
--
0x00
("r" in Ripple's base58)</panel_attributes>
("r" in XRPL base58)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>240</x>
<y>310</y>
<x>220</x>
<y>200</y>
<w>140</w>
<h>30</h>
</coordinates>
@@ -144,8 +90,8 @@ Checksum (4 bytes)</panel_attributes>
<element>
<id>UMLObject</id>
<coordinates>
<x>400</x>
<y>400</y>
<x>380</x>
<y>290</y>
<w>100</w>
<h>70</h>
</coordinates>
@@ -157,8 +103,8 @@ Checksum (4 bytes)</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>490</x>
<y>310</y>
<x>470</x>
<y>200</y>
<w>120</w>
<h>140</h>
</coordinates>
@@ -168,8 +114,8 @@ Checksum (4 bytes)</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>530</x>
<y>290</y>
<x>510</x>
<y>180</y>
<w>80</w>
<h>30</h>
</coordinates>
@@ -179,8 +125,8 @@ Checksum (4 bytes)</panel_attributes>
<element>
<id>UMLState</id>
<coordinates>
<x>590</x>
<y>290</y>
<x>570</x>
<y>180</y>
<w>100</w>
<h>40</h>
</coordinates>
@@ -191,8 +137,8 @@ type=sender</panel_attributes>
<element>
<id>Relation</id>
<coordinates>
<x>420</x>
<y>340</y>
<x>400</x>
<y>230</y>
<w>130</w>
<h>80</h>
</coordinates>
@@ -201,29 +147,15 @@ SHA-256 twice</panel_attributes>
<additional_attributes>10.0;60.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<id>Text</id>
<coordinates>
<x>600</x>
<y>50</y>
<w>110</w>
<h>70</h>
<x>40</x>
<y>30</y>
<w>280</w>
<h>30</h>
</coordinates>
<panel_attributes>Private Key
--
(32 bytes)</panel_attributes>
<panel_attributes>*Address Encoding*
style=wordwrap</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>440</x>
<y>70</y>
<w>180</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=&lt;-
Private Key
Derivation</panel_attributes>
<additional_attributes>160.0;20.0;10.0;20.0</additional_attributes>
</element>
</diagram>

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="14.2">
<zoom_level>10</zoom_level>
<element>
<id>UMLObject</id>
<coordinates>
<x>20</x>
<y>60</y>
<w>120</w>
<h>70</h>
</coordinates>
<panel_attributes>Passphrase
--
(Optional)
Any string
lt=.</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>130</x>
<y>80</y>
<w>170</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=.&gt;
SHA-512, keep
first 16 bytes</panel_attributes>
<additional_attributes>10.0;20.0;150.0;20.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>280</x>
<y>60</y>
<w>120</w>
<h>70</h>
</coordinates>
<panel_attributes>Seed
--
(16 bytes)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>170</x>
<y>200</y>
<w>230</w>
<h>70</h>
</coordinates>
<panel_attributes>Private Key
--
(32 bytes)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>290</x>
<y>120</y>
<w>120</w>
<h>100</h>
</coordinates>
<panel_attributes>lt=&lt;-
SHA-512Half</panel_attributes>
<additional_attributes>10.0;80.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>170</x>
<y>330</y>
<w>230</w>
<h>70</h>
</coordinates>
<panel_attributes>Public Key
--
(32 bytes)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>110</x>
<y>330</y>
<w>60</w>
<h>70</h>
</coordinates>
<panel_attributes>0xED
Prefix
--
(1 byte)
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>230</x>
<y>260</y>
<w>180</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=-&gt;
Public Key Derivation</panel_attributes>
<additional_attributes>10.0;10.0;10.0;70.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>100</x>
<y>400</y>
<w>320</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=..
Master Public Key
(33 bytes)</panel_attributes>
<additional_attributes>10.0;10.0;10.0;30.0;300.0;30.0;300.0;10.0</additional_attributes>
</element>
<element>
<id>Text</id>
<coordinates>
<x>20</x>
<y>20</y>
<w>280</w>
<h>30</h>
</coordinates>
<panel_attributes>*Ed25519 Key Derivation*
style=wordwrap</panel_attributes>
<additional_attributes/>
</element>
</diagram>

View File

@@ -0,0 +1,517 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="14.2">
<zoom_level>10</zoom_level>
<element>
<id>UMLObject</id>
<coordinates>
<x>50</x>
<y>70</y>
<w>140</w>
<h>70</h>
</coordinates>
<panel_attributes>Passphrase
--
(Optional)
Any string
lt=.</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>180</x>
<y>90</y>
<w>180</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=.&gt;
SHA-512, keep
first 16 bytes</panel_attributes>
<additional_attributes>10.0;20.0;160.0;20.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>340</x>
<y>70</y>
<w>140</w>
<h>70</h>
</coordinates>
<panel_attributes>Seed
--
(16 bytes)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>50</x>
<y>280</y>
<w>150</w>
<h>70</h>
</coordinates>
<panel_attributes>Root Private Key
--
(32 bytes)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>110</x>
<y>130</y>
<w>460</w>
<h>170</h>
</coordinates>
<panel_attributes>lt=&lt;-
SHA-512Half</panel_attributes>
<additional_attributes>10.0;150.0;10.0;110.0;440.0;110.0;440.0;10.0;400.0;10.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>330</x>
<y>280</y>
<w>150</w>
<h>70</h>
</coordinates>
<panel_attributes>Root Public Key
--
(33 bytes
compressed)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>190</x>
<y>300</y>
<w>160</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=-&gt;
Public Key
Derivation</panel_attributes>
<additional_attributes>10.0;20.0;140.0;20.0</additional_attributes>
</element>
<element>
<id>Text</id>
<coordinates>
<x>50</x>
<y>30</y>
<w>280</w>
<h>30</h>
</coordinates>
<panel_attributes>*secp256k1 Key Derivation*
style=wordwrap</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLSyncBarVertical</id>
<coordinates>
<x>500</x>
<y>110</y>
<w>20</w>
<h>70</h>
</coordinates>
<panel_attributes>template=txt
title=titletext
bg=red</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>370</x>
<y>150</y>
<w>110</w>
<h>70</h>
</coordinates>
<panel_attributes>Root Key
Sequence
--
(4 bytes;
default 0)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>120</y>
<w>60</w>
<h>30</h>
</coordinates>
<panel_attributes>lt=-&gt;</panel_attributes>
<additional_attributes>10.0;10.0;40.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>150</y>
<w>60</w>
<h>30</h>
</coordinates>
<panel_attributes>lt=-&gt;</panel_attributes>
<additional_attributes>10.0;10.0;40.0;10.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>370</x>
<y>440</y>
<w>110</w>
<h>70</h>
</coordinates>
<panel_attributes>Int Key
Sequence
--
(4 bytes;
default 0)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>370</x>
<y>360</y>
<w>110</w>
<h>70</h>
</coordinates>
<panel_attributes>Family
Number
--
(4 bytes;
all 0's)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLNote</id>
<coordinates>
<x>140</x>
<y>170</y>
<w>210</w>
<h>50</h>
</coordinates>
<panel_attributes>Increment the key sequence and try again if the SHA-512Half doesn't make a valid private key.
bg=yellow
fontsize=10
style=wordwrap</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLNote</id>
<coordinates>
<x>150</x>
<y>460</y>
<w>210</w>
<h>50</h>
</coordinates>
<panel_attributes>Increment the key sequence and try again if the SHA-512Half doesn't make a valid private key.
bg=yellow
fontsize=10
style=wordwrap</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>140</x>
<y>380</y>
<w>410</w>
<h>220</h>
</coordinates>
<panel_attributes>lt=&lt;-
SHA-512Half</panel_attributes>
<additional_attributes>10.0;200.0;10.0;160.0;390.0;160.0;390.0;10.0;370.0;10.0</additional_attributes>
</element>
<element>
<id>UMLSyncBarVertical</id>
<coordinates>
<x>500</x>
<y>360</y>
<w>20</w>
<h>80</h>
</coordinates>
<panel_attributes>template=txt
title=titletext
bg=red</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>320</y>
<w>60</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=-&gt;</panel_attributes>
<additional_attributes>10.0;10.0;20.0;10.0;20.0;60.0;40.0;60.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>390</y>
<w>60</w>
<h>30</h>
</coordinates>
<panel_attributes>lt=-&gt;</panel_attributes>
<additional_attributes>10.0;10.0;40.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>410</y>
<w>60</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=-&gt;</panel_attributes>
<additional_attributes>10.0;50.0;20.0;50.0;20.0;10.0;40.0;10.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>80</x>
<y>580</y>
<w>150</w>
<h>80</h>
</coordinates>
<panel_attributes>Intermediate
Private Key
--
(32 bytes)
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>330</x>
<y>580</y>
<w>150</w>
<h>80</h>
</coordinates>
<panel_attributes>Intermediate
Public Key
--
(33 bytes
compressed)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>220</x>
<y>610</y>
<w>130</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=-&gt;
Public Key
Derivation</panel_attributes>
<additional_attributes>10.0;20.0;110.0;20.0</additional_attributes>
</element>
<element>
<id>UMLState</id>
<coordinates>
<x>660</x>
<y>330</y>
<w>140</w>
<h>40</h>
</coordinates>
<panel_attributes>Elliptic Curve
Point Add
type=sender</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>290</y>
<w>210</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>190.0;50.0;150.0;50.0;150.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>350</y>
<w>210</w>
<h>280</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>190.0;10.0;150.0;10.0;150.0;260.0;10.0;260.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>800</x>
<y>320</y>
<w>150</w>
<h>70</h>
</coordinates>
<panel_attributes>Master Public Key
--
(33 bytes
compressed)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLState</id>
<coordinates>
<x>150</x>
<y>700</y>
<w>160</w>
<h>40</h>
</coordinates>
<panel_attributes>Add, Mod
Curve Modulus
type=sender</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>100</x>
<y>650</y>
<w>70</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>50.0;60.0;10.0;60.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>50</x>
<y>340</y>
<w>120</w>
<h>410</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>100.0;390.0;10.0;390.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>UMLObject</id>
<coordinates>
<x>330</x>
<y>690</y>
<w>150</w>
<h>70</h>
</coordinates>
<panel_attributes>Master Private Key
--
(32 bytes)</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>300</x>
<y>710</y>
<w>50</w>
<h>30</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30.0;10.0;10.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>380</y>
<w>410</w>
<h>380</h>
</coordinates>
<panel_attributes>lt=.&gt;
(Public key derivation
yields the same result.)</panel_attributes>
<additional_attributes>10.0;350.0;390.0;350.0;390.0;10.0</additional_attributes>
</element>
<element>
<id>UMLNote</id>
<coordinates>
<x>590</x>
<y>230</y>
<w>210</w>
<h>50</h>
</coordinates>
<panel_attributes>Validators use the root key pair.
bg=green
style=wordwrap</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>200</x>
<y>240</y>
<w>410</w>
<h>60</h>
</coordinates>
<panel_attributes>lt=&lt;..
fg=#25A768
transparency=0</panel_attributes>
<additional_attributes>10.0;40.0;390.0;10.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>480</x>
<y>260</y>
<w>130</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=&lt;..
fg=#25A768
transparency=0</panel_attributes>
<additional_attributes>10.0;30.0;110.0;10.0</additional_attributes>
</element>
<element>
<id>UMLNote</id>
<coordinates>
<x>630</x>
<y>630</y>
<w>210</w>
<h>50</h>
</coordinates>
<panel_attributes>Accounts use the master key pair.
bg=green
style=wordwrap</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>760</x>
<y>380</y>
<w>80</w>
<h>270</h>
</coordinates>
<panel_attributes>lt=&lt;..
fg=#25A768
transparency=0</panel_attributes>
<additional_attributes>60.0;10.0;10.0;250.0</additional_attributes>
</element>
<element>
<id>Relation</id>
<coordinates>
<x>470</x>
<y>660</y>
<w>180</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;..
fg=#25A768
transparency=0</panel_attributes>
<additional_attributes>10.0;50.0;160.0;10.0</additional_attributes>
</element>
</diagram>