Skip to content

Conversation

@reez
Copy link
Collaborator

@reez reez commented Oct 13, 2025

Resolves #50

Description

Expose the card id, and expose it thru swift bindings as well.

Notes to the reviewers

Added data-encoding for base32, I didn't see a std equivalent, let me know if there is a different/better way if there is one.

https://github.com/coinkite/coinkite-tap-proto/blob/master/docs/protocol.md#pubkeys

Both types of card have a unique pubkey, mapped into a human-readable hash with this process:

SHA-256 (compressed pubkey = 33 bytes)
Skip the first 8 bytes (because that's revealed in the NFC URL)
Encode as base32 and take the first 20 characters in four groups of five characters
Insert dashes between the groups.
The result is 23 characters long.

Changelog notice

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@reez reez mentioned this pull request Oct 13, 2025
Copy link
Member

@notmandatory notmandatory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK da263ab

Nice job, looks like you're getting the hang of rust coding!

@notmandatory notmandatory merged commit da263ab into bitcoindevkit:master Oct 14, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: card id

2 participants