Skip to content

This project is a Go language implementation of the Coinkite Tap Cards NFC protocol, specifically focusing on the Satscard functionality.

License

Notifications You must be signed in to change notification settings

schjonhaug/tapcards

Repository files navigation

Coinkite Tap Cards Protocol Implementation in Go

Gopher Logo

Go Reference

This project is a Go language implementation of the Tap Cards protocol, specifically focusing on the Satscard functionality. It does not cover Tapsigner or Satschip functionalities at this time.

Available Satscard Commands

Implemented commands for Satscard include:

Usage Guide

Initial Steps

The first action with a card is an ISOAppletSelectRequest. The library manages APDU complexities, allowing direct sending of raw bytes. The card’s response should be processed through ParseResponse. This step is not necessary to repeat as long as the card remains powered in the RF field.

Subsequently, run a Request command to generate a byte array for the card. Multiple interactions may be necessary for some commands, with byte arrays from ParseResponse being resent to the card as needed. Once ParseResponse yields no further data, use Satscard to access card information, private keys, etc.

Always verify the factory certificate of the card before trusting any data from it. To do this, run CertsRequest which check the authenticity of the card. This command will also run the read command, which will expose the current receiving address.

Building Mobile Libraries

The Go library can be compiled for mobile platforms, supporting Objective-C on iOS and Java on Android.

Setup Requirements

For iOS

Requires macOS with Command Line Tools or Xcode.

For Android

Requires Android Studio or Command Line Tools, and the installation of Android NDK.

Mobile Compilation Steps

go install golang.org/x/mobile/cmd/gomobile@latest
go install golang.org/x/mobile/bind
gomobile init
gomobile bind -target=ios
gomobile bind -o tapcards.aar -androidapi <API VERSION> -target=android github.com/schjonhaug/tapcards

Examples

In the examples folder, there are two projects using this module. One using the emulator, and the other using physical Satscards.

Development and debug

For the ongoing development and upkeep of this library, it is beneficial to utilise the Python emulator provided by Coinkite. You can integrate the emulator with the library by executing UseEmulator(). Additionally, invoking EnableDebugLogging() will provide valuable information for debugging.

About

This project is a Go language implementation of the Coinkite Tap Cards NFC protocol, specifically focusing on the Satscard functionality.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages