0xMiden / 0xMiden/protocol

Introduce a mechanism to allow foreign accounts to mutate the transaction

Offen
#1,766 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
kernels
Vorherrschende Sprache
Rust
Sterne
132
Forks
167
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
110

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.