{"id":21528511,"url":"https://github.com/fibercrypto/skywallet-go","last_synced_at":"2025-10-24T00:57:10.708Z","repository":{"id":57546737,"uuid":"218879582","full_name":"fibercrypto/skywallet-go","owner":"fibercrypto","description":"Go interface to the hardware wallet","archived":false,"fork":false,"pushed_at":"2020-03-04T01:22:34.000Z","size":5611,"stargazers_count":0,"open_issues_count":13,"forks_count":1,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-03-17T18:52:04.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fibercrypto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-31T23:45:23.000Z","updated_at":"2020-02-06T22:54:00.000Z","dependencies_parsed_at":"2022-08-27T02:57:04.496Z","dependency_job_id":null,"html_url":"https://github.com/fibercrypto/skywallet-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fibercrypto/skywallet-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fskywallet-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fskywallet-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fskywallet-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fskywallet-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fibercrypto","download_url":"https://codeload.github.com/fibercrypto/skywallet-go/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Fskywallet-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275160359,"owners_count":25415767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:53:30.878Z","updated_at":"2025-10-24T00:57:05.662Z","avatar_url":"https://github.com/fibercrypto.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![hwgo-01](https://user-images.githubusercontent.com/8619106/57969063-e6255000-798f-11e9-973e-9fdf7a0bd5fc.png)\n\n# Go bindings and CLI tool for the Skycoin hardware wallet\n\n[![Build Status](https://travis-ci.com/skycoin/hardware-wallet-go.svg?branch=master)](https://travis-ci.com/skycoin/hardware-wallet-go)\n\n## Table of contents\n\n\u003c!-- MarkdownTOC levels=\"1,2,3,4,5\" autolink=\"true\" bracket=\"round\" --\u003e\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Download source code](#download-source-code)\n  - [Dependancies management](#dependancies-management)\n  - [Run](#run)\n- [Development guidelines](#development-guidelines)\n  - [Versioning policies](#versioning-policies)\n  - [Running tests](#running-tests)\n  - [Releases](#releases)\n    - [Update the version](#update-the-version)\n    - [Pre-release testing](#pre-release-testing)\n    - [Creating release builds](#creating-release-builds)\n- [Wiki](#wiki)\n\u003c!-- /MarkdownTOC --\u003e\n\n## Installation\n\n### Install golang\n\nhttps://github.com/golang/go/wiki/Ubuntu\n\n## Usage\n\n### Download source code\n\n```bash\n$ go get github.com/fibercrypto/skywallet-go\n```\n\n### Dependancies management\n\nThis project uses dep [dependancy manager](https://github.com/golang/dep).\n\nDon't modify anything under vendor/ directory without using [dep commands](https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md).\n\nDownload dependencies using command:\n\n```bash\n$ make dep\n```\n\n### Run\n\n```bash\n$ go run cmd/cli/cli.go\n```\n\nSee also [CLI README](https://github.com/fibercrypto/skywallet-go/blob/master/cmd/cli/README.md) for information about the Command Line Interface.\n\n# Development guidelines\n\nCode added in this repository should comply to development guidelines documented in [Skycoin wiki](https://github.com/skycoin/skycoin/wiki).\n\nThe project has two branches: `master` and `develop`.\n\n- `develop` is the default branch and will always have the latest code.\n- `master` will always be equal to the current stable release on the website, and should correspond with the latest release tag.\n\n# Versioning policies\n\nThis go client library follows the [versioning rules for SkyWallet client libraries](https://github.com/skycoin/hardware-wallet/tree/develop/README.md#versioning-libraries) .\n\n# Running tests\n\nLibrary test suite can be run by running the following command\n\n```\nmake test\n```\n\nIf a physical SkyWallet device is connected then the test suite will exchange test messages with it. Likewise, the emulator will reply to test messages if executed in advance as follows.\n\n```\ngit clone https://github.com/skycoin/hardware-wallet /some/path/to/hardware-wallet\nmake clean -C /some/path/to/hardware-wallet \u0026\u0026 make -C /some/path/to/hardware-wallet run-emulator\n```\n\nIf neither the emulator nor a physical device are connected then tests will be skipped silently.\n\n# Releases\n\n# Update the version\n\n0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures)\n0. Switch to a new release branch named `release-X.Y.Z` for preparing the release.\n0. Run `make build` to make sure that the code base is up to date\n0. Update `CHANGELOG.md`: move the \"unreleased\" changes to the version and add the date.\n0. Follow the steps in [pre-release testing](#pre-release-testing)\n0. Make a PR merging the release branch into `master`\n0. Review the PR and merge it\n0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a \"release\".\n0. Tag the changeset of the `protob` submodule checkout with the same version number as above.\n0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds).\n0. Checkout `develop` branch and bump `tiny-firmware/VERSION` and `tiny-firmware/bootloader/VERSION` to next [`dev` version number](https://www.python.org/dev/peps/pep-0440/#developmental-releases).\n\n\n# Pre-release testing\n\nPre-release testing procedure requires [skycoin-cli](https://github.com/skycoin/skycoin/tree/develop/cmd/cli) of version strictly greater than `0.26.0`. Please [install it](https://github.com/skycoin/skycoin/blob/develop/cmd/cli/README.md#install) if not available in your system. Some operations in the process require [running a Skycoin node](https://github.com/skycoin/skycoin/tree/master/INTEGRATION.md#running-the-skycoin-node). Also clone [Skywallet firmware repository](https://github.com/skycoin/hardware-wallet/) in advance.\n\nThe instructions that follow are meant to be followed for Skywallet devices flashed without memory protection. If your device memory is protected then some values might be different e.g. `firmwareFeatures`.\n\nDuring the process beware of the fact that running an Skycoin node in the background can block the Skywallet from running.\n\nSome values need to be known during the process. They are represented by the following variables:\n\n- `WALLET1`, `WALLET2`, ... names of wallets created by `skycoin_cli`\n- `ADDRESS1`, `ADDRESS2`, ... Skycoin addresses\n- `TXN1_RAW`, `TXN2_RAW`, ... transactions data encoded in hex dump format\n- `TXN1_JSON`, `TXN2_JSON`, ... transactions data encoded in JSON format, if numeric index value matches the one of another variable with `RAW` prefix then both refer to the same transaction\n- `TXN1_ID`, `TXN2_ID`, ... Hash ID of transactions after broadcasting to the P2P network\n- `AMOUNT` represents an arbitrary number of coins\n- `ID1`, `ID2`, `ID3`, ... unique ID values , usually strings identifying hardware or software artifacts\n- `AUTHTOKEN` is a CSRF token for the Skycoin REST API\n\nPerform these actions before releasing:\n\n**Note** : In all cases `skycoin-cli` would be equivalent to `go run cmd/cli/cli.go` if current working directory set to `$GOPATH/src/github.com/skycoin/skycoin`.\n\n##### Run project test suite\n\n- Open a terminal window and run Skywallet emulator. Wait for emulator UI to display.\n- From a separate trminal window run the test suite as follows\n```sh\nnpm run test\n```\n- Close emulator and plug Skywallet device. Run the same command another time.\n\n##### Run transaction tests\n\n- Create new wallet e.g. with `skycoin-cli` (or reuse existing wallet for testing purposes)\n```sh\nskycoin-cli walletCreate -f $WALLET1.wlt -l $WALLET1\n```\n- From command output take note of the seed `SEED1` and address `ADDRESS1`\n- List wallet addresses and confirm that `ADDRESS1` is the only value in the list.\n```sh\nskycoin-cli listAddresses $WALLET1.wlt\n```\n- Transfer funds to `ADDRESS1` in new wallet in two transactions\n- Check balance\n```sh\nskycoin-cli addressBalance $ADDRESS1\n```\n- List address for `WALLET1` and check that `head_outputs` in response includes to outputs with `address` set to `ADDRESS1`\n```\nskycoin-cli walletOutputs $WALLET1.wlt\n```\n- [Get device features](cmd/cli/README.md#device-features) and check that:\n  * `vendor` is set to `Skycoin Foundation`\n  * `deviceId` is a string of 24 chars, which we'll refer to as `ID1`\n  * write down the value of `bootloaderHash` i.e. `ID2`\n  * `model` is set to `'1'`\n  * `fwMajor` is set to expected firmware major version number\n  * `fwMinor` is set to expected firmware minor version number\n  * `fwPatch` is set to expected firmware patch version number\n  * `firmwareFeatures` is set to `0`\n- Ensure device is seedless by [wiping it](cmd/cli/README.md#wipe-device). Check that device ends up in home screen with `NEEDS SEED!` message at the top.\n- [Recover seed](cmd/cli/README.md#recovery-device) `SEED1` in Skywallet device (`dry-run=false`).\n- [Get device features](cmd/cli/README.md#device-features) and check that:\n  * `vendor` is set to `Skycoin Foundation`\n  * `deviceId` is set to `ID1`\n  * `pinProtection` is seto to `false`\n  * `passphraseProtection` is set to `false`\n  * `label` is set to `ID1`\n  * `initialized` is set to `true`\n  * `bootloaderHash` is set to `ID2`\n  * `passphraseCached` is set to `false`\n  * `needsBackup` is set to `false`\n  * `model` is set to `'1'`\n  * `fwMajor` is set to expected firmware major version number\n  * `fwMinor` is set to expected firmware minor version number\n  * `fwPatch` is set to expected firmware patch version number\n  * `firmwareFeatures` is set to `0`\n- [Set device label](cmd/cli/README.md#apply-settings) to a new value , say `ID3`. Specify `usePassphrase=false`.\n- [Get device features](cmd/cli/README.md#device-features) and check that:\n  * `label` is set to `ID3`\n  * all other values did not change with respect to previous step, especially `deviceId`\n  * as a result device label is displayed on top of Skycoin logo in device home screen\n- Ensure you know at least two addresses for test wallet, if not, [generate some](cmd/cli/README.md#ask-device-to-generate-addresses). Choose the second and third in order, hereinafter referred to as `ADDRESS2`, `ADDRESS3` respectively\n- Check that address sequence generated by SkyWallet matches the values generated by `skycoin-cli`\n```sh\nskycoin-cli walletAddAddresses -f $WALLET1.wlt -n 5\n```\n- Check once again with desktop wallet\n- Create new transaction from `ADDRESS1` to `ADDRESS2` in test wallet (say `TXN_RAW1`) for an spendable amount higher than individual output's coins\n```sh\nexport TXN1_RAW=\"$(skycoin-cli createRawTransaction -a $ADDRESS1 -f $WALLET1.wlt $ADDRESS2 $AMOUNT)\"\necho $TXN1_RAW\n```\n- Display transaction details and confirm that it contains at least two inputs\n```sh\nexport TXN1_JSON=$(skycoin-cli decodeRawTransaction $TXN1_RAW)\necho $TXN1_JSON\n```\n- [Sign transaction](cmd/cli/README.md#transaction-sign) with Skywallet by putting together a message using values resulting from previous step as follows.\n  * For each hash in transaction `inputs` array and in same order there should be\n    - an instance of `--inputHash` command line argument set to the very same hash \n    - an instance of `--inputIndex` set to `0`.\n  * For each source item in transaction `outputs` array and in the same order there should be command-line arguments set as follows:\n    - `--outputAddress` : source item's `dst`\n    - `--coin` : source item's `coins * 1000000`\n    - `--hour` : source item's `hours`\n    - `--addressIndex` : set to `0` if source item `address` equals `ADDRESS1` or to `1` otherwise\n- Check that `signatures` array returned by hardware wallet includes entries for each and every transaction input\n- [Check signatures](cmd/cli/README.md#ask-device-to-check-signature) were signed by corresponding addresses\n- Create transaction `TXN2_JSON` by replacing `TXN1_JSON` signatures with the array returned by SkyWallet\n- Use `TXN2_JSON` to obtain encoded transaction `TXN2_RAW`\n```sh\nexport $TXN2_RAW=$( echo \"$TXN2_JSON\" | skycoin-cli encodeJsonTransaction --fix - | grep '\"rawtx\"' | cut -d '\"' -f4)\necho $TXN2_RAW\n```\n- Broadcast transaction. Refer to its id as `TXN2_ID`\n```sh\nexport TXN2_ID=$(skycoin-cli broadcastTransaction $TXN2_RAW)\n```\n- After a a reasonable time check that balance changed.\n```sh\nskycoin-cli walletBalance $WALLET1.wlt\n```\n- Create a second wallet i.e. `WALLET2`\n```sh\nskycoin-cli walletCreate -f $WALLET2.wlt -l $WALLET2\n```\n- From command output take note of the seed `SEED2` and address `ADDRESS4`\n- List `WALLET2` addresses and confirm that `ADDRESS4` is the only value in the list.\n```sh\nskycoin-cli lisAddresses $WALLET2.wlt\n```\n- Transfer funds to `WALLET2` (if not already done) and check balance\n```sh\nskycoin-cli addressBalance $ADDRESS4\n```\n- Request CSRF token (i.e. `AUTHTOKEN`) using Skycoin REST API.\n```sh\ncurl http://127.0.0.1:6420/api/v1/csrf\n```\n- Use Skycoin REST API to create one transaction grabbing all funds from `ADDRESS1` (i.e. first address in `WALLET1` previously recovered in Skywallet device), `ADDRESS2` (i.e. second address in `WALLET1` previously recovered in Skywallet device) and `ADDRESS4` (i.e. first address in `WALLET2`) so as to transfer to the third address of `WALLET1` (i.e. `ADDRESS3`). Change should be sent back to `ADDRESS1`. In server response transaction JSON object (a.k.a `TNX3_JSON`) would be the object at `data.transaction` JSON path. If Skycoin node was started with default parameters this can be achieved as follows:\n```sh\ncurl -X POST http://127.0.0.1:6420/api/v2/transaction -H 'content-type: application/json' -H \"X-CSRF-Token: $AUTHTOKEN\" -d \"{\n    \\\"hours_selection\\\": {\n        \\\"type\\\": \\\"auto\\\",\n        \\\"mode\\\": \\\"share\\\",\n        \\\"share_factor\\\": \\\"0.5\\\"\n    },\n    \\\"addresses\\\": [\\\"$ADDRESS1\\\", \\\"$ADDRESS2\\\", \\\"$ADDRESS4\\\"],\n    \\\"change_address\\\": \\\"$ADDRESS1\\\",\n    \\\"to\\\": [{\n        \\\"address\\\": \\\"$ADDRESS3\\\",\n        \\\"coins\\\": \\\"$AMOUNT\\\"\n    }],\n    \\\"ignore_unconfirmed\\\": false\n}\"\n```\n- [Sign transaction](cmd/cli/README.md#transaction-sign) represented by `TXN3_JSON` for inputs owned by Skywallet (i.e. `WALLET1`)\n  * For each object in transaction `inputs` array there should be:\n    - an instance of `--inputHash` command line argument set to the value bound to object's `uxid` key\n    - an instance of `--inputIndex` set as follows\n      * empty string if input `address` is `ADDRESS4`\n      * `0` if input `address` is `ADDRESS1`\n      * `1` if input `address` is `ADDRESS2`\n  * For each source item in transaction `outputs` array there should be command-line arguments set as follows:\n    - `--outputAddress` : source item's `address`\n    - `--coin` : source item's `coins * 1000000`\n    - `--hour` : source item's `hours`\n    - `--addressIndex` set to 2 (since destination address is `ADDRESS3`)\n- Check that signatures array includes one entry for every input except the one associated to `ADDRESS4`, which should be an empty string\n- [Recover seed](cmd/cli/README.md#recovery-device) `SEED2` in Skywallet device (`dry-run=false`).\n- [Sign transaction](cmd/cli/README.md#transaction-sign) represented by `TXN3_JSON` for inputs owned by Skywallet (i.e. `WALLET2`)\n  * For each hash in transaction `inputs` array and in same order there should be:\n    - an instance of `--inputHash` command line argument set to the value bound to object's `uxid` key\n    - an instance of `--inputIndex` set to a value as follows\n      * not set if input `address` is `ADDRESS1`\n      * not set if input `address` is `ADDRESS2`\n      * `0` if input `address` is `ADDRESS4`\n  * For each source item in transaction `outputs` array and in the same order there should be command-line arguments set as follows:\n    - `--outputAddress` : source item's `dst`\n    - `--coin` : source item's `coins * 1000000`\n    - `--hour` : source item's `hours`\n    - `--addressIndex` empty (since destination address `ADDRESS3` not owned by this wallet)\n- Create a new transaction JSON object (a.k.a `TXN4_JSON`) from `TXN3_JSON` and the previous signatures like this\n  * `type` same as in `TXN3_JSON`\n  * `inner_hash` should be an empty string\n  * `sigs` returned by SkyWallet in same order as corresponding input\n  * `inputs` is an array of strings. For each item in `TXN3_JSON` `inputs` include the value of its `uxid` field in `TXN4_JSON` `inputs` array. Respect original order.\n  * `outputs` is an array of objects constructed out of `TXN3_JSON` `outputs` items, in te same order, as follows\n    - `dst` : source item's `address`\n    - `coins` : source item's `coins * 1000000`\n    - `hours` : source item's `hours` as integer\n- Use `TXN4_JSON` to obtain encoded transaction `TXN4_RAW`\n```sh\nexport $TXN4_RAW=$( echo \"$TXN4_JSON\" | skycoin-cli encodeJsonTransaction --fix - | grep '\"rawtx\"' | cut -d '\"' -f4)\necho $TXN4_RAW\n```\n- Broadcast transaction. Refer to its id as `TXN4_ID`\n```sh\nexport TXN4_ID=$(skycoin-cli broadcastTransaction $TXN4_RAW)\n```\n- After a a reasonable time check that wallets balance changed.\n```sh\nskycoin-cli walletBalance $WALLET1.wlt\nskycoin-cli walletBalance $WALLET2.wlt\n```\n\n## Wiki\n\nMore information in [the wiki](https://github.com/fibercrypto/skywallet-go/wiki)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibercrypto%2Fskywallet-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffibercrypto%2Fskywallet-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibercrypto%2Fskywallet-go/lists"}