Git Product home page Git Product logo

opendime's Introduction

OPENDIME

Opendime is a small USB stick that allows you to spend Bitcoin like a dollar bill. Pass 'em around!

What's here?

This is a copy of contents of an example Opendime unit running the latest version of the firmware. You can use this to look at how it works, and to read the open-source code we provide.

There are three states for an Opendime:

  • New unit (does not have a bitcoin address yet)
  • Sealed (normal; has a payment address)
  • Un-Sealed (private key is revealed; sweep your funds)

Because there are major difference between version 1 and 2, they have been placed in different directories.

How to view?

Clone this repo and look in the new directory. That's exactly what you would see on the Opendime when you first plug it in. For example, on MacOS, this would be exactly the contents of /Volumes/OPENDIME.

In this example, we copied entropy.bin onto the drive to help it pick a random private key. Once that's done, the disk drive will look like sealed and that's how you'd use the Opendime most of the time.

Finally, look at unsealed to see what it looks like when you break the tab on the Opendime. The private key is revealed, and in combination with the original entropy file, you can verify we picked the private key in the manner we asserted.

Checking the private key math

To prove we are using the algorithm we claim, perform these steps:

pip install pycoin
cd unsealed/advanced
python rngverify.py ../../entropy.bin

Of course, you should also contemplate the python code in rngverify.py ... but it's pretty simple and only 75 lines.

What else is there to see?

You can unzip support/pycode.zip file to see the simple balance check and spending code, written in python.

opendime's People

Contributors

90084 avatar doc-hex avatar nvk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opendime's Issues

trustme.py - IndexError: list index out of range

I am trying to verify an opendime v4.

OS: Clear Linux
Kernel: 5.1.10-783.native
Python version 3.7.3
pycoin-0.80
libusb-1.0.22b4
PyUSB-1.0.2

All three tests below show the same output. Any help would be appreciated.

Output from the trustme.py on the opendime:

Opendime Version: 2.4.0

      time: 20190207.130255
       git: master@e233940e
      coin: BTC
    serial: REDACATED
Downloading ecdsa (wait)...

Additional low-level checks:
  - correct virtual disk geometry
Traceback (most recent call last):
  File "./trustme.py", line 31, in <module>
    import pycode.trust_me; pycode.trust_me.main()
  File "../support/pycode.zip/pycode/trust_me.py", line 260, in main
  File "../support/pycode.zip/pycode/trust_me.py", line 136, in lowlevel_tests
IndexError: list index out of range

Output from the trustme.py of a trusted Opendime v3 (run against the new one):

Opendime Version: 2.4.0

      time: 20190207.130255
       git: master@e233940e
      coin: BTC
    serial: REDACTED
Downloading ecdsa (wait)...

Additional low-level checks:
  - correct virtual disk geometry
Traceback (most recent call last):
  File "./trustme.py", line 31, in <module>
    import pycode.trust_me; pycode.trust_me.main()
  File "../support/pycode.zip/pycode/trust_me.py", line 260, in main
  File "../support/pycode.zip/pycode/trust_me.py", line 136, in lowlevel_tests
IndexError: list index out of range

Output from the trustme.py in the github repo (v2.4, new):

Opendime Version: 2.4.0

      time: 20190207.130255
       git: master@e233940e
      coin: BTC
    serial: REDACTED
Downloading ecdsa (wait)...

Additional low-level checks:
  - correct virtual disk geometry
Traceback (most recent call last):
  File "./trustme.py", line 31, in <module>
    import pycode.trust_me; pycode.trust_me.main()
  File "../support/pycode.zip/pycode/trust_me.py", line 260, in main
  File "../support/pycode.zip/pycode/trust_me.py", line 136, in lowlevel_tests
IndexError: list index out of range

When SegWit?

In particular, I'd like to get a bech32 address. Signature validation could presumably use BIP322

balance.py crashes with ValueError

I received an OpenDime today, and after loading it with some bitcoin I wanted to test out the balance.py script, but I am getting this error:

Chain.so             X.XXXXXXXX BTC
 Local Bitcoins      X.XXXXXXXX BTC
 Blockr.io           Traceback (most recent call last):
  File "/Volumes/OPENDIME/advanced/balance.py", line 17, in <module>
    import pycode.od_wallet; pycode.od_wallet.main()
  File "/Volumes/OPENDIME/support/pycode.zip/pycode/od_wallet.py", line 145, in main
  File "/Volumes/OPENDIME/support/pycode.zip/pycode/od_wallet.py", line 70, in find_balance
AttributeError: 'exceptions.ValueError' object has no attribute 'code' 

It looks like you are expecting a certain type of error (with a code attribute) but ValueError occurs somewhere instead.

Running with python3 gives more info (but different error):

  File "/Volumes/OPENDIME/support/pycode.zip/pycode/od_wallet.py", line 68, in find_balance
  File "/var/folders/1s/vgx_bydj49df53c2k614bzsr0000gq/T/tmpqcbqmd6h.zip/pycoin/services/blockr_io.py", line 25, in spendables_for_address
  File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Volumes/OPENDIME/advanced/balance.py", line 17, in <module>
    import pycode.od_wallet; pycode.od_wallet.main()
  File "/Volumes/OPENDIME/support/pycode.zip/pycode/od_wallet.py", line 145, in main
  File "/Volumes/OPENDIME/support/pycode.zip/pycode/od_wallet.py", line 70, in find_balance
AttributeError: 'JSONDecodeError' object has no attribute 'code'

Was balance.py dropped in v2.4?

Hi there, just got notified by a friend that there is no balance.py on an Opendime they received from me.

I checked another v2.4 Opendime and noticed the same. This repo also contains no such file.

Unfortunately though, the README.md still mentions the file, which can raise doubt about the authenticity of the Opendime.

Is it correct that balance.py was dropped in v2.4 and if so would it be possible to remove all references to it in a future iteration?

STEP File of Opendime

Hello, is there a STEP File and a partlist avalable from the OpenDime? Where can i find it?

Thank you

Share PCB files? [request]

Hi there,

The idea of this project is very promising, and IMO is has been designed and performed quite nicely. I'm particularly interested in your v2.0 design.

Since I'm designing a USB device with similar requirements (etc low-cost, and a nice design) I was wondering if it's possible for you to share the PCB design files? The term "open" in OpenDime got me wondering if the hardware is also open.

Anyways, thanks for your time, and I hope it's possible for your team to also share the PCB files on GitHub.

python balance.py returns no balance and crashes

python balance.py
Downloading pycoin (wait)...

Opendime USB at: /media/pi/OPENDIME

Wallet address: xxxxxxxxxxxxxxxxxxxxxxxxxxx


Current Balance

 Chain.so            None
 Local Bitcoins      ERROR [404: Not Found]
 Blockchain.info     ERROR [500: Internal Server Error]
 BitPay              None
 Blockcypher         ERROR [429: Too Many Requests]
 Blockr.io           Traceback (most recent call last):
  File "balance.py", line 17, in <module>
    import pycode.od_wallet; pycode.od_wallet.main()
  File "../support/pycode.zip/pycode/od_wallet.py", line 145, in main
  File "../support/pycode.zip/pycode/od_wallet.py", line 70, in find_balance
AttributeError: 'exceptions.ValueError' object has no attribute 'code'

macOS : unable to verify screenshot dragged onto device

I created a screenshot, shrunk it a bit so it fits on a fresh (v4) device, and dragged the PNG over. The device rebooted and macOS threw a tantrum about unsafe ejection as expected.

But when I run python rngverify.py ~/the_screenshot.png it fails with: FAILED: You probably didn't record exactly the bytes written to this drive.

The two lines that are different between my device and v2.4/sealed/advanced/rngverify.py are ADDRESS and CHIP_SERIAL.

LTC V2.3 trustme.py "Additional low-level checks" error out with "usb.core.NoBackendError: No backend available"

`PS D:\advanced> python trustme.py

Opendime USB at: D:\

Wallet address: redacted

Opendime Version: 2.3.0

  time: 20171018.143523
   git: master@8fb7cfd
  coin: LTC
serial: redacted

Additional low-level checks:
Traceback (most recent call last):
File "trustme.py", line 31, in
import pycode.trust_me; pycode.trust_me.main()
File "..\support\pycode.zip\pycode\trust_me.py", line 260, in main
File "..\support\pycode.zip\pycode\trust_me.py", line 77, in lowlevel_tests
File "..\support\pycode.zip\pycode\trust_me.py", line 60, in init
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\core.py", line 1263, in find
raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.