Skip to content

poc: nfc payment#108

Open
IzioDev wants to merge 3 commits intoazbuky:mainfrom
IzioDev:poc/nfc
Open

poc: nfc payment#108
IzioDev wants to merge 3 commits intoazbuky:mainfrom
IzioDev:poc/nfc

Conversation

@IzioDev
Copy link
Copy Markdown

@IzioDev IzioDev commented Aug 10, 2025

Hi,

This is a working PoC for NFC payment, tested on 2 android devices, demo here.

It still needs some competent Flutter developer to take it!

What's missing:

  • Let the user prompt the amount they desire to receive
  • (optional) Potentially add a signature displayed as a color (hex) or a shape, so the receiver can easily identify the message hasn't been propagated from another party
  • Properly start a "scan session", iOS recommend that this last for a small amount of time (10 seconds)
  • Properties rename to match codebase consistency
  • Handle amount a better way (currently a double), i just wanted the message to go out -> in

Additionally:

  • nfc_manager is at an outdated version, i wanted to take the latest (4.0.2 i believe), but it needs flutter engine upgrade, which then needs many deps to upgrade too

@IzioDev
Copy link
Copy Markdown
Author

IzioDev commented Aug 10, 2025

Closes #100

@IzioDev
Copy link
Copy Markdown
Author

IzioDev commented Aug 10, 2025

I forgot to mention that this is part of a greater goal that is to support external NFC tags. So the protocol probably should use URI message later on, or even support both p2p (wallet to wallet) or wallet to nfc chip (chip is the emitter in this setup)

@azbuky
Copy link
Copy Markdown
Owner

azbuky commented Aug 11, 2025

Hi, neat idea!

I think the best place for the nfc tag emulation feature is a button on the receive sheet that would display a NFC dialog with a timeout and a cancel button.

The content of the tag should be a Kaspa URI like "kaspa:qp0qnczz5jc8vpujuyqrjw5eey73paqfgxks7505pqdz9eqwmwftxg44gu00z?amount=10.123&label=Label&message=Message&note=Note", such URIs are already supported in Kaspium.

The NFC tag emulation feature should create a URI type tag instead of plain text (this requires some changes to flutter_nfc_hce).

Note that Kaspium can already handle NFC tags that encode Kaspa URIs like the one above. Simply scan the NFC tag with the device (both Android and iOS) and the system will prompt to open the URI in Kaspium which triggers the send flow after authentication. The tag needs to be of URI type and have a URI that starts with one of the Kaspa address prefixes ("kaspa:" "kaspatest:" etc). Works with a simple address or with address, amount and additional data.

@IzioDev
Copy link
Copy Markdown
Author

IzioDev commented Aug 11, 2025

Thanks for the information,

a button on the receive sheet that would display a NFC dialog with a timeout and a cancel button

100%, as iOS recommend! But I'm not familiar with the codebase and I cannot see any design system documentation so I concluded it would be better if maintainers handle the UI parts.

Yes for the URI. What are the purposes of the other fields, is it just something specific to Kaspium?

Note that Kaspium can already handle NFC tags

Where is this defined? I cannot make it work on my end

@IzioDev
Copy link
Copy Markdown
Author

IzioDev commented Aug 11, 2025

Are you planning to upgrade the dependencies by any chance?

There is a huge work to be done toward that area, as upgrading the flutter engine break the current compatibility, which then forces to upgrade the packages, which introduce breaking changes (some are horrible to handle, given how deeply they are propagated across the codebase)

@azbuky
Copy link
Copy Markdown
Owner

azbuky commented Aug 12, 2025

Yes for the URI. What are the purposes of the other fields, is it just something specific to Kaspium?

It is similar to Bitcoin URIs BIP21 https://en.bitcoin.it/wiki/BIP_0021

Where is this defined? I cannot make it work on my end

Try writing a NFC Tag with NFC Tools https://play.google.com/store/apps/details?id=com.wakdev.wdnfc
The record should be "custom URL/URI" and enter the Kaspa URI "kaspa:...." as content.

Scan the tag with your device, it should offer to open the URI in Kaspium.

Are you planning to upgrade the dependencies by any chance?

Yes, I'm using the latest Flutter version in my local branch. Let me see if I can push the changes.

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.

2 participants