Open Kelbie opened 1 month ago
Decoding the token I get
{
"token": [
{
"proofs": [
{
"amount": 2,
"secret": "ea1c6d39764def5a1776d2f78ba339445645aad8db93fb1daed58d6b95e1f4dd",
"C": "0207b8ee3fcf9a72f64a68193a5045c42ddd7c4db0b912b12b58fe6d4432aed58c",
"id": "9mlfd5vCzgGl"
}
],
"mint": "https://mint.minibits.cash/Bitcoin"
}
],
"unit": "sat"
}
9m
is not a valid hex char and id
should be a hex string: https://github.com/cashubtc/nuts/blob/main/00.md#proof
It worked for the v3 token because a v3 cashu token was just converted to base64, while a v4 token needs their data encoded to binary: https://github.com/cashubtc/nuts/blob/main/00.md#token-format-1
So the error lies in the token, not the library IMHO.
It is true that there are still keysets out there that are not in hex format.
Yes, this is a expected. V4 token are incompatible with old keyset IDs. https://github.com/cashubtc/cashu-ts/pull/193 will change much of the token logic. I will make sure to include a proper error message for this case in there as well.
hex string expected, got non-hex character "9m" at index 0
This seems to fail because the id's aren't valid hex strings.