https://github.com/xaionaro-go/cryptowallet
A library to access to basic functions of hardware cryptocurrencies wallets
https://github.com/xaionaro-go/cryptowallet
cryptowallet go golang trezor wallet
Last synced: 21 days ago
JSON representation
A library to access to basic functions of hardware cryptocurrencies wallets
- Host: GitHub
- URL: https://github.com/xaionaro-go/cryptowallet
- Owner: xaionaro-go
- License: lgpl-3.0
- Created: 2018-06-14T09:07:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-17T17:34:29.000Z (about 6 years ago)
- Last Synced: 2025-04-25T07:14:33.911Z (25 days ago)
- Topics: cryptowallet, go, golang, trezor, wallet
- Language: Go
- Homepage:
- Size: 673 KB
- Stars: 10
- Watchers: 1
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/xaionaro-go/cryptoWallet)
[](https://goreportcard.com/report/github.com/xaionaro-go/cryptoWallet)
[](https://godoc.org/github.com/xaionaro-go/cryptoWallet)Supported devices:
| Vendor | Product | Product (lsusb) | Vendor ID | Product ID | Version | Notes |
| ------ | ------- | --------------- | --------- | ---------- | ------- | ----- |
| SatoshiLabs | Trezor One | Bitcoin Wallet [TREZOR] | 0x534c | 0x0001 | 1.6.0 |Tested on Linux |
| InterBiometrics | Trezor T | TREZOR | 0x1209 | 0x53c1 | | Tested on Linux |```go
[...]
wallet := cryptoWallet.FindAny()
[...]err := wallet.Reset()
checkError(err)masterKey := []byte("some key here")
encryptedMasterKey, err := wallet.EncryptKey(
`m/3'/14'/15'/93'`,
masterKey,
[]byte{},
"aWalletKeyName")
checkError(err)decryptedMasterKey, err := wallet.DecryptKey(
`m/3'/14'/15'/93'`,
encryptedMasterKey,
[]byte{},
"aWalletKeyName")
checkError(err)fmt.Printf("%v (%d)\n", string(masterKey), len(masterKey))
fmt.Println(encryptedMasterKey)
fmt.Printf("%v (%d)\n", string(decryptedMasterKey), len(decryptedMasterKey))
fmt.Println(decryptedMasterKey)[...]
```
Running the example:
```
$ go run example/main.go
some key here (13)
[167 124 140 62 203 124 234 209 28 12 1 67 101 97 228 141]
some key here (16)
[115 111 109 101 32 107 101 121 32 104 101 114 101 0 0 0]
```A key to be encrypted/decrypted should be a multiple of 16 bytes. If you pass not a multiple of 16 bytes it will pad the value with zeros.
If you need more functionality then please post an issue or a PR.