Skip to content

Action

Basic interaction unit in an MRU

Actions are the fundamental unit of interaction. They are the building block of a state machine that captures the user's input. These are analogous to transactions in a regular blockchain system with the difference that these are just signed messages that the users send to the micro-rollup.

Actions are used to trigger a state mutation in the MRU which is handled by the state transition function.

graph LR A[User] --> B(Action) B --> C(State Transition Function) C --> D[New State]

Actions vs transactions

Actions are similar to transactions in a blockchain system. The key difference is that actions are not broadcasted to any network. They are just signed messages that the users send to the micro-rollup.

Action Cost

Stackr does not enforce a cost for an action in this version. However, Micro-Rollup developers are free to design their actions to include a cost component to charge users.

Action Format

In a gist, an action has the following properties to be able to mutate a state machine:

interface IAction {
  name: string;
  msgSender: string;
  signature: string;
  inputs: AllowedInputTypes;
}
  • name: Name of the state transition function.
  • msgSender: The address of the user who sent the action.
  • signature: The signature of the action. This is used to authenticate the user who signed the action.
  • inputs: The user-provided payload of the action. This is the actual data that the action is supposed to mutate the state with.

Action Creation & Submission

This is covered as part of the Counter Rollup Tutorial.

EIP-712 Signing

EIP-712 is a standard for signing structured data. It is used to sign actions in this version of Stackr. This also makes Stackr Actions compatible with existing browser wallet extensions and other EVM-friendly wallet implementations.

Action Execution

Once the action is submitted, it goes in the rollup's action pool, similar to a traditional mempool. The action stays in the pool until picked up by a sequencer.

The sequencer picks up the action, creates a block and sends that block to the executor. The executor then executes the block and updates the state of the rollup.