cspr-rad / kairos

Apache License 2.0
2 stars 0 forks source link

Use `kairos-tx` for L1 deposit transactions #88

Open koxu1996 opened 4 months ago

koxu1996 commented 4 months ago

This PR proposes changes to the smart contract to incorporate a full transaction format for L1 deposit events, aiming to standardize them with L2 transactions.

Rationale

Proposed Changes

Modify the smart contract so that users making L1 deposits will be required to provide "deposit transaction" data matching the L2 format through a smart contract entry point. This data must align with the amount of tokens transferred and the identity of the transaction caller, ensuring consistency and integrity between L1 deposits and the L2 transaction format.

NOTE: Build is currently failing because of kairos-l1-utils introduced in feature/deposit-contract.

Discussion Points

  1. Security: Does requiring signatures for all transactions, including those from L1, potentially increase security?
  2. Consistency and Integrity: By generating a transaction hash for deposits, we enhance the integrity and auditability of our records. How significant is this advantage?
  3. Comparison with Other L2s

Feedback and Future Discussion

This PR is tagged with "needs-discussion" to engage the team in evaluating the benefits and implications of integrating a unified transaction format. Feedback and discussions on this proposal are expected to occur after the MVP phase, as it is not an immediate requirement for the initial launch.


Future work

  1. [x] Rebase PR after smart contract is merged (#51).
  2. [x] Fix kairos_crypto compatibility with no_std - #123.
  3. [x] Fix kairos_tx compatibility with no_std - #126.
  4. [ ] Update tests.
  5. [ ] Mark PR as ready.