0xMiden / 0xMiden/protocol

Introduce a mechanism to allow foreign accounts to mutate the transaction

Abierto
#1,766 1 comentario 2 reacciones 0 asignados Ver en GitHub
kernels
Lenguaje dominante
Rust
Estrellas
132
Forks
167
Merge medio
1 d 23 h
PR fusionados (30 d)
110

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.