ethankosakovsky / bip85

BIP Entropy
MIT License
22 stars 15 forks source link

Examples and tests for RSA / RSA-GPG #5

Closed AndreasGassmann closed 3 years ago

AndreasGassmann commented 3 years ago

I'm in the process of updating my typescript BIP-85 library and have a couple questions:

  1. In the BIP85-DRNG section https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#bip85-drng, this is the output:
    • DERIVED KEY=cca20ccb0e9a90feb0912870c3323b24874b0ca3d8018c4b96d0b97c0e82ded0
    • ENTROPY=6bea85e51a05e6dbaf2ccee05097758213807997ba936589cef01c8f19c0079f395a0cd045efa3438677f3ef9ad34c9a68506626c5a17e51ed5e177852ee7fdc
    • DRNG(80 bytes)=b78b1ee6b345eae6836c2d53d33c64cdaf9a696487be81b03e822dc84b3f1cd883d7559e53d175f243e4c349e822a957bbff9224bc5dde9492ef54e8a439f6bc8c7355b87a925a37ee405a7502991111

I get the same value for DERIVED KEY (which is the same as test case 1: https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#test-case-1), and the same value for DRNG(80 bytes). But the intermediate ENTROPY result is different. I get the same entropy as in test case 1. Am I doing something wrong here or is this a copy paste error?

  1. Would it be possible to add test cases to this repo for the RSA and RSA GPG applications? Ideally, those could then also be added to the BIP-85 specs?

  2. This repo includes "BIP-85 extras" for creating ripple and monero seeds, but this is not part of the BIP85 specs. Will this be added at a later stage?

ethankosakovsky commented 3 years ago
  1. Yes there appears to be a copy paste error.

PATH="m/83696968'/0'/0'"

XPRV=xprv9s21ZrQH143K2LBWUUQRFXhucrQqBpKdRRxNVq2zBqsx8HVqFk2uYo8kmbaLLHRdqtQpUm98uKfu3vca1LqdGhUtyoFnCNkfmXRyPXLjbKb

k=cca20ccb0e9a90feb0912870c3323b24874b0ca3d8018c4b96d0b97c0e82ded0 bip85 derived entropy is ENT=efecfbccffea313214232d29e71563d941229afb4338c21f9517c41aaa0d16f00b83d2a09ef747e7a64e8e2bd5a14869e693da66ce94ac2da570ab7ee48618f7

BIP85_DRNG(80)=b78b1ee6b345eae6836c2d53d33c64cdaf9a696487be81b03e822dc84b3f1cd883d7559e53d175f243e4c349e822a957bbff9224bc5dde9492ef54e8a439f6bc8c7355b87a925a37ee405a7502991111

  1. Yes.

  2. I put it in as extras because I guess it was not specific to Bitcoin use cases. I can add it.

ethankosakovsky commented 3 years ago

Added some RSA tests in 7892bbddc51f498d1a693cca3f6d642b75cb3373

ethankosakovsky commented 3 years ago

Please link your Typescript library to the BIP reference implementations when you are ready by making a pull request in the bips repository.