Mint time outside of tolerance - some mints about 15 minutes behind #1194

Open
opened 2025-10-17 09:39:47 +00:00 by SatsAndSports · 5 comments
SatsAndSports commented 2025-10-17 09:39:47 +00:00 (Migrated from github.com)

I sometimes get these errors about timestamps, in my chat+cashu app, where CDK generates this error: Mint time outside of tolerance. This was with coinos.io, but I think I've seen it with others too. With coinos, sometimes it works and sometimes it doesn't.

Update: Here's a straightforward example. I put in some logs. I'll try to find a way to contact the mint, and close this

Image

The mint is sometimes about 20 minutes behind. I verified my wallet's time with https://time.is/Unix_time

Mint time does match wallet time. Mint: 1760686887, Wallet: 1760687877
TRACE /home/satsandsports/MyCode/Cashu/mdk_ecash/cdk/crates/cashu/src/nuts/nut01/secret_key.rs:165 Secret Key dropped.
Error: Failed to receive token: Failed to receive token: Mint time outside of tolerance
AbortError: The user aborted a request.

I removed the timecheck from the cdk and am continuing to test, so far this seems to be working:

Image

Although, of course we do need the correct time for various spending conditions, so I'm not proposing to remove this check

I sometimes get these errors about timestamps, in my chat+cashu [app](https://chat.satsandsports.cash/), where CDK generates this error: `Mint time outside of tolerance`. This was with coinos.io, but I think I've seen it with others too. With coinos, sometimes it works and sometimes it doesn't. *__Update:__ Here's a straightforward example. I put in some logs. I'll try to find a way to contact the mint, and close this* <img width="547" height="56" alt="Image" src="https://github.com/user-attachments/assets/3edfb915-7aa9-496b-8117-5801b122fab7" /> The mint is sometimes about 20 minutes behind. I verified my wallet's time with https://time.is/Unix_time ``` Mint time does match wallet time. Mint: 1760686887, Wallet: 1760687877 TRACE /home/satsandsports/MyCode/Cashu/mdk_ecash/cdk/crates/cashu/src/nuts/nut01/secret_key.rs:165 Secret Key dropped. Error: Failed to receive token: Failed to receive token: Mint time outside of tolerance AbortError: The user aborted a request. ``` I removed the timecheck from the cdk and am continuing to test, so far this seems to be working: <img width="1090" height="402" alt="Image" src="https://github.com/user-attachments/assets/978f292c-be0a-47e3-a0dc-318af0bd90dc" /> Although, of course we do need the correct time for various spending conditions, so I'm not proposing to remove this check
thesimplekid commented 2025-10-17 12:45:49 +00:00 (Migrated from github.com)

Interesting thanks for finding this. I've asked the nutshell devs if nutshell somehow caches the time or if the mints system clock is just off.

Either way the tolerance is not actually something in spec and something I just put in cdk, so I think we should maybe make this a softer error as it blocking a simple receive is not a good experience. However, as you point out is an import check for spending conditions, so it should probably be in the spec more specifically as if someone is doing conditions with short term timeouts even 20 min could make a difference.

Interesting thanks for finding this. I've asked the nutshell devs if nutshell somehow caches the time or if the mints system clock is just off. Either way the tolerance is not actually something in spec and something I just put in cdk, so I think we should maybe make this a softer error as it blocking a simple receive is not a good experience. However, as you point out is an import check for spending conditions, so it should probably be in the spec more specifically as if someone is doing conditions with short term timeouts even 20 min could make a difference.
SatsAndSports commented 2025-10-17 13:45:35 +00:00 (Migrated from github.com)

I deleted my comment from 20 minutes ago, because I discovered my clock was a bit off! Sorry about this

Now I'm not sure if I trust any of the data I've presented here :-)

I deleted my comment from 20 minutes ago, because I discovered my clock was a bit off! Sorry about this Now I'm not sure if I trust any of the data I've presented here :-)
thesimplekid commented 2025-10-17 13:56:27 +00:00 (Migrated from github.com)

I deleted my comment from 20 minutes ago, because I discovered my clock was a bit off! Sorry about this

Now I'm not sure if I trust any of the data I've presented here :-)

No worries brings up a good point even if the data is a little off.

> I deleted my comment from 20 minutes ago, because I discovered my clock was a bit off! Sorry about this > > Now I'm not sure if I trust any of the data I've presented here :-) No worries brings up a good point even if the data is a little off.
thesimplekid commented 2025-10-17 15:58:59 +00:00 (Migrated from github.com)

https://github.com/cashubtc/nuts/issues/297#issuecomment-3415983919

Cdk does store it but it only check the the time when it fetches it from the mint.

> https://github.com/cashubtc/nuts/issues/297#issuecomment-3415983919 Cdk does store it but it only check the the time when it fetches it from the mint.
github-actions[bot] commented 2025-12-17 02:58:57 +00:00 (Migrated from github.com)

This issue is stale because it has been open for 60 days with no activity.

This issue is stale because it has been open for 60 days with no activity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk#1194
No description provided.