Consider the following scenario:

  • create an entire bitcoin raw transaction while offline (no access to the blockchain)
  • only when you decided to broadcast it that you would need to get online

Is it possible to do such offline transaction? Exactly what fields you need from the blockchain in order to build such raw transaction?

  • relevant : en.bitcoin.it/wiki/… – Charles S Nov 12 '15 at 22:09
  • Charles S, how could you possibly be that fast ??? – Mark Messa Nov 12 '15 at 22:10
  • 2
    I'm a robot beep boop. Honestly I just happened to be checking when you posted. I know the link isn't exactly what you were looking to do, but was hoping it might provide some insight into how it might be able to be done. Hopefully someone more knowledgeable will have a direct answer for you. – Charles S Nov 12 '15 at 22:12
  • possibly also relevant: bitcoin.stackexchange.com/questions/8101/… – Charles S Nov 12 '15 at 22:22
  • > "I'm a robot beep boop." Charles S, it seems that you passed the 'turing test' – Mark Messa Nov 13 '15 at 13:08
up vote 1 down vote accepted

Not in a user-friendly way, no.

Simple version

Your offline Bitcoin client needs more information to identify which coins it is spending, so there needs to be some communication from the online computer to the offline computer. Typically, this is done by preparing most of the transaction on the online computer, then transferring it flash drive to the offline computer to be signed.

Technical version

You need the outpoint, scriptPubKey, and amount of each input you want to spend. The outpoint is composed of the 256 bit hash of the transaction that sent you the Bitcoins, and a small integer showing which output of that transaction you're spending. You also need the scriptPubKey to tell you which key you need to use to sign the transaction. You need to know the amount so that you can specify the correct amount of change to send back to yourself. (Otherwise, the unspent money will just go to the miner.) This requires about 61 bytes of space per input. If a single input doesn't have enough to cover the transaction, you'll need to combine multiple inputs.

You could definitely ask the user to manually transcribe/renter this information, but I think that's asking for a mistake.

  • What I do not get is, how do these offline transactions 'settle'? If I have an offline wallet with balance as 10 BTC, then in the offline period both credits and debits would have happened to/from this wallet such that, the credit and debit wallets were offline too. For example, a merchant and a buyer were probably both offline when a sale was made. Then, this transaction needs to be settled on the block-chain whenever either/both of the parties come online. Note that, the wallet should maintain the balance w.r.t. unsettled transactions too to avoid double spend. – cogitoergosum Jan 5 '17 at 4:27
  • @cogitoergosum The online computer creates an unsigned 'debit' referencing the 'credit' transactions that are in the blockchain. The offline computer signs it. The signed transaction goes back to the online computer on a flash drive. If you want to send someone money, they do not need to be online. – Nick ODell Jan 5 '17 at 4:45
  • @NickODell my question was around the possibility that, the credit transaction may not have made into the block chain either. Let me raise a separate question. – cogitoergosum Jan 5 '17 at 4:58
  • I created this question to further elaborate: bitcoin.stackexchange.com/q/50568/6975 – cogitoergosum Jan 5 '17 at 5:38

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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