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.
Implemented commands for Satscard include:
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.
The Go library can be compiled for mobile platforms, supporting Objective-C on iOS and Java on Android.
Requires macOS with Command Line Tools or Xcode.
Requires Android Studio or Command Line Tools, and the installation of Android NDK.
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
In the examples folder, there are two projects using this module. One using the emulator, and the other using physical Satscards.
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.