Class Transaction4844

All Implemented Interfaces:
ITransaction

public class Transaction4844 extends Transaction1559 implements ITransaction
EIP-4844 blob transaction (also extended for EIP-7594 / Fusaka PeerDAS).

Wire format variants:

  • EIP-4844 network wrapper (Cancun/Prague): rlp([tx_payload_body, blobs, commitments, proofs])
  • EIP-7594 network wrapper (Fusaka/Osaka): rlp([tx_payload_body, wrapper_version, blobs, commitments, cell_proofs])

EIP-7594 cell_proofs is a flat list of CELLS_PER_EXT_BLOB × len(blobs) 48-byte KZG proofs. CELLS_PER_EXT_BLOB = 128 (FIELD_ELEMENTS_PER_EXT_BLOB=8192 / FIELD_ELEMENTS_PER_CELL=64).

  • Field Details

    • CELLS_PER_EXT_BLOB

      public static final int CELLS_PER_EXT_BLOB
      Number of cells in an extended blob (EIP-7594 / PeerDAS).
      See Also:
    • KZG_PROOF_BYTE_LENGTH

      public static final int KZG_PROOF_BYTE_LENGTH
      Expected byte length of each KZG proof / commitment (G1 compressed point).
      See Also:
    • WRAPPER_VERSION_1

      public static final BigInteger WRAPPER_VERSION_1
      Only supported wrapper_version value per EIP-7594.
    • MAX_BLOBS_PER_TRANSACTION

      public static final int MAX_BLOBS_PER_TRANSACTION
      Maximum number of blobs per transaction (EIP-7594 spec requirement).
      See Also:
  • Constructor Details

  • Method Details

    • asRlpValues

      public List<org.web3j.rlp.RlpType> asRlpValues(Sign.SignatureData signatureData)
      Returns the RLP field list for the transaction payload body only (tx_payload_body). When signatureData is not null, includes v/r/s and then delegates to buildNetworkWrapper(Sign.SignatureData) to append the blob sidecar.
      Specified by:
      asRlpValues in interface ITransaction
      Overrides:
      asRlpValues in class Transaction1559
    • createTransaction

      public static Transaction4844 createTransaction(List<Blob> blobs, List<org.apache.tuweni.bytes.Bytes> kzgCommitments, List<org.apache.tuweni.bytes.Bytes> kzgProofs, long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas, List<org.apache.tuweni.bytes.Bytes> versionedHashes)
      Create an EIP-4844 transaction with an explicit blob sidecar.
      Parameters:
      blobs - list of blobs (one per versioned hash)
      kzgCommitments - KZG commitments matching blobs
      kzgProofs - one KZG proof per blob
      versionedHashes - blob versioned hashes derived from commitments
    • createTransaction

      public static Transaction4844 createTransaction(List<Blob> blobs, List<org.apache.tuweni.bytes.Bytes> kzgCommitments, List<org.apache.tuweni.bytes.Bytes> kzgProofs, long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas, List<org.apache.tuweni.bytes.Bytes> versionedHashes, List<AccessListObject> accessList)
      Create an EIP-4844 transaction with an explicit blob sidecar and access list.
      Parameters:
      blobs - list of blobs (one per versioned hash)
      kzgCommitments - KZG commitments matching blobs
      kzgProofs - one KZG proof per blob
      versionedHashes - blob versioned hashes derived from commitments
      accessList - optional EIP-2930 access list
    • createTransaction

      public static Transaction4844 createTransaction(List<Blob> blobs, List<org.apache.tuweni.bytes.Bytes> kzgCommitments, List<org.apache.tuweni.bytes.Bytes> cellProofs, BigInteger wrapperVersion, long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas, List<org.apache.tuweni.bytes.Bytes> versionedHashes)
      Create an EIP-7594 (Osaka/Fusaka) transaction with PeerDAS cell proofs.
      Parameters:
      blobs - list of blobs
      kzgCommitments - KZG commitments matching blobs (one per blob)
      cellProofs - flat list of cell proofs: CELLS_PER_EXT_BLOB * len(blobs) 48-byte proofs in blob-major order
      wrapperVersion - must be WRAPPER_VERSION_1 (BigInteger.ONE)
      versionedHashes - blob versioned hashes derived from commitments
    • createTransaction

      public static Transaction4844 createTransaction(List<Blob> blobs, List<org.apache.tuweni.bytes.Bytes> kzgCommitments, List<org.apache.tuweni.bytes.Bytes> cellProofs, BigInteger wrapperVersion, long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas, List<org.apache.tuweni.bytes.Bytes> versionedHashes, List<AccessListObject> accessList)
    • createTransaction

      public static Transaction4844 createTransaction(List<Blob> blobs, long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas)
      Create a blob transaction with auto-computed commitments/proofs.
    • createEip7594Transaction

      public static Transaction4844 createEip7594Transaction(List<Blob> blobs, long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas)
      Create an EIP-7594 (Osaka/Fusaka) transaction directly from raw blobs. The KZG commitments, the flat CELLS_PER_EXT_BLOB * len(blobs) cell proofs, and the blob versioned hashes are all computed automatically via BlobUtils.
      Parameters:
      blobs - the raw blobs
    • createEip7594Transaction

      public static Transaction4844 createEip7594Transaction(List<Blob> blobs, long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas, List<AccessListObject> accessList)
      Create an EIP-7594 (Osaka/Fusaka) transaction directly from raw blobs, with an access list. The KZG commitments, flat cell proofs, and versioned hashes are computed automatically.
      Parameters:
      blobs - the raw blobs
      accessList - optional EIP-2930 access list
    • createTransaction

      public static Transaction4844 createTransaction(long chainId, BigInteger nonce, BigInteger maxPriorityFeePerGas, BigInteger maxFeePerGas, BigInteger gasLimit, String to, BigInteger value, String data, BigInteger maxFeePerBlobGas, List<org.apache.tuweni.bytes.Bytes> versionedHashes)
      Create a tx-only EIP-4844 transaction (no sidecar, versioned hashes only).
    • getMaxFeePerBlobGas

      public BigInteger getMaxFeePerBlobGas()
    • getVersionedHashes

      public List<org.apache.tuweni.bytes.Bytes> getVersionedHashes()
    • getBlobs

      public Optional<List<Blob>> getBlobs()
    • getKzgCommitments

      public Optional<List<org.apache.tuweni.bytes.Bytes>> getKzgCommitments()
    • getKzgProofs

      public Optional<List<org.apache.tuweni.bytes.Bytes>> getKzgProofs()
    • getWrapperVersion

      public Optional<BigInteger> getWrapperVersion()
    • getCellProofs

      public Optional<List<org.apache.tuweni.bytes.Bytes>> getCellProofs()
      Returns the flat cell_proofs list for EIP-7594 transactions. Size = CELLS_PER_EXT_BLOB * len(blobs) when present.
    • getRlpVersionedHashes

      public List<org.web3j.rlp.RlpType> getRlpVersionedHashes()
    • getRlpKzgCommitments

      public List<org.web3j.rlp.RlpType> getRlpKzgCommitments()
    • getRlpKzgProofs

      public List<org.web3j.rlp.RlpType> getRlpKzgProofs()
    • getRlpBlobs

      public List<org.web3j.rlp.RlpType> getRlpBlobs()
    • getRlpCellProofs

      public List<org.web3j.rlp.RlpType> getRlpCellProofs()
      Returns the RLP encoding of cell_proofs as a flat list of RlpStrings. Each element is one 48-byte proof. EIP-7594 spec: cell_proofs is a flat list, NOT a list of lists.
    • getType

      public TransactionType getType()
      Specified by:
      getType in interface ITransaction
      Overrides:
      getType in class Transaction1559