Facet Docs
  • 1. Introduction
    • Overview of Facet Protocol
    • What is Layer 1+?
    • The Based Sovereign Rollup
  • 2. Getting Started
    • Connecting a Wallet
    • Sending Transactions
    • Bridging In (and Out)
    • What about Gas?
    • Facet Apps
  • 3. Technical Details
    • Introduction
    • Facet RPC & Explorer
    • Genesis Contracts
    • Facet Transactions
      • From Calldata
      • From Event Logs
    • Facet Typescript SDK
    • Facet Sol (Foundry)
    • Chain State Derivation
    • Running a Facet Node
    • Bridging Assets
    • Building an Optimistic Bridge on Facet
    • Basic Transaction Flow
    • Facet's Gas Mechanism
      • FCT Issuance Calculation
      • FCT Gas Fee Calculation
    • Security Audits
  • 4. Community & Support
    • FAQs
    • Comparison with Other Rollups
    • Micro-Grants
    • Community Resources
    • Brand Kit
Powered by GitBook
On this page
  1. 3. Technical Details
  2. Facet Transactions

From Calldata

PreviousFacet TransactionsNextFrom Event Logs

Last updated 5 months ago

Facet Transactions in Ethereum L1 Tx Calldata

To create a Facet transaction as an EOA, you send a successful (receipt status = 1) Ethereum transaction to the Facet inbox address, an EOA account on Ethereum L1 with no known private key:

0x00000000000000000000000000000000000face7

We refer to these L1 transactions as envelopes, as they carry an RLP-encoded Facet transaction as a "payload" within their calldata. The signer of an Ethereum envelope transaction determines the "from" on a Facet transaction.

Here's how you might do this using Viem:

const transactionData = [
  toHex(l2ChainId),
  to ?? "0x",
  value ? toHex(value) : "0x",
  gasLimit ? toHex(gasLimit) : "0x",
  data ?? "0x",
  mineBoost ?? "0x"
];

const encodedTransaction = concatHex([toHex(70), toRlp(transactionData)]);

const l1Transaction = {
  account: l1WalletClient.account,
  to: "0x00000000000000000000000000000000000face7",
  value: 0n,
  data: encodedTransaction,
  chain: l1WalletClient.chain,
};

await l1WalletClient.sendTransaction(l1Transaction);