I'm making a flow of creating a transaction offline, and publish it using external node (etherscan.io).
So the flow will go from here:
- I will use this code to generate a signed raw tx
var { Transaction } = require('@ethereumjs/tx'); var web3utils = require("web3-utils"); const txParams = { from: '0x0000000000000000000000000000000000000000', to: '0x0000000000000000000000000000000000000000', nonce: web3utils.toHex(0), gasPrice: web3utils.toHex(1000000000), gasLimit: web3utils.toHex(50000), value: web3utils.toHex( web3utils.toWei("0.1", "ether"), ), } const tx = Transaction.fromTxData(txParams) const privateKey = Buffer.from( 'e331b6d69882b4cb4........67688d3dcffdd2270c0fd109', 'hex', ) const signedTx = tx.sign(privateKey) const serializedTx = signedTx.serialize(); const rawTx = serializedTx.toString("hex"); console.log(rawTx); //f86b808432c35......67904d240 - I will copy and paste the rawTx (f86b808432c35......67904d240) to https://etherscan.io/pushTx
Is it possible to get my private key from the rawTX by decoding it somehow? or is it safe to make the rawTx public?
Thank you