I have a types.Transaction object.

How can I encode this to receive the raw transaction hex?

Something like this:


1 Answer 1


You can use Transaction.MarshalBinary to obtain the rlp encoded raw transaction and then use common.Bytes2Hex to create the hex string.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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