Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slips
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
slips
Commits
78997132
Commit
78997132
authored
Feb 14, 2016
by
Pavol Rusnak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3 from gary-rowe/master
Improve wording and provide worked example for SLIP0013 HD section
parents
1964e3cb
86e3f4d9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
slip-0013.md
slip-0013.md
+22
-5
No files found.
slip-0013.md
View file @
78997132
...
...
@@ -39,15 +39,32 @@ The index is used so one can generate more keys corresponding to the same URI.
##HD Structure
1.
Let's concatenate the little endian representation of index with the URI.
1.
First concatenate
`index`
with the URI (
`uri`
). Use little endian for
`index`
.
2.
Compute the SHA256 hash of the result.
2.
Compute the SHA256 hash of the result
(
`hash`
)
.
3.
Let's take first 128 bits of the hash and split it into four 32-bit numbers A, B, C, D.
3.
Truncate
`hash`
to 128 bits (
`hash128`
)
4.
S
et highest bits of numbers A, B, C, D to 1
.
4.
S
plit
`hash128`
into four 32-bit integers
`A`
,
`B`
,
`C`
,
`D`
. Use little endian for each
.
5.
Derive the HD node m/13'/A'/B'/C'/D' according to BIP32.
5.
Set highest bits of numbers
`A`
,
`B`
,
`C`
,
`D`
to 1 (e.g. logical OR with 0x80000000) to harden
6.
Derive the HD node
`m/13'/A'/B'/C'/D'`
according to BIP32.
###Worked example
1.
`index + uri`
=
`0`
+
`https://satoshi@bitcoin.org/login`
2.
`sha256(index + uri)`
=
`d0e2389d4c8394a9f3e32de01104bf6e8db2d9e2bb0905d60fffa5a18fd696db`
3.
`hash128`
=
`d0e2389d4c8394a9f3e32de01104bf6e`
4.
`A`
= 221831888,
`B`
= 160727884,
`C`
= 3007475,
`D`
= 247399441
5.
`A'`
= 2637750992,
`B'`
= 2845082444,
`C'`
= 3761103859,
`D'`
= 4005495825
6.
`bip32 node path`
=
`m/2147483661/2637750992/2845082444/3761103859/4005495825`
See a
[
Python example
](
https://github.com/trezor/python-trezor/blob/ca45019918bc4c54f1ace899a9acf397c8f4d92f/tests/test_msg_signidentity.py#L27
)
.
##Challenge - Response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment