Bitcoin Forum
May 09, 2024, 07:42:00 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What file format you recommend to save a signed transaction to broadcast later?  (Read 107 times)
remotemass (OP)
Legendary
*
Offline Offline

Activity: 1117
Merit: 1016


ASMR El Salvador


View Profile WWW
December 20, 2020, 01:05:51 PM
 #1

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.








 











{ Imagine a sequence of bits generated from the first decimal place of the square roots of whole integers that are irrational numbers. If the decimal falls between 0 and 5, it's considered bit 0, and if it falls between 5 and 10, it's considered bit 1. This sequence from a simple integer count of contiguous irrationals and their logical decimal expansion of the first decimal place is called the 'main irrational stream.' Our goal is to design a physical and optical computing system system that can detect when this stream starts matching a specific pattern of a given size of bits. bitcointalk.org/index.php?topic=166760.0 } Satoshi did use a friend class in C++ and put a comment on the code saying: "This is why people hate C++".
1715240520
Hero Member
*
Offline Offline

Posts: 1715240520

View Profile Personal Message (Offline)

Ignore
1715240520
Reply with quote  #2

1715240520
Report to moderator
1715240520
Hero Member
*
Offline Offline

Posts: 1715240520

View Profile Personal Message (Offline)

Ignore
1715240520
Reply with quote  #2

1715240520
Report to moderator
1715240520
Hero Member
*
Offline Offline

Posts: 1715240520

View Profile Personal Message (Offline)

Ignore
1715240520
Reply with quote  #2

1715240520
Report to moderator
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715240520
Hero Member
*
Offline Offline

Posts: 1715240520

View Profile Personal Message (Offline)

Ignore
1715240520
Reply with quote  #2

1715240520
Report to moderator
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16620


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 20, 2020, 01:28:14 PM
Merited by pooya87 (1)
 #2

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.

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.
Like this:
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!).

NotATether
Legendary
*
Online Online

Activity: 1596
Merit: 6731


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 20, 2020, 02:22:47 PM
Merited by LoyceV (4), pooya87 (1)
 #3

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16620


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 20, 2020, 03:16:38 PM
 #4

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.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
December 20, 2020, 08:13:23 PM
 #5

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)

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10555



View Profile
December 21, 2020, 05:30:19 AM
 #6

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!