# PIP-0031 · Proximity profile: Tap (NFC)

The Tap channel of PATH PROXIMITY. The payer's phone sends a nonce to the presenter at contact range, and receives the link of a token issued for that nonce. The same channel reads the chip of an identity document on the payer's own device, only as an input to a proof. Chip data never leaves that device or the member that holds the person.

## Why

A tap needs no camera and no screen on the reader's side: the payer holds its phone against a till, a terminal or another phone. Near-field communication is two-way, so the reader can give the presenter a nonce and receive a token issued for it. [PIP-0029](/pips/0029) defines the token, the binding, the screen the payer confirms and the receipt. This PIP is the profile of the Tap channel.

The same radio reads the chip of an electronic passport or identity card. This profile states the one use PATH PROXIMITY makes of it: an input to a proof of [PIP-0033](/pips/0033), read on the payer's own device.

## The profile

| Item | Tap |
|---|---|
| Channel | `tap` |
| Carriage | ISO/IEC 14443-4 at 13.56 MHz, with the commands of ISO/IEC 7816-4 below |
| Roles | The presenter answers as a card: a terminal, a till, the payee's phone in card emulation. The reader is the payer's phone in reader mode |
| Presence | `exchanged`. `shown` for a presenter read as a tag |
| Lifetimes | A token expires at most 60 seconds after `issued_at`. One token per tap |
| Reading | The exchange below, then the reading algorithm of PATH INTEROP |
| Confirmation | The floor and the in-person line of PIP-0029. Nothing more |
| Exclusions | Below |
| Conformance | `PATH-PROXIMITY.Tap` |

## The exchange

| Step | Command | Data sent | Answer |
|---|---|---|---|
| 1 | `SELECT` by name, AID `F0 50 41 54 48 50 58 01` | None | The profile version, one byte (`01`), then `90 00` |
| 2 | `PRESENT`: CLA `80`, INS `50`, P1 `00`, P2 `00` | `reader_nonce`, 16 bytes | The PATH link of a token issued for that nonce, UTF-8, then `90 00` |

- The AID is proprietary (category `F`) and assigned by this profile. Its last byte is the profile version.
- On `PRESENT`, the presenter asks the payee's member for a token with `channel: "tap"` and `presence: { "mode": "exchanged", "reader_nonce": … }`, the nonce written in lower-case hexadecimal. It answers that token's link.
- A presenter that cannot obtain a token within the tap answers `69 85`. The wallet asks the payer to tap again, with a new nonce.
- The reader checks that the token's `reader_nonce` is the nonce it sent, then follows the steps of [PIP-0029](/pips/0029#display-and-consent).
- Each tap is one exchange and one nonce. A presenter answers one `PRESENT` per selection.

## Presenters read as a tag

A presenter may also answer as an NDEF tag, for a phone that reads tags outside the wallet. Its NDEF message is one URI record carrying the link of a token with `presence.mode: "shown"`, issued for that read and expiring at most 60 seconds later.

A passive tag cannot issue a token per read. Like a printed code, it carries the PATH link of an address or of a request, and a payment from it carries no `proximity` block ([PIP-0030](/pips/0030#printed-codes)).

## Identity document chips

The Tap channel reads the chip of an electronic passport or identity card (ICAO Doc 9303). In PATH PROXIMITY, a chip is read only as an input to a proof of [PIP-0033](/pips/0033), with `method: "identity_document"`.

- The chip is read by the payer's own device, in the wallet of the member that holds the person. A presenter never reads an identity document for a payment.
- Access to the chip uses the document's own access control, with the card access number or the machine-readable zone the person enters or scans on that device.
- The device checks the chip's data against the signature of the issuing state (passive authentication), and the chip's own key where the chip offers one (chip or active authentication).
- Chip data — the machine-readable zone, the data groups, the portrait, the document number — stays on the device. The device sends the member that holds the person only what that member needs to match the document with its own file, in that member's own format.
- No PATH object, and nothing this channel carries to a presenter, contains chip data. What leaves the device toward a payment is the assertion of [PIP-0033](/pips/0033), signed by the member that holds the person.

## Exclusions

- The reader sends the presenter `reader_nonce` and nothing else: no identifier of the payer, of its member, of its account or of its device.
- The presenter sends the link and nothing else.
- No card application and no card data. A contactless card payment follows the rules of the card, outside this profile.
- No chip data of an identity document, in either direction.

## Rows that do not translate

| PIP-0029 | Tap |
|---|---|
| `presence.mode: "shown"` | Only for a presenter read as a tag. The token is still issued for one read |
| Distance | ISO/IEC 14443 works at a few centimetres. No object states a distance |

## Conformance

| Profile | Requires |
|---|---|
| `PATH-PROXIMITY.Tap` | Presenter: the AID and the two commands, one token per `PRESENT`, issued for the nonce received, lifetimes above. Reader: a new nonce per tap, the nonce checked in the token, nothing else sent. Identity document chips read on the payer's device only, and chip data in no PATH object |

Declared with `PATH-PROXIMITY.Core` ([PIP-0029](/pips/0029)).

## Compatibility

Additive. A reader that does not select the AID can read a presenter as a tag, and receives a token with `presence.mode: "shown"`. No existing object changes.