DE-labtory / zulu

General unified crypto wallet api user can easily manage
Apache License 2.0
8 stars 7 forks source link

Ensure data integrity of the keychain component #46

Open baumstern opened 4 years ago

baumstern commented 4 years ago

Motivation

In a gist, other fields of keychain.Key relies on the PrivateKey field since they are derived from the private key.

Currently, the fields of keychain.Key are publicly exported. It has a potential risk that a consumer of the keychain component may unintentionally change the value of each field. It would corrupts integrity of keychain.Key (e.g. digital signature operation like signing and verify would not working, the association of public key and id of the key would be broken). This risk seems to me severe since most debugging for this bug gonna be hard.

Possible approach