trezor / python-shamir-mnemonic

MIT License
168 stars 60 forks source link

Interface improvements #35

Closed andrewkozlik closed 3 years ago

andrewkozlik commented 3 years ago

Resolves https://github.com/trezor/python-shamir-mnemonic/issues/33, namely points 5, 6 and 8:

  1. Introduced an EncryptedSeed class and moved the decrypt function there. The recover_ems() function returns EncryptedSeed, which also carries information about the identifier and interation exponent. This is easier to work with if you want to allow the user to supply the passprase later.
  2. recover_ems discards groups that don't meet the member threshold and allows extra shares. In python-shamir-mnemonic if the user provides extra shares, then we fail, which seems like a pointless hassle.
  3. In some places we used threshold, which is ambiguous. Changed to member_threshold.

Including:

In addition to (5), I would also change the signature of recover_ems to accept Share objects instead of mnemonic strings.

Furthermore: