Oddbean new post about | logout
 well the cards i am using here are 1Kb.  It works if the number of coins is small. So if you flash, for example, 128 sats (1 coin) works fine. But if you flash 127 sats (7 coins) it will fail. 
 Very interesting. 

I'm assuming the issue is that if you have a single larger coin that surpasses the total for the transaction, your card is basically just empty as you'd have to flash the new "change" coin to the card separately?

Otherwise it would just make sense to keep fewer, larger coins on the card, but I think I see how you might want more coins due to how ecash and mints work. 
 If you know, what is the average size in bytes for a single coin? And does this vary by sat-value or by mint, or is it more or less static in cashu? 
 as of now 1 coin should be 120 bytes. But not all wallets do optimal splits. In any case, 8Kb should be enough I believe. 
 So I have also written a tool specifically for merchants that need to request a payment of a certain amount of sats. Basically what it does is:
* Read the card
* Receive the token -> generates fresh coins
* Split the fresh coins in amount to keep and change
* Try and flash the change to the card
  - if that fails, print a qr code with the change to the screen instead.