0

Do you know what is the purpose to serialize a transaction?

Here is an example: const serializedTransaction = tx.serialize()

Thank you

Take care

Pierre

1

Serialization is used when an object needs to be represented in a string format. This is a requirement often for various transfer and storage protocols, which only understand how to use a string value but don't understand what should be done with a (custom) object.

Typically you serialize an object into for example JSON format string, transfer the string somewhere and deserialize it back into the original object format at the other end. Or for storage you may serialize the object, store the string and when needed you can retrieve the string and deserialize the original object back from the string format.

So if you want your transaction to be in string format you can serialize it.

1
  • Thank you Lauri – Pierre Sep 16 '20 at 19:10

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.