refactor: transaction
eigmax opened this issue · comments
Currently, the transaction just includes input notes, so we can not reconstruct the whole transaction when retrieving a user's trade history.
The transaction is actually useless nearly, the only case is we use it to help encrypt input/output notes together and finally transmit the plain note to TxData. Obviously, this makes no sense for class Transaction
.
Another thought is if we need to achieve selective exposure, we need the entire transaction.
So I open this issue to discuss the redesign of transaction class.
In PR #144, we use signingKey
to encrypt the TxData, and make it possible to reconstruct the transaction history. But since we support update-account
, which will change the signingKey
, this leads to the old transaction not being able to be decrypted.
So simply, we can re-encrypt the old transactions once we changed the signingKey. But this is not practical when users have lots of trades here. So we can allow the user to re-encrypt the lastest bundles of transaction,
Other solution, like key derivation, is not practical too, cause the root key is not easy to protect.