TESTNET ONLINE: PECORINO PECORINO

Host-originating Transactions

Transactions on Signet may originate from Ethereum. These occur in the following cases:

  • The mainnet Passage contract emits a Enter event.
  • The mainnet Passage contract emits a EnterTokens event.
  • The mainnet Transactor contract emits a Transact event.

Each of these events will result in a system transaction being created on Signet. System transactions

The basics

Host-originating transactions are treated as normal EIP-1559 transactions on Signet. A transaction is generated, consumes a nonce, and produces a receipt. The transaction will be retrievable over RPC, and will be included in the Signet block.

Host-originating transactions occur LAST in the block, after all other transactions. This means that they will not affect the state of the block until all other transactions have been processed. The processing order is as follows:

  • Enter
  • EnterTokens
  • Transact

What’s a MagicSig?

Host-originating transactions aren’t “signed” by a private key. Instead, they use the signature feld of the event to create a MagicSig. This is a special signature that contains metadata about the event, rather than cryptographic information. A MagicSig will contain at least the following fields:

  • txid - The transaction ID of the Host transaction that originated the Signet transaction.
  • event_index - The index of the event that originated the Signet transaction in the host transaction’s receipt’s logs.

Consult the MagicSig documentation for a technical specification details.

Enters

When a Enter event is emitted by the host Passage, a system transaction is created that reflects minting the native asset on Signet. The transaction will have the following properties:

Transaction properties:

  • gas_limit: 21,000
  • max_fee_per_gas: 0
  • max_priority_fee_per_gas: 0
  • nonce: the latest nonce for the MINTER_ADDRESS (0x00000000000000000000746f6b656e61646d696e)
  • to: set to the account for which the native asset is being minted.
  • value: the amount of native asset being minted, in wei.

Receipt properties:

  • status: 1 (success)
  • logs: 1 log, containing an Enter system log (see format below)
 1event Enter(
 2    // The transaction hash of the host transaction that emitted this event
 3    bytes32 indexed txHash,
 4    // The index of the event in the host transaction's logs
 5    uint64 indexed logIndex,
 6    // The address of the recipient of the native asset
 7    address indexed recipient,
 8    // The amount of native asset being minted, in wei
 9    uint256 amount,
10);

EnterTokens

When a EnterTokens event is emitted by the host Passage, a system transaction is created that reflects minting an ERC-20 token on Signet. The transaction will have the following properties:

  • Transaction properties:

  • gas_limit: 21,000

  • max_fee_per_gas: 0

  • max_priority_fee_per_gas: 0

  • nonce: the latest nonce for the MINTER_ADDRESS (0x00000000000000000000746f6b656e61646d696e)

  • to: set to the address of the token contract.

  • value: 0 (no native asset is being transferred).

  • input: an ABI-encoded call to the mint(address recipient, uint256 amount) function of the token contract, where recipient is the address receiving the tokens and amount is the amount of tokens being minted.

Receipt properties:

  • status: 1 (success)
  • logs: 2 logs
    • A standard ERC-20 Transfer event emitted by the token contract.
    • An EnterTokens system log (see format below).
 1event EnterToken(
 2    // The transaction hash of the host transaction that emitted this event
 3    bytes32 indexed txHash,
 4    // The index of the event in the host transaction's logs
 5    uint64 indexed logIndex,
 6    // The address of the recipient of the tokens
 7    address indexed recipient,
 8    // The address of the token contract
 9    address token,
10    // The amount of tokens being minted (ignoring decimals)
11    uint256 amount,
12);

Transact

When a Transact event is emitted by the host Transactor, it triggers a transaction from the user’s Signet account. This transaction will have the following properties:

Transaction properties:

  • gas_limit: as specified in the Transact event.
  • max_fee_per_gas: as specified in the Transact event.
  • max_priority_fee_per_gas: 0.
  • nonce: the latest nonce for the user’s Signet account.
  • to: the address specified in the Transact event.
  • value: as specified in the Transact event.
  • input: the data specified in the Transact event.

Receipt properties:

  • status: depends on the success of the transaction.
  • logs: all logs emitted by the transaction, plus a Transact system log (see format below).
 1event Transact(
 2    // The transaction hash of the host transaction that emitted this event
 3    bytes32 indexed txHash,
 4    // The index of the event in the host transaction's logs
 5    uint64 indexed logIndex,
 6    // The address originating the transaction on Signet (this is the
 7    // msg.sender in the Host Transact contract)
 8    address indexed sender,
 9    // The value of native asset being transferred in the transaction
10    uint256 value,
11    // The gas limit for the transaction
12    uint256 gas,
13    // The max fee per gas for the transaction
14    uint256 maxFeePerGas,
15);