Author

Topic: How to see transaction size when creating raw transactions? (Read 374 times)

member
Activity: 80
Merit: 11
Thank you!
HCP
legendary
Activity: 2086
Merit: 4361
Both the createrawtransaction and signrawtransaction commands should give you the "hex" output of the transaction. The number of characters in that hex string divided by 2 should equal the the transaction size in bytes... as a byte is represented as 2 characters.

For instance, take this raw transaction:
Code:
01000000016efac358d35ea862e8d88b96538acd86b8888e02201535f91bca0fb9bc239c25010000006b483045022100ad50c9e46dbb52b3dbcac8386c41eeac7a4aad2531d6ca708f6a12da2d6754250220448eee510d37db8fb77b462c87dda89233e494355b933df3413b4d985267f2f9012102ffdf17c600f3a3afdf6c946759d65e7923b4bc698ac2e80357b212a56048bdaeffffffff0280234300000000001976a9143c920a4de91cdb35f139d153d7fa5ba379a99c4d88ac3cbbbe2f000000001976a914f13ac2940f286e32da783b27bcf2223c4f23f06d88ac00000000

Length = 452... so the transaction size = 226 bytes.

You can also use the decoderawtransaction command and it will output the JSON of the transaction and you can see the "size" and/or "vsize" elements at the top:

member
Activity: 80
Merit: 11
After I successfully created and signed a raw transaction with bitcoind-cli, is there a way to see the size of it in bytes, the one that is used for fee per byte calculations?
Jump to: