trezor-firmware icon indicating copy to clipboard operation
trezor-firmware copied to clipboard

`BITCOIN_ONLY` feature is not additive

Open krnak opened this issue 3 years ago • 1 comments

In other words, BITCOIN_ONLY "feature" disables functionalities instead of adding them.

This is a design problem because the presence of a non-additive feature thwarts attempts to correctly define other features.

For example imagine I wanted to get more memory for Zcash. Compiling BITCOIN_ONLY=1 with USE_ZCASH=1 is semantically quite obscure.

You can find more about features additivity principle in [Cargo book].

I suggest preserving USE_* flags and replacing BITCOIN_ONLY flag by ALTCOINS flag, which activates all USE_* flags.

krnak avatar Jul 05 '22 22:07 krnak

Some proposals from https://github.com/trezor/trezor-firmware/issues/2375 to replace BITCOIN_ONLY:

  • USE_ALL_FEATURES
  • USE_ALTCOINS + USE_WEBAUTHN

Then we'd add a USE_ZCASH_SHIELDED flag which would also imply inclusion of Zcash unshielded transactions.

Please let's treat this with high priority, since it appears to be a blocker for https://github.com/trezor/trezor-firmware/pull/2371 and the other work on Zcash shielded transactions.

andrewkozlik avatar Jul 11 '22 15:07 andrewkozlik