trezor / trezor-firmware

:lock: Trezor Firmware Monorepo
https://trezor.io
Other
1.36k stars 663 forks source link

`BITCOIN_ONLY` feature is not additive #2370

Open krnak opened 2 years ago

krnak commented 2 years ago

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.

andrewkozlik commented 2 years ago

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

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.