Types
Transaction types in Quai Network.
Overview
Quai Network transactions are split into 3 different types, or categories depending on where they are executed.
- Type 0: Quai Transaction: A transaction executed on the Quai ledger within a single shard.
- Type 1: External Transaction: Transactions that cross shards or serve special network functions, such as miner payouts or Quai/Qi conversions.
- Type 2: Qi Transaction: UTXO style transactions processed on the Qi Ledger.
Type 0: Quai Transaction
Type 0 transactions are transactions that are executed within a single shard on the Quai ledger. They follow a similar format to traditional EVM transactions and can be used to transfer Quai tokens, interact with a smart contract, or deploy a new smart contract.
Structure
type
field is always 0x0
. Key Properties
- ECDSA signatures (V, R, S)
- Includes
chainID
andnonce
fields for replay protection - Support for EIP-1559 style gas pricing
- Includes
accessList
field for EIP-2930 support
Type 1: External Transaction
Type 1 transactions can be split into 5 sub-types:
- 0 Cross-Shard Transactions: Used for transferring value or data between different shards.
- 1 Coinbase Transactions: Special transactions that payout block rewards and fees.
- 2 Conversion Transactions: Native protocol conversions between Quai and Qi.
- 3 Coinbase Lockup Transactions: Used for locking up coinbase rewards on a contract address.
- 4 Wrapping Qi Transactions: Used for wrapping Qi tokens on Quai ledger.
Type 1 transactions, regardless of subtype, are never directly initiated by a user. They are always intiated directly by the protocol, following either a Type 0 or Type 2 transferring value across shards, a network designated miner payout, or a Quai/Qi conversion also initiated following a Type 0 or Type 2 transaction.
Last 32 bytes of the input field of External Transaction type (Coinbase, Coinbase Lockup) has the workshare hash for which this payment is generated for.
Structure
Key Properties
- Includes
etxType
property to indicate the transaction sub-type. Available subtypes arecoinbase
,conversion
, andetx
- Contains the
originatingTxHash
to identify the transaction that initiated the Type 1 transaction - Includes
ETXIndex
for ordering multiple external transactions from a single origin - Does not include or require any signatures
Type 2: Qi Transaction
Type 2 transactions are transactions that are executed within a single shard on the Qi ledger. They follow a similar format to traditional UTXO transactions and can be used to transfer Qi tokens of specific denominations.
Qi Transactions utilize previous unspent outputs of an address as inputs for every transaction.
Structure
txType
field is always 2
for Qi transactions.Key Properties
- Uses Schnorr and Musig signatures
- UTXO-like input and output transaction structures
- Does not include gas or data related fields
Was this page helpful?