Bitcoin Forum
September 21, 2018, 10:47:13 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: [ANN/RFC] Offbit - off grid Bitcoin TXs - v0.001  (Read 2426 times)
hobbes
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
February 26, 2014, 04:27:55 PM
 #1

Minimalistic offline key generation, offline TX signing and Tor protected TX broadcasting.

Keep your private key at a reasonable distance from online systems and any persistent storage such as hard drives, USB sticks.

Will run on Python 2.7.x without installation of additional dependencies so it can be run from most Linux live CDs. Torified data retrieval/broadcasting through blockchain.info via pybitcointools.

https://github.com/bithobbes/offbit

No need to trust me. You can compare the libraries to the original ones. The actual code is very short.

readme.md:
Code:
offbit
======
v0.001
2014 hobbes / bitcointalk
https://github.com/bithobbes/offbit

Basic off grid Bitcoin storage and TXs. Helps with hodling. Tor protected retrieval/broadcasting via blockchain.info.

Alpha software. Nothing guaranteed. Maximum recommendend amount: see version number.

https://www.gnu.org/copyleft/gpl.html

### Files
* offbit_keygen_offline.py - generate (mnemonic) privkeys
* offbit_mktx1_online.py - start transaction (also broadcast)
* offbit_mktx2_offline.py - sign transaction

### How to use
Generate (mnemoic) privkeys via offline keygen, load them and keep them safe (bring one half to the bank). Then:

1. Optional: Start Tor Browser to set up a Tor socket to be used by offbit.
2. Use mktx1 to create a transaction.
3. Save offbit data to a USB stick (text file).
4. Move the stick into an old offline computer, booted from a Linux Live CD (knoppix.org). Needs Python but no WiFi, no bluetooth.
5. Start mktx2 and feed it the data (currently a manual process).
6. Remove the USB stick so that there is no persistent data (no USB stick, no harddrive, no SD card)
7. Verify the TX, enter your privkey and sign.
8. Transport the signed transaction to the online computer via QR code (designated reader, synced clipboard or manually)
9. Broadcast the signed transaction by finishing mktx1

You will be guided through the steps.

Step 8. works completely automatic with Windows/ClipSync & Android/ZXBarcodeScanner.

### QR Code Scanner
Use only open source Zebra Crossing Barcode Scanner as the other scanners sniff your data (hurting your privacy).
Helpful options:
* inverted image scan (negative)
* copy to clipboard (automatically on scan)

### Clipboard syncing
* Windows & Android: ClipSync (data stays within you local WiFi)
     hint: will only sync when clipboard content has changed (will not sync on the second scan when scanning twice)
* Linux & Android: ?
* Mac & iOS: ???

### Limitations
* Only small TXs will fit into the QR code.

### Todo
* add manual random data for tx generation
* encrypt offbit transport data
* check if TX to publish matches original TX
* find open source clipboard local sharing software

### Based on
* https://github.com/vbuterin/pybitcointools (thanks vitalik!)
* https://github.com/unapiedra/pyqrnative
* https://github.com/spesmilo/electrum (mnemonic.py)

offbit_keygen_offline.py - generate (mnemonic) privkeys
Code:
len(wordList): 1626
Enter some random characters and press <enter>.
3764bc5r7w8cr6wc9
Enter a title for this paper wallet and press <enter>.
hodl
working...

--------------------------------------------------------------------------------

hodl
Electrum 1.x seed part 1 of 2   copy A
rootAddress: 1BLfktq4TVtwyV1TdeRH839xJLXQLpr6nm
decision society situation circle size grief close shall relationship desire inn
ocence roll

--------------------------------------------------------------------------------

hodl
Electrum 1.x seed part 1 of 2   copy B
rootAddress: 1BLfktq4TVtwyV1TdeRH839xJLXQLpr6nm
decision society situation circle size grief close shall relationship desire inn
ocence roll

--------------------------------------------------------------------------------


hodl
Electrum 1.x seed part 2 of 2   copy A
dress voice smile tide sometimes since anywhere lick horrible clearly everyone s
way

--------------------------------------------------------------------------------

hodl
Electrum 1.x seed part 2 of 2   copy B
dress voice smile tide sometimes since anywhere lick horrible clearly everyone s
way

--------------------------------------------------------------------------------


Press <enter> to show verification data. <ctrl-c> to exit.

1st half of offbit_mktx1_online.py
Code:
Tor socket found. Your IP seems to be:  123.123.123.123

About to query inputs from blockchain.info
Enter address to spend from:
(Normal address or Electrum root address.)
1JEiV9CiJmhfYhE7MzeSdmH82xRYrbYrtb

Number of previous outputs: 2
balance: 0.0004
availableBalance: 0.0003 (balance - fee)

Enter target address:
1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i

Enter amount to spend in Bitcoin:
(maximum: 0.0003)
0.0001

Add another target address or press <enter> to continue.
Enter target address:

Offbit data:
(Transport safely to offline system. Keep the '!' at the end.)

{"amounts": [10000], "source": "1JEiV9CiJmhfYhE7MzeSdmH82xRYrbYrtb", "u": [{"out
put": "41efd332db50d2fd7941979f21827cc4851a361c4dcdd9e6430ff940f9e7bc04:59", "va
lue": 20000}, {"output": "debbacc8a949c86ea61aa6b7c03f47cb36b9759ab207ba28ef9a69
a46eed5b93:54", "value": 20000}], "targets": ["1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62
i"]}!

Waiting for signed tx in clipboard (no carriage returns allowed).
Press <ctrl-c> to cancel.

offbit_mktx2_offline.py
Code:


Enter offbit data:
{"amounts": [10000], "source": "1JEiV9CiJmhfYhE7MzeSdmH82xRYrbYrtb", "u": [{"out

put": "41efd332db50d2fd7941979f21827cc4851a361c4dcdd9e6430ff940f9e7bc04:59", "va

lue": 20000}, {"output": "debbacc8a949c86ea61aa6b7c03f47cb36b9759ab207ba28ef9a69

a46eed5b93:54", "value": 20000}], "targets": ["1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62

i"]}!
Number of previous outputs: 2
balance: 0.0004
availableBalance: 0.0003 (balance - fee)

tx summary:
Sending 0.000200BTC to 1JEiV9CiJmhfYhE7MzeSdmH82xRYrbYrtb (change)
Sending 0.000100BTC to 1AGNa15ZQXAZUgFiqJ2i7Z2DPU2J6hW62i
fee: 0.0001

Check balance and targets. Remove your data source (USB-stick).
Press <enter> to proceed, <ctrl-c> to cancel.


Enter private key or (double) Electrum seed:


2nd half offbit_mktx2_offline.py
Code:
...


Code:
                                                                 
 █▀▀▀▀▀█ █▀ ▄▄█▄▀▄▀▀ ███  █  ▄██ ▄▀   █ █▀ █▄▄▄▄▀ ▄ ██  ▀▄ █▀▀▀▀▀█
 █ ███ █ ▄▄▄▀▀█▄▄██▄██▀▄▀▄███▄▄▄█▄██▄██▄█ ▀  ▀ ▀▄▄ ▀▀▀▄█▄▀ █ ███ █
 █ ▀▀▀ █  █▀▀██    ▄█▀▄▄██▄█▀▄██▀▀▀█▀▀███▄ ▄▀█▀▄▀▄ █  ▄▄ ▀ █ ▀▀▀ █
 ▀▀▀▀▀▀▀ █▄▀ █ █▄▀ █ ▀▄▀▄█▄█▄▀▄█ ▀ █ █ █▄▀▄▀▄█ █▄▀ █▄█▄█▄█ ▀▀▀▀▀▀▀
 ▀▄█▀ █▀█▄  ▀█ ▀▄▀ ▀ █▄██▀▄  ▀▄▀▀██▀█▄▄▀███▄▄   █ █▀▀█▄▄▄  ▀▄▄▀▄█▀
 ▀█▄ ▀█▀▀  ██▄▀█▀▀█▄ █▄█▀▀▀▀▄█▄ ▀▄██▄ ▄▀▄▀▀▀ ▀▄▀▄▄█▀▀   ▀▄▀▀▄ ▄▀▀▄
 █▄▀▄▄▀▀▀▀▀██ ▀ ▄▀█▀▄ ▀▀▀▀▀ █▀ ▄ ▄▄▀▀▀█▄█   █ █ ▀█▄█    ▀█▄▀▀▀██▀▀
 █▀█ █▄▀▄▀██▀█  ▀ ▄█ ██▀▄ ▄▄ ██▄█▀▄▄█ ▀▀▀█▄▄  █ ▄ ▀▀ ▄▀▀▄  ▄█▀█ ▀▀
 ▀██▄ █▀█ ▀▄ ▄▄ █▀▄█  ▄█▀ █▀▀█  ▀▀██▀▄▀ ▀ ▄▀███▄█▄▄▀▀ █▀▀▀█▄  ▀▀▀▀
 ▄██▀▀█▀▀  ▄  ▀▄ ██  ▀▄█▄▄▀▄▄█▀ █ █ ▄█▀▄ ███▀▄▀ ▄ ▀▀█▄█▄██▄  ▀ █ ▄
 ▄ █▀█▄▀▄ ▄██▄  ▄▀▄▀▄▀███   ▀ ▀██▄▀▀▀ ▄ ▀▀ ▄   ▀█ ▄ █▀▄▄█  ▀▀  ▀▄
 ▀ █▄ ▀▀▀▄ ██   ▄▄ ▄▄▀█▄█ █▀ ██ ▄█ ▀▄█▄ ▄▀ █▄▀ ▀ ▄▄ █▀ ▄▄ ▀▀▄█▀ █
 ▄ ▄▀▀▀▀   █ ▀▄ █▄▀▀▀██ ▀ ▀▄█▀ ▀█▄█▀▀▀███  ▀█ █ ██▄▄▄   █▄▄ █▀▀ ▀▄
 ▄ ▀▀█▀▀ █▀▄▄████▄█▀ ▀▀ ▀▀▀▀▀ █▄  ▄▄▀ ▀▀▄▄▄█▀▄▀▄▄▀ ▄█▀▀ ▀███▀▄▀▀▀█
 █▄▄▄▀█▀█▀██  ▀▀█ ▄ ▄ ███ ▀█▀▄ ▀█▀▀▄▄▄  ▀ ▄▀▀██▄▀  ▀█▄▄ █ █▄▄ ▀▄▄█
 ▀   █▀▀▀█ █▄█▀▄██ ▄ ▀▀█ ▀▄▄   █▀▀▀█▀▀▀█▄▄█▀█ ▄ █▀ █▀ █▄██▀▀▀████
   ▄▄█ ▀ █ █▄▀▄█ █▄▄ ▄█▄█ █▄   █ ▀ █▀ █ ▀██▄▄ ▀▀▀▄█▀██▄█▀█ ▀ █▀█ ▀
  ██▀▀█▀▀▀█  ▄ ▀▄▄██ ▀ ▀██ ▀ ████▀█▀▀▄▀ ▄▄▀▀▄█▀ ▀█ ▀█   ▄██▀▀█ ▀▀
 █▀ ▄ █▀▀▄▄▀▄▀██▀▄▄▀ █▄ ▀ ▄▄█▀█ █▄▀█▀█▄█▄▄▀ ▀ █ ██ ▄ ▄    █   ▀ ▄█
 █ █▄█ ▀▀▀▄   █▄▄▀▀█ █▄▀▄▄▀▀▀▄█▀▄  ██ ▀  ▀▀▄█▄▀▀█  ▀ ██▄█▄████▄▀ █
 █ ███ ▀█▄  ▀▀▀  ▄ █ ██▄▄▄███▄  ▀ ▀▀█▄  ▀▄ ▀ ▀▄▄█ ▄▀▀▄▄▀ ▄█▄█▀▀ █▄
 ▄ ▀▄█▀▀▀▄█ ██▀▀ ██ ▀ ▀█▀ ▀▀▄ ▄▄█▄ ▀ ██▄▀ ▀▄█ ▄ ██████▀▀█ ▄ ▄█▄▄ ▄
  ▄▀█▄ ▀▄█ ▀   █  ▄▀▀██▀▄▄ ▀ ▀ █  ▀█▄▄█▀▀▀▄▄▄▄  ▀▄█ █▀██▀▄▀███▀▀██
 ▀ █▀  ▀▀▄▀█▄█▄▀▀█  ▄▀▀▄▄▀▀▄█▄▀██▀█▄▀▀█▄ ▄█  ▀ ▄▀▄▄▀▀▄▄▀▄██▄  ▀▀█
 ▀▄▄▄█ ▀▀██▄▀█▀ ▄ ▄ ▀▄▀█▀████▀█▀█▄█████▄▄▄▀▀▀▄▄ █▀██  █▀▄▄ ▄ ▀▀▄▄▄
 █▄█   ▀█ ▀ █▀█▀  █▀█▀▀▄▄▀█▄██ ▀█▀▀█  ▄▄▀█▄▄▄▄███  ██▀▀█ ████▀▄▀▀█
  █▀▀  ▀▄▄▀ ▄▄ ▀█▄█ ▄ ▄▄▄█▀▀▀█   ▀█ ▄ ▄ ▀▄▀▀▀▀██  ▀ █▄▄ ▄   ▄▀██▄▄
 ▄ ▀█ ▀▀▀  ▀███ ▀█▄▄█    ▄▀ ▀▄▀ ▀▄▄▄▀█▀▀███    ▀█▄█▄▄▄▄▀█   ▄ ▄▄ 
  ▀▀ ▀ ▀▀█ █▄ ▄▀█▄ ▄▄ █ █ ▄▀▀▀ █▀▀▀██ ▄▀██▄█ ▄  █▄▀▀██▄▄▀█▀▀▀█▀ ██
 █▀▀▀▀▀█ █▄██ ▄▀ ▄█▄▀▀▀▄  ▀▀▄█▀█ ▀ █▀▄▀ █▄▄▀ █▀▀▄▄▀▄█ ▄▀▄█ ▀ █▀ ▀▄
 █ ███ █ ▄▄▄█▄▄██▀██▄  █▀▀ ▄█▄███▀██▀▀██   ▀▀ █ █▀▀▄█▄ ▀ █▀▀████▀▀
 █ ▀▀▀ █ ▀▀█ ▄▄▀▄█ ███ ▀▀█ ▀ ▄█ █▄▀▀ ▄█▀██ ▄█▀  █  █ █▀█ ▄▀▀█▄▄ ▄▀
 ▀▀▀▀▀▀▀ ▀        ▀▀ ▀▀▀    ▀    ▀    ▀ ▀ ▀▀▀▀▀▀  ▀ ▀   ▀▀▀   ▀▀▀
 

1537570033
Hero Member
*
Offline Offline

Posts: 1537570033

View Profile Personal Message (Offline)

Ignore
1537570033
Reply with quote  #2

1537570033
Report to moderator
1537570033
Hero Member
*
Offline Offline

Posts: 1537570033

View Profile Personal Message (Offline)

Ignore
1537570033
Reply with quote  #2

1537570033
Report to moderator
1537570033
Hero Member
*
Offline Offline

Posts: 1537570033

View Profile Personal Message (Offline)

Ignore
1537570033
Reply with quote  #2

1537570033
Report to moderator
Make a difference with your Ether.
Donate Ether for the greater good.
SPRING.WETRUST.IO
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537570033
Hero Member
*
Offline Offline

Posts: 1537570033

View Profile Personal Message (Offline)

Ignore
1537570033
Reply with quote  #2

1537570033
Report to moderator
1537570033
Hero Member
*
Offline Offline

Posts: 1537570033

View Profile Personal Message (Offline)

Ignore
1537570033
Reply with quote  #2

1537570033
Report to moderator
cindy313
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
March 06, 2014, 02:54:30 AM
 #2

well, using qr code and qr code scanner is good in this field!  thanx for your idea!
waxwing
Sr. Member
****
Offline Offline

Activity: 469
Merit: 250


View Profile
March 10, 2014, 07:51:11 PM
 #3

I haven't looked into the details but nicely conceived. Working on similar projects, we were worried about the CPOF by using blockchain.info and I've done some work allowing interface to Electrum servers instead of bc.i. However, it can be problematic when combined with Tor, so I'm not sure I'd recommend it in this case.

PGP fingerprint 4668 9728 A9F6 4B39 1FA8 71B7 B3AE 09F1 E9A3 197A (use email to contact)
ThirdRenaissance
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
March 10, 2014, 09:29:28 PM
 #4

Quote
### Limitations
* Only small TXs will fit into the QR code.

What's the actual limit?
hobbes
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
March 10, 2014, 10:40:34 PM
 #5

I haven't looked into the details but nicely conceived. Working on similar projects, we were worried about the CPOF by using blockchain.info and I've done some work allowing interface to Electrum servers instead of bc.i. However, it can be problematic when combined with Tor, so I'm not sure I'd recommend it in this case.
This certainly is something to think about. I guess pybitcointools is using bc.i because it is instant on and only takes a page of code or so. They are doing a good job so with Tor it goes ok for me.

Quote
### Limitations
* Only small TXs will fit into the QR code.

What's the actual limit?

There should be a hard limit of about 850 characters (base58). The most I tried it so far was one prevout and three outputs. On small screens like on an very old laptop you might have to reduce the font size to be able to fit the QR code. This could be improved by using quadrants instead of half characters in the ASCII QR code symbols.


hobbes
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
March 11, 2014, 08:01:47 AM
 #6

There is a discussion about air gapping going on here: https://bitcointalk.org/index.php?topic=499711.0

This got me the idea of an improvement for the handling of singing in Offbit. The signing code should be saved to a separate USB stick and never touch anything but the freshly booted live CD system. The transport data should be saved on another USB stick because it comes from the online system. This makes it impossible to alter the signing code. It does not really need a change to Offbit next to guide text maybe.

1.) Launch offline system from boot CD
2.) Insert offline USB stick with offbit_mktx2_offline.py on it and start
3.) Remove mktx2_offline USB stick
4.) Insert online USB stick with transport data from online computer and copy/paste it
5.) Remove online USB stick  (---> no persistent memory)
6.) Insert privkey by hand
7.) Export signed tx via QR code

Vitalik Buterin
Sr. Member
****
Offline Offline

Activity: 331
Merit: 309


View Profile
March 23, 2014, 03:47:10 AM
 #7

I haven't looked into the details but nicely conceived. Working on similar projects, we were worried about the CPOF by using blockchain.info and I've done some work allowing interface to Electrum servers instead of bc.i. However, it can be problematic when combined with Tor, so I'm not sure I'd recommend it in this case.

For the CPOF issue you can also use eligius_pushtx as a backup. Also, v1.1.7 will probably include a pushtx and fetchtx via some public bitcoind node that I'll run myself and you'll be able to plug in your own node too.

Argumentum ad lunam: the fallacy that because Bitcoin's price is rising really fast the currency must be a speculative bubble and/or Ponzi scheme.
hobbes
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
April 01, 2014, 04:26:26 PM
 #8

I haven't looked into the details but nicely conceived. Working on similar projects, we were worried about the CPOF by using blockchain.info and I've done some work allowing interface to Electrum servers instead of bc.i. However, it can be problematic when combined with Tor, so I'm not sure I'd recommend it in this case.

For the CPOF issue you can also use eligius_pushtx as a backup. Also, v1.1.7 will probably include a pushtx and fetchtx via some public bitcoind node that I'll run myself and you'll be able to plug in your own node too.
What is the problem with my torsetup.py? Just start Tor and run these 31 lines of code and you are anonymous.

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!