BlockchainCommons / GordianSeedTool-iOS

Cryptographic Seed Manager for iOS
Other
36 stars 8 forks source link

FEATURE: UR to NFC, NFC to trigger URL actions #124

Open ChristopherA opened 2 years ago

ChristopherA commented 2 years ago

Newer iPhones have the ability to automatically launch URLs (text) read from an NFC card, and with a public API read NFC cards ID, specs & data, write to that data (binary or text), as well as optionally lock the data making it read/only.

The smallest NFCs are cheap stickers and PVC cards are NTAG213, which supports ~132 characters URLs (there may be some invisible compression of text entries). These are used by a number of games (mostly android), but also some IFTTT scripts and trigger Home app scenes and features (tap table with a sticker under it to turn on lights to table, or put tag on back of iPhone or Watch case to offer a URL to a home page) [but an aside, some of these URLs are questionable security]. I don't have any yet to test, but reportedly can at least be read with any iPhone with current OS.

Most PVC cards, largely used as IDs, are NTAG215, which supports ~492 character URLs. Mostly PVC cards, some stickers, and some oddball devices like a ceramic ring for your finger. These are large enough to support VCARDs so that you don't have to go to a web page URL to receive contact info. I can confirm that my iPhone can read and write these, but reportedly some earlier currently supported iPhones may not be able to write (not sure).

There is also a slightly larger NFC version, NTAG216, which supports ~852 character URLs. These are rarer and are more expensive, and reportedly work with fewer iPhones.

There may be other NFC tags the iPhone can read, but I believe that it can't write to any of the others (yet.)

Our key goal is to allow export of crypto-seed, crypto-hdkey to individual NFC cards, and crypto-sskr to multiple cards. These will all work with NTAG13. However, it is also important to optionally allow one (or more) account descriptors to be appended (which requires an update to spec and code) or path to Ethereum family keys. These are likely to require NTAG215 -based NFCs, but is possible that there can be a compact QR form that only has seed and path to xpub that might fit on NTAG213.

A particular challenge with export of crypto-sskr is that it would be to multiple cards sequentially, requiring you to be careful to mark the cards appropriately, which requires some UX advice on what to write, and pause/delay before doing next one . There are slightly more expensive "inkjet PVC" cards that can be written on with a permanent marker (the standard PVC cards even permanent markers often don't stick). I may source some with blockchain commons logo and some help text for some common scenarios. [A related issue is that unpowered NFCs have a lifetime, maybe MBTF 10 years, but it may means any single NFC card in a set may fail in 2-3 years, so we need to put dates on the cards, and remind people to refresh them by rereading them every couple of years, and replace with new "session" if any fails. See https://twitter.com/ChristopherA/status/1490844476012904448 )

We likely will someday have some advanced scenarios for NFCs that creates multiple NFCs for multiple keys.

We also have to accept all of these forms and do the correct thing (related to #123 §2 & §3 for QRs with these).

Note that supporting receipt of URLs also means that other iOS apps can use SeedTool, which may mean we need to add some support for x-callback-url for those apps, and investigate if we can avoid accepting URLs for sources we don't know (in particular web browsers) without additional warning to users.

ChristopherA commented 2 years ago

We should more fully document the UR: scheme for v 1.5.

ChristopherA commented 2 years ago

This issues should be split into different issues, and closed. Only writing and reading PSBT to larger cards should be Release 1.5.

wolfmcnally commented 2 years ago

Please close when you feel the issues have been dealt with elsewhere.