Danny on Nostr: I'm not at all an expert in this area, I have never coded a Java card, but I looked ...
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.
Published at
2024-10-22 10:01:44Event JSON
{
"id": "ff8c675919d42caa6cfceabe48be8df8a03d277b6c71f91575752d21a5330e5d",
"pubkey": "66675158e6338fe89fda418e42a0bf2a7a2b132504dd347f015a18971b644430",
"created_at": 1729591304,
"kind": 1,
"tags": [
[
"e",
"786471c81e1bed1a5282872f436386b9e54e3d9a04637eccec576d5cb5546cd5",
"",
"root"
],
[
"e",
"786471c81e1bed1a5282872f436386b9e54e3d9a04637eccec576d5cb5546cd5",
"",
"reply"
],
[
"p",
"50d94fc2d8580c682b071a542f8b1e31a200b0508bab95a33bef0855df281d63",
"",
"mention"
]
],
"content": "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.",
"sig": "1e93b95eed341335dddf32a548b63d52924747d25143691e29b5a2730a20d1179b5cdf7e1f46ced7a4d4fc13597fee91741b9e80d1b75b79282d46f832f4bac8"
}