2

Can you decode this transaction:

Etherscan tx:

0x02f8740181f1843b9aca00851535cf027f82520894e0e5d2b4edcc473b988b44b4d13c3972cb6694cb8801ea8d467f558e1e80c001a07eb3335f4fd4de25ec3452c08882f28fb098b2eaa37a332941f918d869f5c2ada059b9d4aa997c7fa34f1b167f98a12432bb1a4a35660d723a9c19bb76b4cd025d

What I need is the decoding formula for the new eth raw transactions

1
  • Maybe add some context. Where did it come from. Is there are URL or a etherscan tx you can point to....
    – j2abro
    Apr 22, 2022 at 20:05

1 Answer 1

0

It is not an exact answer of the question. But it helps to prepare the ethereum transaction data EIP-1559.

We can check the hex using the broadcast transaction link provided by etherescan. It returns TxID if the raw data is valid. Otherwise shows error.

for goerlie testnet : https://goerli.etherscan.io/pushTx

Steps to prepare a EIP-1559 transaction using web3j

1.RawTransaction.createTransaction(chainId, nonce, gasLimit, to, value, data, maxPriorityFeePerGas, maxFeePerGas)
2. TransactionEncoder.encode(rawTransaction) // from sept1
3. Hash.sha3(encodedTx) // from step2
4. Sign the hash using private key 
5. Convert the sign to Sign.SignatureData

Then Prepare the raw transaction

public String prepareRawTransactionWithSignature(RawTransaction transaction, Sign.SignatureData signatureData) {

    // encode signature data
 List<RlpType> values = transaction.getTransaction().asRlpValues(signatureData);
 RlpList rlpList = new RlpList(values);
 byte[] encoded = RlpEncoder.encode(rlpList);
 if (!transaction.getType().equals(TransactionType.LEGACY)) {
        encoded = ByteBuffer.allocate(encoded.length + 1)
                .put(transaction.getType().getRlpType())
                .put(encoded)
                .array();
 }
    String serializedTxHex = Numeric.toHexString(encoded);
 log.info("Serialized tx {}", serializedTxHex);
 return serializedTxHex;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.