Oddbean new post about | logout
 I'm not at all an expert in this area, I have never coded a Java card, but I looked into this a bit; javacard.framework.Applet defines a method called process(javacard.framework.APDU) which gets called whenever there is an incoming packet of information, and allows it to receive any kind of arbitrary data. This means that it's absolutely possible to code any instruction you would want, in fact from what I'm reading from the documentation, the byte at position ISO7816.OFFSET_INS, is designed specifically for that. So you'd check if it's whatever constant you set to getting sats and then read the following n bytes as the amount, the card can then respond with an ecash token of that amount without any issue.