0xMiden / 0xMiden/protocol

Introduce a mechanism to allow foreign accounts to mutate the transaction

Đang mở
#1,766 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
kernels
Ngôn ngữ chính
Rust
Star
132
Fork
167
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
110

Mô tả

This issue is essentially a follow-up to https://github.com/0xMiden/miden-base/issues/1543. As discussed there, it would be good for some scenarios if foreign accounts were able to mutate the native account. One example is a foreign oracle account that, upon reading data from it, will create a note for itself with a fee for its oracle serivces.

Currently, foreign accounts are read-only and cannot mutate anything, due to various `assert_native_account` restrictions on kernel procedures. Overall, there are two ideas for dealing with this:
- Allow foreign accounts to always mutate the current transaction (see the discussion in the above issue).
- Allow users to control whether foreign accounts have mutatable control or not. Options are to have this controllable on a transaction-wide basis (e.g. all procedures are callable by foreign accounts or none) or a per-procedure basis (e.g. only account interface procedures are callable by foreign accounts that internally call `account_add_asset`).

This would be relevant at least for these kernel procedures:
- `account_add_asset`
- `account_remove_asset`
- `account_set_item`
- `account_set_map_item`
- `faucet_mint_asset`
- `faucet_burn_asset`
- `tx_create_note`

So we should decide whether or not to allow foreign accounts to call account interface procedures that call these kernel procedure internally, such as `BasicWallet::receive_asset` or `BasicWallet::move_asset_to_note`, and in what capacity.

If we happen to do this after mainnet, we should make this decision _before_ removing `assert_native_account` from any of the procedures. Introducing a control mechanism _after_ removing `assert_native_account` could be considered a breaking change. So these should be introduced together.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.