Author

Topic: What file format you recommend to save a signed transaction to broadcast later? (Read 125 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
As other mentioned, plain text (.txt) are best format you could use. For extra caution, make sure it uses standard encoding (AFAIK it's UTF-8 and ANSI), since few application have trouble when your file has non-standard encoding.

Image file which contain QR code of signed transaction (which shown by @LoyceV) is more convenient if you're mobile user and have bitcoin wallet software which can scan QR code of signed transaction and broadcast it.

and creating a PDF is a very complicated process that involves using things like TeX and *latex (and there are several kinds of latex programs such that it's confusing to beginners).

Most people usually just use word (with gdrive, ms office or open office) or markdown file and convert it to PDF, it's easier than learning TeX-based format.
legendary
Activity: 3472
Merit: 10611
It depends on how you are going to consume the file later.
  • A .txt file containing the transaction in hexadecimal format can be opened almost everywhere and copied to be pasted in almost any wallet and any online (web) tool to be broadcast.
  • A JSON file that contains the deserialized transaction is not useful since you have to serialize it again to be able to use it anywhere; unless you have a code already that saves and reads this file itself. Although there is no point in saving it like that.
  • Any special format like the one Electrum uses (.txn file) is going to be specific to that wallet/tool and may not be usable in any other tool. (Electrum .txn files are the raw hex inside a JSON).
  • Saving it as data (.dat) and writing the bytes to disk will produce the smallest file (half the size of the hex) but can only be read using a program (they aren't human readable).
  • QR code is only good for visual representation and is useful when you have an airgap cold storage that you don't want to connect anything (like a USB disk) to.
HCP
legendary
Activity: 2086
Merit: 4318
What file format do you recommend to save a signed transaction to broadcast much later?
I suppose I should save it in a text file (.txt) or in a pdf file using just plain text with JSON or XML.
Yes, just use a text file. There is no reason to save it as a PDF, aside from being a hassle to create in the first place, you will likely run into issues when trying to extract the data back out of the PDF (They're designed and made for reading, not for transferring data).

Quote
Actually, I don't have a clear idea of how does a signed transaction ready to be broadcasted and validated by the bitcoin network (and eventually entering the blockchain) does look like in plain text.

As shown, a signed transaction is just a long sequence of "hex" characters:
Code:
010000000126063a71fecd0c76fa7d31a561cbe95bf2c7e5da01ae04fed6a6e9dfbc80953e010000006a47304402201a16d89264518baca8f4959b446372c6ce91e8d1fbc0b7b48618aeb76113df33022040eb804bf7cd6519d01709066658251cef1822ff49fd07707e058a07b27b42f9012103f78766b4346bcec0f2ae92d7e132e6b321c47627f14356a704b3ce57169dcb4e000000000116260000000000001976a914cfdd1b997472bd0b668e7472d9708305f116994d88acc0270900

You can use a transaction decoder (like this or this or decoderawtransaction in Bitcoin Core) to get the details of the transaction in a JSON format like so:
Code:
{
  "txid": "dc6383e28e4b6c652ab326592652b0322331caf07231cabec562ab116a46ff9c",
  "hash": "dc6383e28e4b6c652ab326592652b0322331caf07231cabec562ab116a46ff9c",
  "version": 1,
  "size": 191,
  "vsize": 191,
  "weight": 764,
  "locktime": 600000,
  "vin": [
    {
      "txid": "3e9580bcdfe9a6d6fe04ae01dae5c7f25be9cb61a5317dfa760ccdfe713a0626",
      "vout": 1,
      "scriptSig": {
        "asm": "304402201a16d89264518baca8f4959b446372c6ce91e8d1fbc0b7b48618aeb76113df33022040eb804bf7cd6519d01709066658251cef1822ff49fd07707e058a07b27b42f9[ALL] 03f78766b4346bcec0f2ae92d7e132e6b321c47627f14356a704b3ce57169dcb4e",
        "hex": "47304402201a16d89264518baca8f4959b446372c6ce91e8d1fbc0b7b48618aeb76113df33022040eb804bf7cd6519d01709066658251cef1822ff49fd07707e058a07b27b42f9012103f78766b4346bcec0f2ae92d7e132e6b321c47627f14356a704b3ce57169dcb4e"
      },
      "sequence": 0
    }
  ],
  "vout": [
    {
      "value": 0.00009750,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 cfdd1b997472bd0b668e7472d9708305f116994d OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914cfdd1b997472bd0b668e7472d9708305f116994d88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1Kx5kYqStfhPQntRv185pTuyafLoaYLrV7"
        ]
      }
    }
  ]
}

Storing as "hex" is the best option as it takes up the least amount of space and can be immediately sent using any Transaction Broadcast tool (website "push tx" tool like this or this or Bitcoin Core sendrawtransaction etc)
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
there are no broadcasters that accept a QR code representation of a transaction as input.
Good point. The QR-code is only useful if you print it and don't want to manually type the transaction to broadcast.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
What file format do you recommend to save a signed transaction to broadcast much later?
Any text-format will do. There's no need to make it more complicated.
Unless you want to make a QR-code out of it, in that case I'd go for PDF. Or just save it as GIF.

PDF is a great format for presenting documents for consumption... but it's notoriously difficult to copy text data from a PDF file. Blank spaces and newlines are inserted at the wrong places in the clipboard, and some characters are changed into similar Unicode characters from PDF to clipboard, and creating a PDF is a very complicated process that involves using things like TeX and *latex (and there are several kinds of latex programs such that it's confusing to beginners).

There's literally no reason not to use a plain text file for the signed transaction because it takes the smallest amount of space, is easy to copy from and paste to some transaction broadcaster, and there are no broadcasters that accept a QR code representation of a transaction as input.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
What file format do you recommend to save a signed transaction to broadcast much later?
Any text-format will do. There's no need to make it more complicated.
Unless you want to make a QR-code out of it, in that case I'd go for PDF. Or just save it as GIF.

I suppose I should save it in a text file (.txt) or in a pdf file using just plain text with JSON or XML.

Signed Recovery Transaction
Code:
010000000126063a71fecd0c76fa7d31a561cbe95bf2c7e5da01ae04fed6a6e9dfbc80953e010000006a47304402201a16d89264518baca8f4959b446372c6ce91e8d1fbc0b7b48618aeb76113df33022040eb804bf7cd6519d01709066658251cef1822ff49fd07707e058a07b27b42f9012103f78766b4346bcec0f2ae92d7e132e6b321c47627f14356a704b3ce57169dcb4e000000000116260000000000001976a914cfdd1b997472bd0b668e7472d9708305f116994d88acc0270900
Image loading...

But I want to learn about it. For instance, it would be very useful to be able to lock some coins and would be sent to someone else's address in the distant future if I did not change my mind in the meantime. This way I would know that if I die someone from my family would receive my coins in the distant future as I would not be able to change my mind after dying. Hope it makes sense.
See Using Locktime for inheritance planning, backups or gifts Smiley
Or play around with Coinb.in (don't enter any private keys on a LIVE website!).
legendary
Activity: 1122
Merit: 1017
ASMR El Salvador
What file format do you recommend to save a signed transaction to broadcast much later?

I suppose I should save it in a text file (.txt) or in a pdf file using just plain text with JSON or XML.

Actually, I don't have a clear idea of how does a signed transaction ready to be broadcasted and validated by the bitcoin network (and eventually entering the blockchain) does look like in plain text.

Even less, how does it look like if it uses smart contracts with "Bitcoin Script".

But I want to learn about it. For instance, it would be very useful to be able to lock some coins and would be sent to someone else's address in the distant future if I did not change my mind in the meantime. This way I would know that if I die someone from my family would receive my coins in the distant future as I would not be able to change my mind after dying. Hope it makes sense.








 










Jump to: