Post
Topic
Board Development & Technical Discussion
Re: Is this HD wallet secure?
by
coinlatte
on 06/03/2021, 13:24:41 UTC
Code:
$ hexdump -Cv key.bin
00000000  a3 4b 99 f2 2c 79 0c 4e  36 b2 b3 c2 c3 5a 36 db  |.K..,y.N6....Z6.|
00000010  06 22 6e 41 c6 92 fc 82  b8 b5 6a c1 c5 40 c5 bd  |."nA......j..@..|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000040
$ sha256sum key.bin
db26845476a175bd67c1e2b96812ea4aaa772f401fd23edabb98155e53d6b612  key.bin

Then, ECDSA operations needs to be done here:

firstAddedValue: db26845476a175bd67c1e2b96812ea4aaa772f401fd23edabb98155e53d6b612
firstAddedPoint: 02 b87ef5ad03264ef973f7f1a710397f2aa365dd7c48514550aee83ac9c2cb4183
masterPublicKey: 02 a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd
firstDerivedKey: 02 1dbe25ac1b430b911bda0f22d11c65a6e0fcc4861ac2a56ae8e8db27fd82ebd5

So, "firstDerivedKey" is just ECDSA sum of points "masterPublicKey" and "firstAddedPoint". It starts with "02", then fine, we have it. If it would start with "03", then we would negate it and get point with identical X value, just with reversed Y value.