Skip to content

Instantly share code, notes, and snippets.

@davecgh
Created September 2, 2014 00:13
Show Gist options
  • Save davecgh/b37fa1733ad961b9fd53 to your computer and use it in GitHub Desktop.
Save davecgh/b37fa1733ad961b9fd53 to your computer and use it in GitHub Desktop.
Overview of how keys are used in the btcwallet address manager
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.1"
width="1052.3622"
height="744.09448"
id="svg2">
<defs
id="defs4" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-308.2677)"
id="layer1">
<rect
width="322.18637"
height="111.61932"
rx="13"
ry="49"
x="193.56104"
y="388.30157"
id="rect2985"
style="fill:none;stroke:#0000ff;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<rect
width="321.38589"
height="111.61932"
rx="13"
ry="49"
x="716.80804"
y="529.55249"
id="rect2985-1-4"
style="fill:none;stroke:#009600;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<text
x="365.74301"
y="416.98492"
transform="scale(0.96668813,1.0344598)"
id="text3061"
xml:space="preserve"
style="font-size:33.12311935px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="365.74301"
y="416.98492"
id="tspan3063"
style="stroke-width:1">Private Master Key</tspan><tspan
x="365.74301"
y="458.38882"
id="tspan3065"
style="stroke-width:1">(masterKeyPriv)</tspan></text>
<text
x="901.07117"
y="416.98492"
transform="scale(0.96668813,1.0344598)"
id="text3061-9"
xml:space="preserve"
style="font-size:33.12311935px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#009600;fill-opacity:1;stroke:#009600;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="901.07117"
y="416.98492"
id="tspan3063-4"
style="stroke-width:1">Public Master Key</tspan><tspan
x="901.07117"
y="458.38882"
id="tspan3065-8"
style="stroke-width:1">(masterKeyPub)</tspan></text>
<text
x="906.60736"
y="553.73206"
transform="scale(0.96668813,1.0344598)"
id="text3061-8-5"
xml:space="preserve"
style="font-size:33.12311935px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#aa00d4;fill-opacity:1;stroke:#aa00d4;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="906.60736"
y="553.73206"
id="tspan3063-2-5"
style="fill:#aa00d4;stroke:#aa00d4;stroke-width:1;stroke-opacity:1">Public Crypto Key</tspan><tspan
x="906.60736"
y="595.13593"
id="tspan3065-4-1"
style="fill:#aa00d4;stroke:#aa00d4;stroke-width:1;stroke-opacity:1">(cryptoKeyPub)</tspan></text>
<text
x="178.86386"
y="553.73206"
transform="scale(0.96668813,1.0344598)"
id="text3061-8-5-1"
xml:space="preserve"
style="font-size:33.12311935px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff9955;fill-opacity:1;stroke:#ff9955;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="178.86386"
y="553.73206"
id="tspan3063-2-5-5"
style="fill:#ff9955;fill-opacity:1;stroke:#ff9955;stroke-width:1;stroke-opacity:1">Private Crypto Key</tspan><tspan
x="178.86386"
y="595.13593"
id="tspan3065-4-1-2"
style="fill:#ff9955;fill-opacity:1;stroke:#ff9955;stroke-width:1;stroke-opacity:1">(cryptoKeyPriv)</tspan></text>
<text
x="530.07947"
y="553.73206"
transform="scale(0.96668813,1.0344598)"
id="text3061-8-5-1-7"
xml:space="preserve"
style="font-size:33.12311935px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ff5555;fill-opacity:1;stroke:#ff5555;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="530.07947"
y="553.73206"
id="tspan3063-2-5-5-6"
style="fill:#ff5555;fill-opacity:1;stroke:#ff5555;stroke-width:1;stroke-opacity:1">Script Crypto Key</tspan><tspan
x="530.07947"
y="595.13593"
id="tspan3065-4-1-2-1"
style="fill:#ff5555;fill-opacity:1;stroke:#ff5555;stroke-width:1;stroke-opacity:1">(cryptoKeyScript)</tspan></text>
<text
x="280.16779"
y="560.95447"
id="text3061-8-5-1-4-2"
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="280.16779"
y="560.95447"
id="tspan3063-2-5-5-2-2" /><tspan
x="280.16779"
y="610.95447"
id="tspan3232-1" /><tspan
x="280.16779"
y="660.95447"
id="tspan3065-4-1-2-3-6" /></text>
<text
x="257.57602"
y="764.00769"
transform="scale(0.96668813,1.0344598)"
id="text3061-8-5-1-4-8"
xml:space="preserve"
style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#917c6f;fill-opacity:1;stroke:#917c6f;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="257.57602"
y="764.00769"
id="tspan4283"
style="font-size:24px;fill:#917c6f;stroke:#917c6f;stroke-width:1;stroke-opacity:1">Private Address Keys (Imported or Derived)</tspan><tspan
x="257.57602"
y="794.00769"
id="tspan4370"
style="font-size:24px;fill:#917c6f;stroke:#917c6f;stroke-width:1;stroke-opacity:1">BIP0044 Account Private Extended Keys</tspan><tspan
x="257.57602"
y="824.00769"
id="tspan3288"
style="font-size:24px;fill:#917c6f;stroke:#917c6f;stroke-width:1;stroke-opacity:1">(privKeyEncrypted, acctKeyPriv)</tspan><tspan
x="257.57602"
y="854.00769"
id="tspan3232-7"
style="font-size:24px;fill:#917c6f;stroke:#917c6f;stroke-width:1;stroke-opacity:1" /><tspan
x="257.57602"
y="884.00769"
id="tspan3065-4-1-2-3-61"
style="font-size:24px;fill:#917c6f;stroke:#917c6f;stroke-width:1;stroke-opacity:1" /></text>
<rect
width="322.18637"
height="111.61932"
rx="13"
ry="49"
x="711.05603"
y="388.30157"
id="rect2985-8"
style="fill:none;stroke:#009600;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<rect
width="322.18637"
height="111.61932"
rx="13"
ry="49"
x="12.906815"
y="529.55249"
id="rect2985-5"
style="fill:none;stroke:#0000ff;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<rect
width="322.18637"
height="111.61932"
rx="13"
ry="49"
x="351.9068"
y="529.55249"
id="rect2985-4"
style="fill:none;stroke:#0000ff;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<rect
width="473.10663"
height="138"
rx="13"
ry="49"
x="12.90683"
y="745.94409"
id="rect2985-5-3"
style="fill:none;stroke:#ff9955;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<text
x="343.57367"
y="347.36218"
id="text4128"
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="343.57367"
y="347.36218"
id="tspan4130">Crypto-related Keys</tspan></text>
<rect
width="1039"
height="344"
x="6"
y="312.36218"
id="rect4132"
style="fill:none;stroke:#000000;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<path
d="M 315.18405,192.54847 152,221.09448"
transform="translate(0,308.2677)"
id="path4134"
style="fill:none;stroke:#0000ff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<path
d="m 528.5,529.86218 -139,-30"
id="path4134-2"
style="fill:none;stroke:#0000ff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
width="1039"
height="344"
x="5.6533494"
y="683.82233"
id="rect4132-3"
style="fill:none;stroke:#000000;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<text
x="531.31671"
y="912.66779"
transform="scale(0.96668813,1.0344598)"
id="text3061-8-5-1-4-8-4"
xml:space="preserve"
style="font-size:33.12311935px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#e9afaf;fill-opacity:1;stroke:#e9afb9;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="531.31671"
y="912.66779"
id="tspan3063-2-5-5-2-5-2"
style="fill:#e9afaf;stroke:#e9afb9;stroke-width:1;stroke-opacity:1"> P2SH Addresses</tspan><tspan
x="531.31671"
y="954.07166"
id="tspan3288-7"
style="fill:#e9afaf;stroke:#e9afb9;stroke-width:1;stroke-opacity:1">(encryptedScript)</tspan><tspan
x="531.31671"
y="995.47559"
id="tspan3232-7-7"
style="fill:#e9afaf;stroke:#e9afb9;stroke-width:1;stroke-opacity:1" /><tspan
x="531.31671"
y="1036.8795"
id="tspan3065-4-1-2-3-61-9"
style="fill:#e9afaf;stroke:#e9afb9;stroke-width:1;stroke-opacity:1" /></text>
<rect
width="322.18637"
height="111.61932"
rx="13"
ry="49"
x="351.9068"
y="900.85651"
id="rect2985-5-3-3"
style="fill:none;stroke:#ff5555;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<path
d="m 500.6135,331.82454 3.68098,260.29278"
transform="translate(0,308.2677)"
id="path4263"
style="fill:none;stroke:#ff5555;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
x="280.84906"
y="725.29041"
id="text4128-3"
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="280.84906"
y="725.29041"
id="tspan4130-4">Bitcoin-related Keys &amp; Data</tspan></text>
<path
d="m 157.74233,641.31924 0.41301,104.3466"
id="path4263-1"
style="fill:none;stroke:#ff9955;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
x="805.01801"
y="749.00769"
transform="scale(0.96668813,1.0344598)"
id="text3061-8-5-1-4-8-9"
xml:space="preserve"
style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#440055;fill-opacity:1;stroke:#44006f;stroke-width:1;stroke-opacity:1;font-family:Sans"><tspan
x="805.01801"
y="749.00769"
id="tspan4362"
style="font-size:24px;fill:#440055;stroke:#44006f;stroke-width:1;stroke-opacity:1">Public Address Keys (Imported or Derived)</tspan><tspan
x="805.01801"
y="779.00769"
id="tspan4366"
style="font-size:24px;fill:#440055;stroke:#44006f;stroke-width:1;stroke-opacity:1">BIP0044 Account Public Extended Keys</tspan><tspan
x="805.01801"
y="809.00769"
id="tspan3487"
style="font-size:24px;fill:#440055;stroke:#44006f;stroke-width:1;stroke-opacity:1">Script Hashes</tspan><tspan
x="805.01801"
y="839.00769"
id="tspan3288-5"
style="font-size:24px;fill:#440055;stroke:#44006f;stroke-width:1;stroke-opacity:1">(pubKeyEncrypted, acctKeyPub, scriptHash)</tspan><tspan
x="805.01801"
y="869.00769"
id="tspan3232-7-0"
style="font-size:24px;fill:#440055;stroke:#44006f;stroke-width:1;stroke-opacity:1" /><tspan
x="805.01801"
y="899.00769"
id="tspan3065-4-1-2-3-61-2"
style="font-size:24px;fill:#440055;stroke:#44006f;stroke-width:1;stroke-opacity:1" /></text>
<rect
width="509.91647"
height="138"
rx="13"
ry="49"
x="523.70758"
y="745.94409"
id="rect2985-5-3-8"
style="fill:none;stroke:#aa00d4;stroke-width:1.99999988;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
<path
d="m 872.39264,191.94724 0,30.67485"
transform="translate(0,308.2677)"
id="path4321"
style="fill:none;stroke:#009600;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
d="m 868.09816,640.09225 3.68098,105.36108"
id="path4263-1-0"
style="fill:none;stroke:#aa00d4;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<text
x="884.6626"
y="486.42578"
transform="translate(0,308.2677)"
id="text4352"
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"><tspan
x="884.6626"
y="486.42578"
id="tspan4356" /></text>
</g>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment