Coder Social home page Coder Social logo

tesoro's Introduction

TESORO Build Status

Go package to work with TREZOR devices. This repository is an unofficial package written in Go (golang), for any official package, code or tool, please go to the official TREZOR repository

⚠️ Important notice ⚠️

This project started as a Go library for TREZOR devices that I used for personal projects, it's no longer mantained. You could use the official trezord-go as a go library.

What is TREZOR?

TREZOR is a single purpose device which allows you to make secure Bitcoin transactions. With TREZOR, transactions are completely safe even when initiated on a compromised or vulnerable computer.

Installation

$ go get github.com/conejoninja/tesoro

Examples

examples/hid: only compatible with Linux (and Linux based), pure go, no libusb dependency.

Supported methods

Some*

Tests

Go to the tests folder and run them with

// Put your device in bootloader mode
go test -v tesoro_bootloader_test.go
// Disconnect and connect your device in normal mode
go test -v tesoro_test.go

Running tests the traditional Go way (go test) will not work, as for tesoro_bootloader_test.go to run you need to put your device in bootloader mode, the rest of the tests are run in normal mode.

Contributing to this project:

If you find any improvement or issue you want to fix, feel free to send me a pull request.

Cerrojo

For a similar project, compatible with both, KeepKey and Trezor One, take a look at CERROJO repository.

License

This is distributed under the Apache License v2.0

Copyright 2016 Daniel Esteban - [email protected]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Notes

If you would like to donate via Bitcoin, please send your donation to this wallet:

Bitcoin: 1G9d7uVvioNt8Emsv6fVmCdAPc41nX1c8J

tesoro's People

Contributors

conejoninja avatar mattdf avatar peterzen avatar rfjakob avatar xaionaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tesoro's Issues

Error during build - cannot find "google/protobuf"

In pb/types/types.pb.go the reference to google/protobuf import cannot be resolved.

Even if I change the import to github.com/codejoninja/tesoro/pb/google/protobuf, it then complains about a non-local import error in messages.pb.go for the types import.

tesoro_test.go:29:4: undefined: client

Trying to run the tests, the bootloader tests work:

~/go/src/github.com/conejoninja/tesoro/tests$ go test -v tesoro_bootloader_test.go
Found 1 TREZOR devices connected
=== RUN   TestBLInitialize
--- PASS: TestBLInitialize (0.00s)
	tesoro_bootloader_test.go:47: We need to check if device is in bootloader mode.
	tesoro_bootloader_test.go:62: 		Everything went fine, \ʕ◔ϖ◔ʔ/ YAY!
=== RUN   TestBLFirmwareUpload
[WHAT TO DO] Erase firmware, click "Continue"
[WHAT TO DO] Check fingerprint match: 5764715dbcf8ed88bc0ae1c2f715277f22b67f26c15e1f7543b2b44913b5c255 and click "Continue" 
--- PASS: TestBLFirmwareUpload (25.08s)
	tesoro_bootloader_test.go:71: We'll try to upload a new firmware.
	tesoro_bootloader_test.go:104: 		Everything went fine, \ʕ◔ϖ◔ʔ/ YAY!
PASS
ok  	command-line-arguments	25.189s

But the normal mode tests fail with compile errors:

~/go/src/github.com/conejoninja/tesoro/tests$ go test -v tesoro_test.go
# command-line-arguments
./tesoro_test.go:29:4: undefined: client
./tesoro_test.go:51:32: undefined: client
./tesoro_test.go:76:32: undefined: client
./tesoro_test.go:102:32: undefined: client
./tesoro_test.go:123:30: undefined: client
./tesoro_test.go:140:30: undefined: client
./tesoro_test.go:157:30: undefined: client
./tesoro_test.go:175:32: undefined: client
./tesoro_test.go:199:30: undefined: client
./tesoro_test.go:208:31: undefined: client
./tesoro_test.go:208:31: too many errors
FAIL	command-line-arguments [build failed]

Trezor T is not supported

~/go/src/github.com/conejoninja/tesoro/example$ go run main.go 
No TREZOR devices found, make sure your device is connected

Build fails: os/threads_posix.c: No such file or directory

$ go build
# github.com/conejoninja/tesoro/vendor/github.com/trezor/usbhid
vendor/github.com/trezor/usbhid/hid.go:32:11: fatal error: os/threads_posix.c: No such file or directory
  #include "os/threads_posix.c"
           ^~~~~~~~~~~~~~~~~~~~
compilation terminated.

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.