(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=40769001

本文讨论了在公共交通系统中实施近场通信 (NFC) 或快速响应 (QR) 码等先进技术的挑战。 作者认为,尽管技术取得了进步,但由于升级成本高昂以及政府资金集中在昂贵的合同上,许多运输系统仍然过时。 举个例子,在威尔士,将路标从每小时 30 英里更改为每小时 20 英里的费用高达 3400 万英镑。 文中指出,虽然 NFC 和 QR 码具有读/写功能、更长的数据容量和易用性等优势,但这些技术面临着开发成本增加、潜在的伪造问题以及各种系统之间缺乏一致性等障碍。 作者提到,QR 码可以轻松复制,而且通常是只读的,与 NFC 等 RFID 技术相比,需要精确的方向和较慢的读取时间。 NFC 具有数据持久性、可回收性和实时使用监控等优点,但缺点包括需要持续的网络访问以及缺乏与现有基础设施的广泛兼容性。 然而,本文最后讨论了通过站点之间的云同步和用于跟踪和验证交易的实时、半持久互联网连接等解决方案来改进这些系统的持续努力,旨在提高便利性、效率并减少浪费。

相关文章

原文


To peoples asking: "Why not just QR codes?" Again it's all about latency. QR codes take longer when you tap them at the gate: opening the app, waiting for the scanner to adjust, connecting to inet. While NFC handle these tasks almost instantly. A big difference in super busy places where queues are a nightmare.

Again, this problem wouldn't exist if we can optimize WFH methods. We don't need to solving "physical problems" from start to finish. Making, distributing, and recycling all those ticket papers.

No matter how advanced your transportation tech is, moving people long distances is still really costly. Sorry to "steer" this conversation into WFH and WFO topics.



Why would a QR code require Internet, or an app? You could just print it on paper and track the corresponding balance on the server side. To my understanding this is what most transit networks do anyways, to prevent an enterprising user from modifying their balance on the card itself.

(The optical scanning argument makes sense, however.)



In some places, like Oslo's metro, tram & bus systems, the solution is that there are no ticket barriers, you're trusted to have bought a ticket for your journey. There are occasional ticket checks with big fines for non-compliance.



I was watching a travel show about France and in Paris it seems tourists can get confused as to where their ticket is for. They can easily end up on a train in an area their ticket isn't for. You get a 100 Euro fine! And that's an honest mistake not trying to get away without buying a ticket.



Pretty sure you wouldn't want to make two of those in succession. I mean, last time I had to pay a fine for not having The Correct Blessed Type Of Ticket, I did pay a lot of attention to the tickets I bought next. (Wasn't as expensive as in Paris, but still a palpable mistake.)



Yeah, that kinda sucks.

Last year I bought a friend a ticket from Avon (just south of Paris) to Charles de Gaulle. I rode along and we stopped for lunch in Paris.

He carried on to the airport, met mr. Ticket man, and got a €100 fine for taking the route printed on his ticket, but too slowly.

I can’t understand what they’re trying to incentivise by doing this to tourists.



Many cities in North America do. The key is the fine for not having a ticket is high enough that you are on average much better off having a ticket. Generally this works out to enough random inspections that the average person is checked once a month, and the fine for not having a ticket works out to the cost of a 3 month pass. The exact numbers are of course subject to debate, but the above should give any city a good starting place they can play with.

IMHO, if you have fare gates they need to be tied into a parent control system so that parents to limit where their kids are allowed to go alone. I've never seen the implemented and the details are important to get right.



Where I live, I'd be far better off not buying the tickets. The fine is less than 2 months with a pass and I'm checked 2-3 times a year. Yet most of these checks don't find anyone without a ticket. Monthly ticket costs about 1.5% of average monthly income for that city, less than 4% of minimal wage. I'm quite convinced that reasonable pricing is the key.



>There are occasional ticket checks with big fines for non-compliance.

I'll likely mangle the explanation but this sort of policy does not fair well when there is a large divide between have/have-not and little/no social safety net.

If you are poverty level you will be forever stuck in this cycle: Ticket/fine, court, loss of income, etc. What might work is simply granting free access below a certain income threshold.



There should be a program for the poor for sure.

Also a program for free rides to places like abuse shelters (for all genders - battered women is sexist talk!), voting booths and others similar locations should be in place - if you are going to one of them the checker verifies that are on the direct route to such a place and gives you a ticket - once you get there they validate your ticket - while if you don't arrive they send the police looking for you (in the case of abuse not arriving is a sign of urgent trouble, in other cases the police can arrest you when they feel like it)



Interesting! It's a good way to test how successful the city is with their education systems. We could try it out one day a year at least.

Differentiate nomal daily sales rates within the test day, observe the trend year by year. Sounds naive, would be lovely if it works.



There was a push for a gated system here, some years ago. The vendor tried to sell it on massive cost savings...and was publicly humiliated by a bunch of geeks with an Excel table. Turns out, installing and running the gates would, at best, bring parity with random ticket inspections+fines - while impeding passenger flow as a bonus.

It's not necessarily a matter of education: just the feeling of "not worth freeloading (at the price), I'm likely to get caught anyway" is sufficient.



Calgary's light rail is like this, at least to-date. I don't know if fare compliance is an issue, but security and homelessness is and that may add physical fare-only barriers in the near future



I'm not sure that necessarily explains the need for single-use NFC tickets, though. There could be a more durable serial-use or permanent card with NFC that regular commuters could buy, and if those commuters are the vast majority of rush hour passengers, it might not be such a problem if single-use tickets had a slightly slower system.

Of course that'd mean having two recognition mechanisms, so the operator might opt for NFC and chips for single-use tickets anyway to make the system simpler. But somehow having single-use tickets with chips on them does seem wasteful to me.



We have those, with two recognition systems. The system the article describes is for the low count, disposable fares (a few tickets or a 3 day pass). Most people in Montreal have a chip card (the OPUS) which is reusable (and 5$ to buy).

The OPUS is also super interesting because it's a stored value card that holds the tokens on the card as opposed to a simple ID. The system was developed when cellular connectivity was still spotty, so they needed a card that would work on buses without internet access. It's pretty bad from a UX point of view though: you can only store a few different kind of fares, you can't recharge the card online (until recently you had to go to a terminal to do it, now there is a NFC phone app), you can't declare a card stolen, etc.



Can confirm that in Montreal there is a permanent version of this card (la carte OPUS) on which you can reload more tickets.

There are even semi permanent ones you can buy, which are good for say 1 day, 1 weekend, or contain 10 passes.



That latency is time stolen from the other people who are already on transit (or waiting in line to get on) who get there later. All this latency is the type of thing that makes people want to quit using transit and just get a car. (and then build more roads to deal with congestion - though road users often have more options to avoid this latency and overall generally go faster than transit despite the congestion - remember it is end to end trip time that matters not time to get through a bottleneck)



Haha, absolutely! Just to generalize, those thousands of people can also watch the match by streaming, right? It's all about remote versus physical activities.

We can't shift everything into remote mode. However, we don't need to hustle into physical mode every day either. Yeah, yin yang complexity, balancing everything out.



i’m not a sports fan, but the feeling of being there can’t be compared to watching the event from home. this is not the part to optimize, in my opinion.



Not really a comparable thing versus the morning/evening rush every single weekday when forcing people in-office. It's the scale that makes it an issue, 1000s of people is nothing and more of an occasional spike.

See how London deals with toob stations for pride, for example, by closing and controlling some, exit only periods close to the event, open ticket gates, etc.



NYC OMNY allows for direct payment from a debit/credit card via NFC at the turnstile. this has privacy issues but i think they're ameliorated if you use a smartphone.

i think you can buy a transit payment card if you need one.

no paper tickets. cool ephemera but pretty wasteful.

would be pretty cool if/when we see a day where provably private cryptocurrency microtransactions allow for both real privacy and the 7 day fare cap feature.



I like London’s version of this. You can just tap your credit card or phone at any station, and it will even stop charging you after you rack up £8 in payments over the course of a day. Just pretends you had bought a day pass in the first place.

Really leaves a good impression, knowing that they could have gouged you but chose not to.



Crypto isn't private as traceability is an inherent requirement for crypto to operate.

Anyway with OMNY.

You just buy a OMNY card and load it with cash if you want privacy. They are being slow to roll the vending machines for these out due to vendor issues but it's growing and they can't discontinue the MetroCard until they have all the vending machines in place.



The UK rail network already supports QR codes, with the busiest station handling over 80M entries/exits per year.

Meanwhile, the integrated subway/overground/bus network in London supports direct payment with NFC smartphones, without the need for an intermediate "smart" paper ticket; the infrastructure for vending those; or the (not insignificant) cost of producing the tickets. Not sure what Montreal was thinking!



Even better, London doesn’t need NFC smartphones: if you have a chip bank card with a chip for tap payments, just tap that. For those of us with smart watches, they do the metro fast pay thing as well, so I literally just tap my watch without having to press anything or get anything out of my pocket. If my watch battery is dead, I can just a bank card.

The only advantage to having Oyster is if you’re travelling enough to justify a monthly pass (daily and weekly caps are respected on bank card taps), or longer.

I travel a lot across North America and EMEA, always glad to get home and deal with London’s transport network: it’s the only one that is really designed around, built for and feels invested in the passenger experience.



I can't see big technical limitations resulting in slow QRCode scanning. We manage to detect fast cars going 120mph to fine them, we can read fingerprints instantly through a screen. We can take pictures of galaxies light years away.

30 years ago you could kill ducks with the NES guns instantly and it worked by detecting pixels.

I'm sure we can figure out how to analyze black squares and turn them into a number under 50ms.



Touch x against y versus line this weird printed shape up at just the right angle in good lighting conditions. I feel like NFC is much easier to tell older folks how to use as well.

I'm all for the "we have technology why tf don't we use it, why aren't we better at it" argument, but the truth is that a lot of tech/systems in transport & other areas are retro af and new stuff gets shoe-horned in with all the caveats of a shoe-horning in.

Stuff doesn't get upgraded often, because it's expensive, because all of us vote for politicians that grant expensive/overpriced gov contracts putting money into them and their mates' back pockets. We'd be able to refresh public use tech all the time if it was non or low profit, never gonna happen tho.

Look at how much it cost Wales to change 30mph signs to 20mph: 34m£! And that's just for a few small areas, not everywhere they wanted to do. How in the f u c k, do you spend 34m taking down and putting up some signs? Those are ludicrous prices & all of us just completely ignore it bc we're too busy arguing about skin colour, which sex the person I sleep with is, or trans people being in the bathroom they want to be in, etc. Honestly.



> weird printed shape up at just the right angle in good lighting conditions

None of that matter. QR code can be read on any angle because of the 3 position detection patterns it comes with, by design.

Lighting conditions are not a problem on tickets (which is what the article is about) because you can illuminate the paper from the camera.

QRCode were fast on assembly lines two decades ago. They were invented in the nineties, at a time where we had slow processors and shitty cameras.



Actually, they do matter.

Assembly lines give you GREAT control over where the code is located, how it's lit (consistently), and what you do on read error (can't shunt off the passenger to a read error bin, so they don't hold up the line). Rotational angle doesn't matter, perspective skew does. And then - it's a leaf of paper, so you get folds and obscured parts (yes, correctable...up to a point).



The Stockholm Metro and public transport uses QRs, but on phones, and it's awful. The huge variance in people's shitty broken, dim phones make it take 3-4 tries sometimes. Infuriating! The scanners themselves are brilliant though, but nobody wants to stand in line for some printer machine and need to carry a flimsy bit of paper around.



The article talks about tickets with chips in it, which means you could provide the same ticket with qr code, only cheaper and less polluting.

No variance.

People can then use nfc with their phone, which doesn't have the pollution problem.



In 1994, no less.

I don't think people realize how limited the hardware was at the time.

They think because their phone is slow at scanning QR codes, that's how it must be. But the phone is not a dedicated device for QRCode scanning.

It's like someone saying they get blurry pics of cars on the highway so clearly speed limits are not possible to check automatically.



> Presumably, the makers thought that making the card look like a smart card would help people understand it. The card actually uses an entirely different technology.

It’s kind of the same, though. The physical communication layer is different, but the higher protocol layers are basically identical. Smart cards with contacts follow ISO 7816. These MIFARE contactless cards are ISO 14443 Type A cards, and their protocol follows ISO 7816-4.

This shouldn’t be terribly surprising — the entire ecosystem built for smart cards with contacts wants to support contactless cards with minimal changes, and this includes the host software, the readers, and the logic in the cards. There are even plenty of devices where the same device supports contact and contactless uses — plenty of credit cards, bank cards, and FIDO devices are like this.

This is analogous to WiFi and wired Ethernet. They’re have very different physical layers, but they are logically compatible, and the same software supports both.



One of my claims to fame was being part of the team that built the first online banking site for a bank in my country around 1997.

One of the things you could do was pay certain types of widely used paper invoices. When I was brought on, the UI for this was just a standard HTML table with labels and input boxes. I decided to build a prototype with a paper invoice image as the background and a textboxes places where the numbers appearred on the paper invoice.

When people paid the invoice, they would have the paper version they had received by postal mail next to them. Now, their mission was to enter the numbers so they would end up with a visual one-to-one copy of the paper invoice on the computer screen. It made it easy for everyone to figure out which numbers to enter.

People embraced this immediately, and all forms were changed to follow this principle. All banks implemented it in their banking apps and still use it today.



In my country we used to have a heavily standardized type of money transfer card. It'd be used both for regular wire transfers in a "fixed payer, flexible payee" form where you'd get a booklet of them to fill out later, and "flexible payer, fixed payee" form you'd get mailed to your house to pay your bills, only having to write your account number on them, sign it, and mail it to your bank.

They were designed to be machine-readable from the start for easy processing at the bank, and one of the ways they did this was by having all the fixed data encoded in a special font. When we started using smartphone banking apps, you'd just be able to scan a bill with your phone and it'd immediately read out all the data, fill in the missing stuff, and you'd only have to tap "confirm" to do the actual payment.



Around the same time (2001) I worked for a startup that was doing the same thing but with Flash instead of HTML. We were building European export forms. People really liked the UI side of it.



Only ISO 14443-4 uses the same protocol as ISO 7816 (another way of saying this is that ISO 14443-4 represents the higher layers of ISO 7816 over a different physical interface), though.

MIFARE Ultralight does not actually implement 14443-4/7816/"smartcard"-style APDUs; it's significantly simpler, since the ICs are much less powerful.

To make things more confusing, some MIFARE ICs really do implement ISO 14443-4 (e.g. their fixed-function MIFARE DESfire cards, and their programmable smartcard ICs like SmartMX), but not all of them.



QR codes seem like a better ticket medium.

This is like a 100 bytes, a qr code can be over 2kb

This is a cheap plastic substrate with ink printing over the top. A qr code is just ink - or some other even cheaper printing process if you prefer.

This needs a specific ticket technology supplier over the next 10’s of years. QR codes can be drawn on screens or printed on paper and you can change suppliers for every component - from mobile phone apps to paper type to physical printer and reader devices - until your heart’s content over the next years. That flexibility can’t be underestimated in a space like public ticketing over decades.

Issuing replacement tickets needs physical presence to collect the ticket, vs qr code which can be emailed, sent on whatsapp, shared as a screenshot or photo if you need to, but of course you can still exchange physical paper qr codes if you prefer.

The rfid reader for these are cheap and durable, the optical reader for qr codes can be almost as cheap and almost as durable but not quite, the rfid wins this one point by a small margin.



I've worked in public transport ticketing for the past 30 years including the first system outside Japan (Hong Kong's Octopus).

The problem with QR codes:

1. If they're printed, they can be copied.

2. "Dynamic" QR codes can be screenshot.

3. They're read-only (by definition)

4. Readers are slow, require good orientation by the user.

NFC is good because it's read/write, has a ~10cm range, the larger cards can hold up to 4K of data, the ultralights can replace single journey tickets and can be recycled like magnetics being captured at exit.



I don't think the suggestion is the QR code contains the ticket info, but that the QR code is the unique tag into the back end virtual ticket system. 1 to 3 are not relevant in that context, and 4 isn't borne out in my experience with modern readers (they're used in the bar code mix at parkrun and they read time is vanishingly fast with a smart phone, generally better than barcodes). The number of bits might increase the difficulty if capturing the code, but I would very surprised if a fast, robust system can't be built.

The huge disadvantage of NFC in this context is the electronic waste necessarily produced.



You can fail open. The QR code contained a signed ticket ID and expiry. You locally validate the signature and expiry and remotely attempt to validate reuse. If the remote validation is slow or fails just accept the ticket and log it.



1. Thats ok. If you’re expecting your rfid tokens not to be copied just because it seems inconvenient to do so, you’re in for a surprise! Your ticketing system cannot assume tickets in any form cannot be replicated- they can be and if you introduce such a vulnerability in your system, you will lose revenue

2. As per 1, no issue

3. That’d be a great feature if true, I’m all for immutability. However , qr codes can be defaced easily, hopefully the built in checksum defend against that. a more likely threat your system needs to defend against is that new qr codes can be generated extremely quickly

4. Both systems are the same speed, both systems require accurate targeting by the user, an rfid token slightly askew of the reader will not read since it won’t be able to influence / absorb the generated rf - most of these systems work by providing power to the rfid token and it communicates back not by transmitting its own signal but by exerting influence on the signal it’s receiving. It’s a very very low power interaction and very sensitive to positioning

A better problem than 4 is that you entail staff overheads with a visual system to keep them clean.

Read / write is a bad feature, you will lose ticket sales.

Recycling these is not practical. Direct reuse risks jamming the vending machine (used tickets end up subtly bent, very hard to reliably deal with), actual recycling isn’t viable, the energy required and emissions produced exceed that of creation of a new card from raw materials.



> Your ticketing system cannot assume tickets in any form cannot be replicated- they can be and if you introduce such a vulnerability in your system, you will lose revenue

Yes, the question is not whether such system would be abused, but how much. But this is in the end what businesses care about.

Will QR codes be abused more than NFC chips? Likely yes.

Will it produce a larger financial loss than the cost of the NFC chips?

Can I mitigate these losses by a centralized validation system (each terminal needs a network connection with low latency guarantees)? Sure, but how much will it cost?



>> there’s less need for centralization of data storage and code logic

You make it sound like less moving parts are a bad thing :-)

I know what you're getting at though - the decentralized tolerance of network partitions and the ability to provide higher availability and faster decision speed at the entry barrier.

The system design constraints are hard but not impossible, my back of napkin maths says 5k/ticket scans per second with 99th percentile latency < 1000ms not only satisfies every use case that exists today but allows for 3x population growth beyond!

There's a few things in your favour when designing this system though. For example, in the case of network partition, you have geographic locality so a pen drive delivered a couple of times per day is likely feasible.



The problem with QR codes is that they are read-only.

I don't know about Montreal, but Moscow public transport uses similar paper tickets, also Mifare Ultralight, except you can get them for different number of trips. When you use your ticket, the turnstile or validator would increment those one-way counters so that the next one would know how many trips you have left. You can't do that with a QR code without either the reader or the user's device having a persistent internet connection to some sort of central server that would keep track of all tickets, which is impractical.



Once I searched how Japan do the synchronization of the data in the IC card because I can't imagine how they handle all of the traffic for millions of people especially in the rush hour.

So the solution is the transportation card is writable, and each train station acts like a small data center. They sync the data periodically to the main data center.

I think the syncing tech is getting better, Japan train companies are going to experiment with QR code soon. So read only is feasible.



> So the solution is the transportation card is writable, and each train station acts like a small data center. They sync the data periodically to the main data center.

That's also how the two subway systems I'm most familiar with do it here in Russia. In both Moscow and St Petersburg, the data stored on the refillable tickets (Troika and Podorozhnik respectively) was thoroughly reverse engineered. People who did it, of course, tried to write them too — for example, you'd make a dump, enter a station, then restore the dump with your old balance. It worked, but only for a day or two, after which the card number was added to a blacklist that all turnstiles check cards against. The conclusion was that there's a server on each station that turnstiles talk to, that syncs with some central server each night (when the subway is closed), where all system-wide transactions for the day are collated, and if anything is off, the card is blacklisted.



Japan railway companies in Kanto region are moving to QR code for individual ticket in 2027.

The bulk of the ticket will still be the Felica card though, because as far as I know neither the QR code or EMV open-loop system can handle required throughput of 60 persons/minute/gate.



I think semi-persistent internet is not such a big deal for a lot of providers. For Opal here in Sydney AU it uses a connection for some features. Cards can be anonymous or assigned to an account, the account shows all your trips online, so there's some required connectivity for that. The cards have a smart chip, but credit cards or phones can now also just be tapped directly, so it needs to match up when you tap off and determine where you started and how much to charge. This includes buses, which use 3G IIRC, and may drop offline sometimes.

To support the above, they did away with multi-trip tickets like you describe. It instead tracks and discounts once you hit a weekly limit (yes, you have to give up your privacy for this with an account or use your credit card directly). Not great for intermittent travel.

For systems like this the question is: if the internet is down and a few people get a free trip, does it really matter? You don't always need 100% accuracy if it makes everything else simpler, like removing paper tickets, printers, litter, etc.



Fun tangent: I hit a bug in Opal recently with the stored value cards. I was able to obtain a balance that read out higher on the exit turnstile than on a top-up machine. I'm pretty sure this was related to a recharge that failed and then eventually succeeded. Multiple top-ups later and the difference seems to persist.



NJ Transit uses QR codes for all train tickets and it works well enough. It's not quite as seamless as a tap card but NJT has moved largely to mobile ticketing and they're in the odd position of having to scan tickets both at turnstiles and by train crew (handheld scanners); cards would be awkward in the latter case. The paper tickets used to have magstripes but once they adopted QR codes for the mobile app, the tickets lost the magstipe and gained a printed QR code.

So the central server model is practical. The user's device has to have an internet connection at some point to activate the ticket within a reasonable period before using it but the connection doesn't have to persist after that. I don't know how their handheld scanners work in the Hudson River tunnels where there is no cell service but they do, so long as the user activates their ticket before the train departs.



> cards would be awkward in the latter case

Do you mean it would be hard for staff to scan cards? Here in the Netherlands both qr and cards (travel cards + bank cards) can be used at stations, and are read by the staff on the train.



You're correct, there are a bunch of different ticket options. Not sure about how it's actually implemented, though.

Slightly tangential, but when I was in Montreal, I was blown away that you just purchase a ticket from a machine and you get a printed out ticket with an NFC chip inside. Not my favourite part of the trip (Montreal is beautiful!) but definitely a cool piece of technology to see being put to such a mundane use.



I am not sure which part is impractical. In India we already use QR code for metro tickets. The system design is definitely different from one mentioned and mimics more of how airport tickets work.



How does the system know that the ticket was already used?

The thing with plane and long-distance train tickets is that you buy them for a specific route. So all the checking only needs to be done at your departure station/airport, the code for which is encoded in the ticket, and the rest of the system doesn't need to know anything about it. But you can't do that with city transport. When there aren't multi-use tickets, people would often buy multiple single-use ones at a time and use them as the need arises, without knowing in advance when, where, and from where they'll be going.



Fair enough. I went through qr code of my previous metro ticket to see what info they encode. It is non standard so there were - some hashes - type of ticket, in my case single use, - time of issue, - valid upto time, approx 10hrs, approx journey time was only 30 min - ticket id - I could not directly see source/destination address, but it is my hunch that atleast the destination address is encoded

Now this one time ticket needs to generated before entering the metro station and the qr code is scanned at * both entry and exit*.

I think the entire system works on daily rotating ticket id validated using unique hashes where a ticket validity period is tracked. I think this should be enough to ensure non-reuse of same ticket.

The caveat is, I have always only bough one time ticket which is the only mode allowed in qr. For daily traveller's, they need to buy token/card which is NFC based.



Thinking of it, QR codes make sense for when you buy a single-use ticket at the station with the intention to use it immediately.

We actually have this for suburban trains, it's just a receipt with a 1D barcode on it. You use the barcode to open the turnstile (on some stations where they are installed), but otherwise the tickets are checked by controllers that occasionally go through trains.

For getting around a city though, I don't see much of a good use case. In my city, if you're here for at least several days, you're expected to buy the refillable card. If you're only here briefly and only need to use the metro a couple times, it's 1.5x more expensive but you'd buy tokens or tap with your bank card.



The system can just keep track of whether the ticket has already been used before. You don't have to store the information on the ticket itself. You can store the information on a central server, connected to all the gates.

The ticket itself just has to encode an ID, and then the central database contains an entry for that ID that is checked by the gate in real time. When the ticket is scanned at a gate, the database gets updated.



>You can't do that with a QR code without either the reader or the user's device having a persistent internet connection to some sort of central server that would keep track of all tickets, which is impractical.

This is literally how all of the UK Mobile Train Tickets work. The ticket is a 2D barcode either on screen or on paper. Every gate / scanner operated by a guard records when the ticket has been scanned. They are synchronised and a ticket from being scanned twice. It's not that deep



But that's a train that goes outside of the city or between cities. You usually buy a ticket specifically for the route you're taking so no system-wide synchronization is necessary, only the origin station needs to know that you've used that ticket.



it would be interesting to create a wipe mechanism to erase the existing QR code (may be a belt/sander, or a laser like those rust cleaning lasers), and print a new one on (may be even use the same laser as the wipe!).



IC transit cards in Japan use heat-rewritable ink for something similar.

The ticket vending machines print your monthly transit passes right onto the face of your card at the beginning of the month, and erase it after it expires.

It's not a QR code though. Just human readable text for bus drivers. (Turnstiles in the subway still read the pass via NFC.)



If you really want a system that uses optical scanning and allows one ticket to be used multiple times, just make sure that there's enough room on the ticket for one QR code per trip. When validating, you'd print a new code in free space. You can also either print something over the old one to invalidate it, or just leave it and let the system itself figure out which of the codes is newest.



One advantage of the RFID, is that you can modify the ticket while using it. This is actually what made Montreal choose that solution. There's no internet connection to validate the tickets, they just update the ticket to say they are used.

I would have said that make it much more resilient, but I have seen so many buses that couldn't accept fares... I'm not so sure if it's the case.



When I lived in Shanghai 6 years ago they were trialling QR for the metro. It was really bad, always huge queues with people struggling to get the right angle/illumination/whatever to make it scan. I’ve never seen similar issues with contactless methods and in fact I think SH subsequently moved to them. The amount of data stored seems pretty trivial to scale if necessary.



When I was in Shanghai this year I used a metro QR code via AliPay, and it seemed everyone else did too. There didn't seem to be any issue with scanning them so I guess everyone got used to that. There was however a queue by the security theatre bag scanning device at every single ticket gate.



The two big things that QR codes have going for them is that they're cheaper to make and that they can be trivially displayed on a smartphone screen.

Contactless ICs are more powerful in every other aspect: They're rewritable (allowing reusable tickets), they can support challenge-response authentication (allowing secure offline usage, which in turn makes for faster transactions at the gate), and they're much less finicky to scan in my experience.



Your comment sounds good for overland rail, bus, event tickets, airlines etc and indeed QR is common.

But for subway/metro, during rush hour throughput it is important to able to tap an RFID almost instantly. QR is too slow and error-prone for subway/metro.

The world (including Montreal - these tickets are going away) has converged on credit card / phone / top-up charge card for that reason.



I was in Rotterdam recently. Their metro system uses multiple approaches, some kind of RFID for hard tickets, NFC payment (without a ticket at all) and QR codes for time-limited tickets that you can buy in a phone app.

Getting those QR code readers to read the QR code was a nightmare. Almost all the cameras have heavily scratched protective windows in front of them, which makes the reading process a struggle of trying to find a working angle. Of course the scratching is vandalism, but subway systems must be robust against vandalism, cause it's something that happens and must be expected.

I switched to per-transit payment via NFC after using one of the time-limited tickets and realizing that you need to consider yourself lucky if you find just one working QR code reader at most stations. NFC worked like a breeze.



QR Codes are fine for one off event entries. For a transport medium that requires fast high volumes of people to go through its an awful idea. QR Code reading is slow, you can't avoid that.



Its slow because it's read by a camera. That takes extra steps, and like you mention, lighting conditions. A QR code has to be detected, read and decoded, and thats after the image is processed. An NFC is orders of magnitude faster. Heck even an old school magnetic strip is faster than a QR code.

A better application for QR codes is scenarios where it doesnt matter that its slower. Airline checkins, concert tickets, etc work well, a busy subway where people are queueing to get through a barrier as quickly as possible is one of the worst places to use it.



My understanding is that the STM (runs the Métro) likes to keep fares on the actual paper tickets or rechargeable card, rather than in some central database.

The paper tickets can hold many fares, including unlimited evening fares or two day fares. I believe this would be hard to pull off with QR codes without having to keep track centrally.



Unlimited fares should be extra easy with a QR code. Just put a signed expiration date.

If course duplication is probably a bigger risk for these tickets as they case be simply locked to one use server side.



RFID is less angle dependent on reading well quickly. There are delays boarding planes trying to get everyones phone to scan while the NFC seems to work a bit better just hold it up to the reader and walk through.



> QR codes seem like a better ticket medium.

If it was a short-lived QR code generated on your phone, then maybe. But the whole point of MIFARE Ultralight EV1 cards is that they can't be cloned. It's for repeated use, not for printing and using once.



This is fascinating. We were just in Europe where we experienced these tickets for the first time. I had trouble with them; I was trying to figure out how to scan them because it never occurred to me that they might contain an NFC chip.

My wife, on the other hand, who is not at all technical, took it for granted that you would tap them and immediately figured it out intuitively.



I have found the same thing with my wife. I'm a technical person, but I'm extremely bad with tools and such, including the ticket thing. If no one shows me how to use it I'll probably figure out a way to insert it somewhere. My wife won't have any problem with this and other small tools.

The same thing with IKEA: I always rely on the manual and just blindly follow the instructions, and gets very frustrated if the instructions miss one step.



> The same thing with IKEA: I always rely on the manual and just blindly follow the instructions, and gets very frustrated if the instructions miss one step.

Thing I figured out assembling IKEA stuff in the past few years: if it seems like they skipped a step, look carefully at the details in pictures. Perhaps use a magnifying glass. There's going to be only one way to get from step N to step N+1, and all the information to figure it out is there. The drawings of all the pieces, from major parts to tiniest of screws, have accurate details, and there's enough of them to disambiguate the situation.



You really do need a magnifying glass for some of those details, as the (asymmetrical) holes that ID which way some part must go become dots at the scale they print some of the manuals. You're absolutely right though: all the info is there, just got to work it out



I’ve never seen them skip a step.

Basically all other flat pack furniture I’ve ever bought has, but none of the dozen or so ikea items I’ve assembled. It’s part of why I only buy flat pack if it’s ikea, now.



I recently assembled two non-IKEA flat-packed items from two different vendors.

One left out details in the diagrams in each step that they had deemed irrelevant to that step. This apparent attempt at simplifying the instructions stumped me for ages because I kept thinking I'd oriented pieces wrong due to the number of holes in the picture differing from the number of holes in the physical thing.

The other had switched some parts since the instructions were made, and hadn't bothered to update the instructions. This was a bit more obvious, but still kinda irritating for someone like me who is uncomfortable with uncertainty when I believe certainty should be attainable.

Whatever else can be said of IKEA, their manuals and quality control are excellent. I think of them as the McDonald's of furniture — it's never the best product, but it's damn good for the price, and you know exactly what you're going to get.



> The same thing with IKEA: I always rely on the manual and just blindly follow the instructions, and gets very frustrated if the instructions miss one step.

Following instructions is a good thing. Plenty of people damage stuff when putting it together since it looks obvious, but they usually miss critical details. I would imagine that the people who designed the card scanners had to put a lot of thought into their design simply because they know many people won't read instructions and would do as you suggest: figure out a way to insert [the card] somewhere.



For things like IKEA furniture there often is a good engineering reason to do things in a specific order that is not obvious. For furniture this is okay - nobody does it often (or if you do it is a few things that you memorize the instructions for).

Transit has different considerations though. It is critical that doing the right thing is obvious without reading instructions. Someone might have an important meeting to make and the time to read the instructions (or wait for the person in from of them to read the instructions) means they are late. Or (worse?!?) that time spent in line is annoying enough that someone decides to buy a car. You can somewhat get around this with more fare machines - but they are expensive and take up a lot of space. Fortunately we have human-machine interaction specialists who can tell you how to make a fare machine that is easy to use correctly without needing any instructions.



"I always rely on the manual and just blindly follow the instructions, and gets very frustrated if the instructions miss one step"

But why do people make incomplete manuals? If I have a step by step guidance and it doesn't work, because some steps were left out, than this is just a wrong manual!

(I share your frustration)



Because most companies view the manual as an afterthought. You've already bought it. What are you going to do if the manual is bad, return it? And even then, you're returning it to a third-party store - the manufacturer isn't going to care care. You bought an ShelfExpress for 50% off at Furniture Mart, can you really expect them to care?

Ikea, on the other hand, prides itself on user experience. Everything is Ikea-branded, so any complaint will come back to Ikea because the buck stops there. Everything is sold internationally, and they don't want to translate it into a dozen languages, so they have to make clear assembly diagrams. Their entire brand is built around having great assembly instructions!



Typically this means they stepped the design and didn't bother to revise the doc, or used up the stock of manuals for the old version before starting on the new ones.



The fake chip is definitely weird!

The logo you mention (four arcs actually) is owned by EMVco though, and they let people only use it for credit and debit card contactless payment cards.

There’s also an NFC logo, but as mentioned elsewhere, these cards aren’t really NFC cards, so that would also not be the right thing to use (I believe the NFC forum wants something to happen when you touch anything bearing that logo with your phone).



It's getting better but, in my experience, once metro systems got away from manned booths and tokens, the systems worked fine for commuters but led to lots of fumbling and long lines for tourists.

Trains in the UK still have a certain amount of "Which of these tickets/receipts go where?" while a line of irritated locals is building up behind you. Fortunately, also being the UK, someone will help you if you're struggling with something sooner rather than later.



Not really. My last trip to the UK I ended up--because of a complicated trip--with more of a bag than I should really have had on public transit. I was actually a bit embarrassed but a few folks were super-helpful with tube stations that were, shall we say, not exactly mobility friendly.



I'm not a Londoner, but I am British, and so feel qualified to say that you don't need to feel embarrassed :) I've travelled with over 100L of luggage on the Tube before - it's my contribution to the trains' traction!



I'm into transit and so I did my best to understand the system last time I went someplace - and it still took me a few minutes to figure out what I needed to do last time I went to a new city. And the tourists who didn't think to look this up in front of me took even longer. Nothing was hard, but when you don't know exactly what you need it takes some time to figure that out.

The above assumes you know you will be there and so can look things up. I wasn't planning to leave the airport in one city so I didn't look up what locals do - then weather made me miss the connection and I was stuck in a city for a day.

Locals going to a new part of their own city often have the same problems trying to read the map and time tables. They are faster than tourists, but still need extra time because they don't know what is going on.



Poor UI is poor UI. Recently visited system which supports contactless payment. So the terminal is there. And it has arrow to left with logo of contactless payment. Logically first thought is that you just swipe card from right to left over it right? No keeps failing, is something wrong with my card? Also other card does not work...

In the end assholes designing it hid the payment terminal in such way that you can't see it from usual angle of use.. Amazingly hostile user design for those that rarely use that transport system...



I always read up on how the local transit system works when I visit a new place. But that’s never adequately prepared me to smoothly use a public bus like a local would the very first time.

Some transit systems are just inherently more confusing than others. It doesn’t matter to the locals who know the quirks, but that doesn’t mean something can’t be improved. NYC has a great subway system, but I find the signage and general wayfinding quite lacking. Tokyo’s system is on a similar level of complexity but has excellent wayfinding and is generally much easier for a tourist to use.



I recently visited Paris. I read up and watched videos on how to use the metro. They didn't really cover many of the important local customs: I let people off the train before trying to cram in and I held the exit gates open on my way out of a station so they didn't slam in the next person's face. I must have stuck out as a tourist. The "act like a local" public info available is never sufficient.



“Make the damn train work” is not a local custom. Aside from that the UK rail system is so complicated and expensive you’d expect a manned gate at every station at the least.

£150 from London to Leeds?! I can fly halfway across Europe for less…



£165.90, to be precise (anytime single). Or, if you travel late-morning to early-afternoon, £70.20 (super off-peak single). By booking weeks or months in advance, you can travel for as little as £22.50 (advance single).

The unofficial BR Fares[1] website does a lot to untangle the complexity, although it can only do so much to mitigate the expense.

[1]: https://www.brfares.com/



Making purchases ahead varies quite a bit across Europe. The UK seems to fall pretty hard on the you really should buy well in advance side or you're going to pay through the nose.

I used to work with someone who, even on an expense account, would roll their eyes if someone wanted them to do a last minute trip to London.



My guess would be that they used plastic chip cards before (those often also do NFC) and only switched to the paper cards later - at which point they either deliberately copied the whole design including the chip contacts to make the switch as unnoticeable as possible or just lost or couldn't be bothered to find the original design files and scanned an existing card for the print template.



> I wonder how your wife thought of it?

Probably because it's around the size of a credit card and has fake smart card contacts printed on it. That being said, I would probably get confused myself too.



Probably a mix of plastic and metal: Full metal cards don’t actually support contactless interfaces!

Two common ways of getting around that is to either sandwich a plastic part containing the antenna to a metal one, or to punch out a circular part in the middle of the metal card and put the antenna in there (and close it all up using more plastic).

One card that doesn’t do either is the Apple Card – and as a result, you can’t tap it!



> Probably a mix of plastic and metal: Full metal cards don’t actually support contactless interfaces!

Well it's really annoying: the "metal" card (maybe as you say a mix of metal and plastic) is harder to swipe, so I got use to present it face down instead of face up, for I noticed that that way I get a better percentage of success on the first try.

I don't have the problem with my full plastic credit/debit cards.



Yeah, the sandwich-type cards usually have one preferred side for contactless taps. That's one advantage of the cutout-style cards, I suppose, but I haven't seen many of these lately.



For small cities a bus is better than a subway. There is no traffic so a bus moves fast enough, and roads don't cost that much. You need those roads anyway for trucks, so may as well reuse them. When a city grows close to a million they should start installing metros - but cities have plenty of warning and so should start reserving space for the metro at 500k.



You can use these around the house or car for location-tap automation. Tap on NFC tag and mobile phone can trigger a custom shortcut for local action or SSH script to Linux SBC or micro PC. Response time is about one second. Even the iPhone SE2 has an NFC reader.

For vision-impaired people, NFC tags can be attached to objects and the phone can read an audio description when the object is tapped against phone.



This reminds me a bit of Nabaztags, or maybe the reverse. They would also read something that resembles NFC and could perform an action.



Around that time, I recall there being a lot of hype around RFID tags. E.g. the Touchatag was just a bunch of RFID tags and a USB RFID reader, but marketed as a consumer product. This never really seems to have caught on, though.

Nowadays, I suppose most consumers do have RFID tags (debit cards, transport cards, building keys, e-Passports), they just might not be aware of the underlying technology.



Given that these things are essentially QR codes via another medium, I'm not surprised that it never caught on: QR codes are much cheaper to make (it costs nothing to include them on a leaflet other than some extra ink/toner!) and basically serve the same purpose.

Where they make more sense is when they actually include dynamic information: Some of the newer tags can e.g. include an authentication tag in the URL part, which lets you verify the tag's authenticity (together with a web service that keeps track with the high watermark of opened sequence numbers).

I wouldn't call that "RFID" anymore, though; to me, RFID means transmitting only an identifier, with all the logic happening on the backend, but ISO 14443 tags get most interesting/useful when they go beyond that and do things like authentication or local processing.



All the patents and "sekhurity" isn't helping. A decade ago, I ended up with a bunch of programmable NFC stickers that my Galaxy S7 suddenly wasn't able to read, because some MIFARE intellectual property issue retroactively bricked this class of NFC stickers. Good luck figuring out where on the compatibility matrix the Amazon listing you're looking at is.



MIFARE (classic) tags were never really compliant with any industry standard (whether freely available or patent-encumbered) and are not actually NFC tags, so many systems betting on that but later wanting to e.g. change reader chip vendors ended up with issues such as this. (There's a way of writing NFC/NDEF-formatted data to them, but it's only readable by NXP chips.)

If you buy any standard NFC forum tag, chances are pretty good that it'll work with any Android or iOS device. The Ntag series has worked pretty well for me on both OSes and across various phones; I have one that instantly and cross-platform rickrolls everybody tapping it.



I recently learned that you can just give a printing company a hundred bucks or so and have custom NFC cards printed for you, you don't actually have to be a big transit agency with an ongoing contract for millions of the things and a custom JavaCard NFC application or w/e coded for you.

I used this knowledge to replace the QR code membership card to my friend's bar with an NFC card version, it looks really cool in your wallet compared to all the flimsy paper stamp cards from the other bars.



You can even get blank cards, I have a few from university days. And you can get card printer... Can't find exact price now, but not extremely priced. In theory you could just do whole thing in single location from coding the card to printing it, even with custom information.



I am apalled at the crazy amount of waste this creates. Millions of tickets with chips inside them?

My understanding is that they are one time use?

In New Delhi metro, India, they used to use plastic tokens with these chips, but at the end of the journey, to exit the station you have to give the chip back.

Nowadays, they use a printed QR system, and they have even gone paperless. I can buy the ticket with my mobile app, pay using UPI instant payment, and show the qr code on the phone to the scanner and then travel.

For monthly card holders, rfid chip based cards are issued.



The fact that they cost just a few pennies each is a reflection of how little waste is occurring. If waste bothers you, focus on something worthwhile like canceling just one airline flight.

Lifetime of a plastic opus card may even be more wasteful, by mass of plastic and chip, if not used extensively. For example, one time use is often for tourists, where a full chip opus would be very wasteful indeed.



> If waste bothers you, focus on something worthwhile like canceling just one airline flight.

That's just whataboutism: If there's an alternative way of solving the same problem that generates less waste, why not use it?

I find the contactless coin form factor for single rides quite clever personally, and I don't see any downsides compared to paper single-use tickets (other than that validators and gates need some storage container to collect them, which could be tricky in buses).



Just because you don't see downsides doesn't mean there aren't any. Coins are lost or broken or intentionally damaged, and may need cleaning and staff to handle and transport them. It's not zero waste. In fact I suspect the STM solution may overall have less waste. If you read the article, the chip is the size of a grain of salt.

Airline is not just whataboutism. It illustrates the absurdity of scale in your point. Imagine someone who is spending 20 minutes to save themselves 4 pennies on their electrical bill, but they are running 8 air conditioners with their windows open during a heatwave. Yes, that's whataboutism, but it's an informal fallacy, meaning I may still have a good point.



> I suspect the STM solution may overall have less waste. If you read the article, the chip is the size of a grain of salt.

The antenna isn't, however. In any case, I think there's a pretty high chance these tickets will not end up in a dedicated recycling facility that can properly separate antenna from paper and recycle both, disregarding the chip.

For similar reasons, Japan is phasing out even magnetic stripe single-ride tickets out of recycling concerns (in favor of QR code based ones).

> Imagine someone who is spending 20 minutes to save themselves 4 pennies on their electrical bill

That's not an appropriate comparison, though. Buying a reusable token doesn't take 20 minutes more than buying a paper ticket.

Imagine instead a device manufacturer spending some months of R&D to help every single household in a large country save 4 pennies on their electrical bills, and it doesn't seem so absurd anymore.



I find the plastic tokens quite clever, but QR codes are not a great option for mobile ticketing at transit gates: Often it takes people forever to pull up the code in the right orientation and dial up the brightness enough for the scan to work. Not something I love to deal with when I want to catch a train.



QR code reading does not depend on the orientation, at-least as per its spec. there are many apps and devices out there that can read a QR code in any orientation.

In the app that is used by me, the brightness of the screen is automatically increased by the app as soon as I open the ticket QR, and then reduces to its previous state, once the QR code display is removed.



Not any orientation – if you present a QR code ticket the wrong way around, or even just angled away from the plane the reader focuses on too much, it doesn't work.

Contactless tickets work both ways, and in addition to that usually have a larger, more forgiving "landing area". On top of that, they can usually read through a wallet (but that's more relevant to regular commuters, arguably; tourists and infrequent riders will likely have purchased the ticket just moments before using it).



That was a god read, thank you.

Do you have any insight into the economics of this in general compared to other disposable solutions. Are manufacturing old school magnetic stripe tickets, or just optical scanning/barcodes a lot cheaper?

I imagine magnetic stripes have a higher failure to read rate at the turnstile causing issues, while both them and optical scanning requires the ticket to be inserted into the machine, adding complexity and moving parts.



I couldn't find a nice price breakdown. I'd expect the magnetic stripe tickets to be cheaper to manufacture, but since the NFC tickets cost pennies, there isn't a lot of money to save. I agree with you that magnetic stripes would have a much higher maintenance cost due to the mechanical aspect and the read/write head. Optical scanning seems less likely to work the first time, based on my experience with airplane checkins. NFC is probably the best from an ecosystem perspective since it can work with credit cards and phones as well. NFC readers are probably the cheapest since they are produced in large volumes for credit card point of sale.



I’ve occasionally gotten to watch transit workers open up and service the magnetic stripe card readers in the BART. Those things are complicated. It may well cost less to outright replace a contactless reader module on a fare gate than to service a magnetic stripe ticket machine once. Even an Adafruit PN532 board is only $40.



I've not worked with the Adafruit PN532, but for an extra $10 you can get a Pepper C1 USB from Eccel which is very easy to work with. It is a stand-alone device, so you don't have to connect it to anything but power. Has WiFi & BT built in and has a built-in web server to configure it with, you can have it make calls via REST, MQTT, WebSocket.



Interestingly, the Pepper C1 is essentially a PN518 (presumably a sibling of the PN532 on Adafruit's board) hooked up to an ESP32. So a very simple device - and I've had a project on the backburner which is pretty much a DIY clone of it. If they made a USB-C version I'd ditch mine and buy it in a heartbeat.



Yeah, they moved to a native integration with Apple/Google/Samsung Wallets, and Clipper cards as a backup (but they really try to discourage them, at least for tourists).

The cool thing is that their thing doesn't work with all Android phones for an unknown reason (various people from the transit agency said "oh Android? Yeah it doesn't always work with Android"), which you have no way of knowing before topping up money and trying to use your phone.

If anyone is curious, it was a Xiaomi Redmi phone, a midrange one that has no issues paying over NFC. A OnePlus next to it with the same Android version worked just fine.



FWIW, Montreal used to have mag strip paper tickets and turnstiles to match, but ever since the new paper tickets rolled out we have new svelte turnstiles with an NFC reader exclusively.

They've been trying to get contactless bank card payments going on the same turnstiles but roll-out has been bogged down by other transit agencies apparently.



I'm curious about how the unique ID is programmed into each chip. Presumably all the chips on the wafer come out identical - at which point in the process are they individually selected and given a unique personality? Is it done with direct electrical contact that is then fused off, or using the near field link?



Since they need to probe each die to test it on the wafer, they set the UID at the same time. According to the datasheet, "These bytes are programmed and write protected in the production test."



How do they make the chips so incredibly thin?

Surely they're not using 75µm/120µm wafers throughout the entire production process - that's literally the thickness of a human hair! Can a 200/300mm wafer of that thickness even support itself, let alone all the stresses in the production process?



How difficult is it to clone MIFARE Ultralight EV1 chips? You mention the UID is signed, can you simply copy this signature? Do you just need to buy one of the magical chips of the same design, that allow uid/serials to be written?

What is the actual mechanism behind the DESFire and other secure NFC chips that prevents cloning?



I haven't really looked into the security aspects. I think that you could clone one of the Ultralight chips, but it wouldn't gain you anything because the security is in the backend. It's a lot like a printed concert ticket or boarding pass. You could print as many as you want, but the ticket is still good for just one admission.

The DESFire and other secure chips contain a cryptographic key that you can't access. Without the key, you can't make a clone of the chip. The cryptography provides authentication and encryption that you don't get with the cheap Ultralight chip.

I think this is all market segmentation; they don't put more security into the Ultralight chip because they don't want to cannibalize their higher-end sales.



In general, the card emulation devices (e.g. the chips in phones) try to avoid letting any arbitrary UID be set. This makes cloning these cards more difficult than it would otherwise be. It’s not terribly difficult to find devices (USB-connected things and battery-less cards) that do allow arbitrary UIDs to be set, though.



> the card emulation devices (e.g. the chips in phones) try to avoid letting any arbitrary UID be set.

I can't think of a much worse way to do security. That feels like trying to flood the market with lockpicks that don't work instead of making a more pick-resistant lock.



I imagine this is because the locks contain chips from NXP (PN532 chips), the name-brand MIFARE chips are made by NXP, and the lock picks (also PN532 chips!) are made by NXP.



Ultralight supports password authentication, and you can diversify the password from the serial number, meaning that until that password is revealed by a legitimate reader as part of a validation transaction (at which time the ticket is invalidated anyway), you can't clone it.

Ultralight C does support actual cryptographic authentication.



I don't think the password authentication helps against cloning. You could start a transaction and stop after you get the password. Then you could clone the card. (The system could invalidate the ticket as soon as they get the UID, but that would be a reliability nightmare since a failure during the read would invalidate someone's ticket.)



You could do that, but it still greatly raises the cost for an attacker, since they need to hang around a ticket validator for every ticket they want to clone, as opposed to e.g. a QR code ticket, which can be trivially copied by a simple screenshot.

Also, many of these transit systems are eventually consistent (they're usually offline-capable for resilience, but usually manage to send all validation transactions to a backoffice system within at most a day, and often minutes).

This allows detecting duplicate usage fairly quickly. In systems where you need to tap out as well as tap in to leave the turnstile, that's where ticket inspectors might take a sudden interest in you if you tap out with a cloned ticket.

In the end, as with most security systems, the goal is not to make fraud absolutely impossible, but to make it economically non-viable.



Kind of a software question, but why isn't nfc with asymmetric keys a thing? It seems like at best this is a custom javacard app on select expensive cards ($4 per card if you buy 1000 on aliexpress) or $70 for a yubikey otherwise. Is getting the signature time fast enough just impossible with current hardware/tramission power restrictions?



Thanks for the write-up.

How does this fit into the broader NFC ecosystem? What do other big metro systems like Omny, Clipper, Smartrip etc use? Apple and Google seem to implement some NFC protocols in their devices but in a much more programmable way, how does that work? Is the protocol used in credit cards related at all? And how do these relate to Felica, the system used everywhere in Japan (which was in the news for a while because the factory where they made the chips burned down and they had a chip shortage - giving Apple an opening to move into the market with iPhone NFC)?



That seems like a question for @lxgr :-)

As far as I can tell, the NFC ecosystem is a mess of competing, incompatible protocols from different companies, as well as incompatibilities for historical reasons. For example, Clipper uses MIFARE DESFire, which is the more secure sibling of the Ultralight chip that I examined. Washington's SmarTrip cards use MIFARE Plux X. New York City's OMNY, on the other hand, is apparently built on top of the Mastercard payment network using EMV. Montreal's rechargeable OPUS card (not the disposable one I examined) uses the completely different Calypso standard. FeliCa was developed in Japan along a different path and has a different standard (NFC-F vs NFC-A) with different modulation, protocol, and data rates. The NFC chips used in phones try to be compatible with as much as possible. These NFC systems all use the same 13.56 MHz frequency, so the radio hardware is compatible across them.



On it, but I couldn't have said it better :) To expand on Felica vs. ISO a bit:

Theoretically Felica is a different stack from ISO 14443, but it's close enough that it almost got specified as a variant of ISO 14443 as well (C; MIFARE and most other systems use A). NFC does specify Felica as one possible official tag type (then called NFC-F, as opposed to NFC-A and NFC-B), so practically, most mobile devices can just also read it.

For anybody wanting to experiment a bit, I can highly recommend getting any Android device and installing NFC tag reader by NXP; it'll show you what technology exactly a given card uses, and in some cases can show you other interesting information as well. There's also an app that lets you read the current balance of various transit cards.



Apple and Google achieve the same outcome (i.e. something called "card emulation", where an NFC chip can act as an emulated ISO 14443-4 smartcard), but they achieve it through very different ways:

Google just has an Android API for it called HCE (Host Card Emulation), and anybody can write an app that implements it (i.e. Google Pay has no special position compared to competitors). In a nutshell, you just get a callback for every APDU (protocol message) the phone receives from the reader and get to respond as you wish.

Apple embeds a secure element in their devices, which is a chip almost identical to that you'll find in actual physical cards, but with an additional interface that connects it to the application processor, so that the OS and (privileged, i.e. Apple Wallet only) apps can interface with it and load new card applications. That's why the storage in Apple Wallet is limited to 50-ish cards, but Google Pay allows many more :)

Felica is not part of the ISO 14443 family, but closely related and also an official physical layer of NFC (NFC-F), so many devices practically support it as well. To my knowledge, there is no software-based emulation for it though (that's always a bit risky for stored-value cards), so Suica etc. only work on Japanese phone models that have the necessary secure element, as well as on all iPhones (Apple installs a Felica applet into their secure element on demand).



> Is the protocol used in credit cards related at all?

In e.g. London and the Netherlands, the readers were upgraded to support tapping in and out with a debit/credit card or Apple/Google Pay.

However, Apple also seems to have an ‘Express’ mode, which even works when the battery is empty (‘Power Reserve’).

It seems to me that there must be three protocols: the one for the disposable and stored-value tickets (ISO 14443?), EMV for debit/credit/Apple Pay/Google Pay, and Apple Pay Express.



EMV (specifically EMV contactless) is also based on ISO 14443, it's more like an application layer protocol on top of it.

Apple Pay Express is just Apple Pay without the need for the full system UI: "If iOS isn’t in use because iPhone needs to be charged, there may still be enough power in the battery to support Express Card transactions." it interacts the same way as the physical card equivalent (otherwise they would need a reader upgrade).



Right. Much like the fact Find My functionality can still let you track your phone when it’s “dead”, the power requirements are just so low that when the phone can’t get going due to the requirements of the CPU + RAM + display there’s plenty to power NFC/BT beacon stuff for a while.

An AirTag can operate on a CR2032 for two years. An Energizer datasheet says that’s 235 mAh. An iPhone 13 Mini has a 2438 mAh battery (~10x). It makes sense the phone could do it for at least a day or two with the left over charge.

(I don’t know how long it would actually keep working)



Both EMV and MIFARE (and similar solutions) indeed sit on top of ISO 14443-4 (or -3 for the older/lighter MIFARE versions), but they're conceptually very different:

EMV is an account-based payments protocol, and the card only confirms its presence in a transaction; balances are managed on the backend. The reader does not authenticate itself to the card at all.

MIFARE is a stored-value service and as such keeps track of the card's balance on-chip. This requires another smartcard on the reader side, holding the necessary keys for mutual authentication, but allows two-sided offline transactions, which is quite useful for transit applications (e.g. buses dropping out of network coverage, allowing higher volumes even during short server outages etc.)



> MIFARE is a stored-value service and as such keeps track of the card's balance on-chip. This requires another smartcard on the reader side, holding the necessary keys for mutual authentication, but allows two-sided offline transactions, which is quite useful for transit applications (e.g. buses dropping out of network coverage, allowing higher volumes even during short server outages etc.)

MIFARE cards are used in all kinds of applications and not all of them require the reader to authenticate itself. And even in authenticated uses the keys don't neccessarily need to be stored in a smartcard (SAM) depending on the security requirements. For the simpler MIFARE cards a secure enclave for the keys doesn't even provide any additional security since they key is transmitted to the card anyway - and the simplest ones don't have any authentication at all.



> a secure enclave for the keys doesn't even provide any additional security since they key is transmitted to the card anyway

I'd assume that the keys (more accurately passwords, since a key would never be transmitted to the card over an unencrypted interface) are diversified by card serial number though? In that case, it would still be useful to have an SAM to hold that diversification key. You could further store some MAC authentication tag on the password-protected tag that the SAM needs to see before revealing the password over the radio.

I'm not saying that this is how every transit system practically does use MIFARE Ultralight, but based on the design, it's definitely possible.



I really enjoyed this read, thanks.

In the footnotes you said:

> One complication is that the counters have an "anti-tearing" feature for additional security

Two questions:

1. Why is it a "complication"? Is it just that it makes the counters more complicated, or is there something frustrating about the counters? 2. I would love to learn more about how the anti-tearing feature works!



The trick is to use a metallurgical microscope, which shines the light down through the lens. A regular microscope illuminates from below, which works fine for cells, but not for opaque chips.

Specifically, I use an AmScope ME300TZB-2L-10M microscope, which my friends consider an entry-level microscope, but it works for my needs.



I’ve been curious about the orientation of these devices. For examples, if I want to track an item’s presence in a box, would I have to coat the entire item in these chips to get one to be in the right orientation?



I think it depends on the type of antenna. A linearly polarized RFID antenna is sensitive to the tag's orientation, but a circularly polarized antenna is less sensitive to orientation. Systems can also use more than one RFID antenna to get better coverage.



I am interested in the plastic layer with conductive traces for the antenna. How are these made? Do you know of a source that talks about the production process for them?



as always a delight to read ken! im curious about speculation how to do the bonding and mounting of these chips at scale. at this size even the general handling and cutting of wafers are hard to imagine for me. how did the connections to the antenna look like and was there an indication of different glue / adhesive layers apart from the coatings you described?



For MIFARE Ultralight, yes – it's essentially just a bearer token with no encryption/authentication. I believe there's a password mechanism, though, which might just be good enough for single-use tickets. That password can be derived/diversified from the card's serial number, making such a scheme still significantly better than e.g. simple QR codes.

MIFARE Ultralight C and larger/more expensive chips allow challenge-response authentication, making them pratically uncloneable. These are usually used for reloadable and monthly passes.



You already see RFID tags used in retail so I would not be surprised if that isn't already the case somewhere in the shipping industry as well.

I imagine those can use even simpler chips that are completely read-only over the air and only have a UID programmed.



Is this the same system used by Boston MBTA? I was surprised to see single-use tap cards when I visited there for the first time yesterday. I wondered why the ticket isn't reloadable.



Yeah I figured but you can't buy a charliecard online to load into your smartphone wallet, and I only needed it the once, and since it took more than an hour to get to Cambridge due to some combination of circus acts I used Blue bikes for the remainder of the day.



Ah yes, it's not quite there, but almost. Contactless payment directly at the turnstile is coming to Boston MBTA this year, I believe. Like how NYC works now, where you can just use your credit card for entry.



This is the London system we’ve had for a decade, it was licensed to other areas a few years ago.

I found myself in Paris having to cross the other day and forgot how terrible the old way of buying tickets was, amazed that it’s still the norm in so many cities



Single tap cards are usually just used with their "hardwired" chip serial number. That is stored in a central system which invalidates the number once you used it. This makes it rather easy (even if its environmentally unfriendly) to issue these cards: load a number of cards into your machine, register the serial number and invalidate it when used.



That's no longer the case: Many of the newer single-use ticket ICs (including the MIFARE Ultralight one mentioned in the article) actually support data storage and (very) basic cloning protection.



That the chips support data storage doesn't mean that that feature is used. There are systems that use MIFARE Ultralight cards for the UID alone just because they are cheap and easily sourced.



Definitely, but my point is that that’s not the only way to do it.

You can also store only an ID in a QR code, but you could also fit more information and a digital signature of it in there.



Mifare is what’s been used in London’s Oyster cards for 20 years (not the ultralight ones mind), and Hong Kong for even longer.

However oyster really is in its way out for most uses. contactless and especially a phone is far more convenient for non season use, and far less wasteful.



Isn't Mifare in different forms a de-facto standard for NFC subway tickets around the world? St Petersburg uses Mifare Classic (and tokens), Moscow also uses Mifare Classic for the refillable Troika card and Mifare Ultralight for disposable ones, Dubai "nol" card is a Mifare Desfire, Los Angeles "tap" card is a Mifare Classic, and, yes, the London Oyster is a Mifare Desfire EV1. Yes I actually went through my stack of transit cards and scanned those of them that I wasn't sure about.

The only ones that I came across that are not Mifare, and not even readable by Android (but readable by the Flipper Zero), are the paper tickets used in Brussels. Then, of course, there are non-NFC tickets. For example those that use magnetic stripes, like the cute tiny ones in Paris or NYC's MetroCard.



That's a lot more MIFARE Classic than I would have expected considering that reader support for those is a lot less guaranteed these days. I guess a lot of them might be legacy systems.



Japan uses FeliCa for its integrated transport cards (I just read an Osaka Metro ICOCA card with NFC Tools to check). This is used by quite a few systems around the world, including Hong Kong's Octopus.



Hong Kong's Octopus card uses Felica, as far as I know.

It's conceptually very similar to MIFARE – a fixed function IC implementing a fully offline stored value purse – but uses a stack that differs from ISO 14443 A on pretty much all layers. (It was planned to possibly become ISO 14443 C, but that never happened.)



>Hong Kong's Octopus card uses Felica, as far as I know.

Yes: Felica was developed by Sony in Japan, but was actually first adopted in Hong Kong, then later in Japan. It's far better than other standards, because it's so fast.



There's a noticeable delay between contactless cards and oysters. Some people I know prefer oyster cards simply because they open the gates faster, in spite of having to top them off all the time.

I'm looking forward to not having to choose one trade-off over the other.



It’s noticeable if you’re used to the instant response of Oyster, but we’re talking about a few hundred extra milliseconds. Not something that bothers you once you’re accustomed to it.

It’s still fast enough that it will read my Apple Watch before the gate starts to close from the passenger in front of me.

One saved trip to an Oyster top-up machine will make up for a lifetime of contactless NFC latency!



>but we’re talking about a few hundred extra milliseconds. Not something that bothers you once you’re accustomed to it.

Wrong. With the traffic volumes normally seen in Tokyo, those few hundred extra milliseconds will cause huge delays at the fare gates. There's a reason the systems here use the Felica card which processes in 100ms: it's really needed for this kind of pedestrian volume.



At peak hours it can definitely be a problem, you really need the entire pipeline to work well. There's going to be somebody behind you most of the time, and you really don't want people stuck at the gates.

In Japan credit card transactions routinely take a couple seconds. Imagine each person taking 5 seconds to go through the gate! I think what trials for credit card payments in transportation services there are doing is simply not processing the transaction inline, and just doing it after the fact (assuming it will go through).



Yes, the TfL system does a partial authorisation. It checks the card is valid and not blocked etc but doesn’t necessarily do a real-time authorisation all the way to the issuing bank.

If you try to use a card that is valid but has no available balance/credit, it might work for the first ride but then be blocked when you try to use it for the return trip.

Fares are batched throughout the day and you are charged once, overnight, for all rides that day (after applying any multi-ride discounts, etc).

This is different from some other cities where I’ve used contactless payments and they’d charge you immediately for each ride, giving you lots of annoying little charges on your bank statement!



Wonder how they block the card, my impression was that tokenization was meant to make it harder for card chargers to be able to track a card through multiple taps like that.



They must have the card identity because you have to explicitly 'tap out' at the other end, if you don't want to be billed with a maximum fare.

Don't ask me how though



Is it not possible to top up a digital Oyster card on an iPhone or Apple Watch via an app or Apple Wallet?

The Japanese transit cards that are supported by Apple Pay have that option, and it's arguably the best of both worlds.



> ”Is it not possible to top up a digital Oyster card on an iPhone or Apple Watch via an app or Apple Wallet?”

It is, there’s even an auto top-up option that adds credit automatically if your balance drops below a certain level.

But there’s no “digital” Oyster card, only physical ones. If you want to use a device to pay you have to use contactless.

And either way, it’s still kind of a pain to have to maintain a balance - especially if you’re a tourist or visitor and don’t know exactly how much credit you’re going to need.

I agree that being able to load a transit card into Apple Pay etc is also a good solution. The convenience of not having a physical card that can be easily lost or forgotten is probably the biggest benefit for me.



Sorry, I always get Oyster and Octopus mixed up, and it happened again here :)

Octopus (used in Hong Kong) is the one that supports virtual cards in Apple Wallet.



costco already has this for ID cards in the states (and I've also seen it for account ID for home depot and some other places where it's tied to discounts). the app will pull up an ID card with a QR code that changes every 60 seconds or so to prevent screenshotting and trivial reuse, which is analogous to the function the chip performs in terms of challenge-authentication.



I think there are plans for contactless smartphone tickets in Montreal too. I wonder why they haven't done that yet, it's been years since they've started talking about it.

联系我们 contact @ memedata.com