NUT-08: n_blank_outputs can be zero #20

Closed
opened 2023-05-15 22:14:59 +00:00 by callebtc · 3 comments
callebtc commented 2023-05-15 22:14:59 +00:00 (Migrated from github.com)

Formula for determining number of blank outputs necessary to imprint fee reserves.

Problem: n_blank_outputs = ceil(log2(fee_reserve)) can be 0 if fee_reserve==1 sat.

Solution: Should be max(ceil(log2(fee_reserve)), 1) or ceil(log2(fee_reserve)) || 1.

Formula for determining number of blank outputs necessary to imprint fee reserves. **Problem:** `n_blank_outputs = ceil(log2(fee_reserve))` can be `0` if `fee_reserve==1 sat`. **Solution:** Should be `max(ceil(log2(fee_reserve)), 1)` or `ceil(log2(fee_reserve)) || 1`.
BilligsterUser commented 2023-05-16 04:31:28 +00:00 (Migrated from github.com)
[cashu-ts](https://github.com/cashubtc/cashu-ts/blob/7980b80fdc3e12e36e19970ba1fe43a4c65fe339/src/CashuWallet.ts#L344)
callebtc commented 2023-05-23 11:35:21 +00:00 (Migrated from github.com)
https://github.com/cashubtc/cashu/pull/223
thesimplekid commented 2025-05-20 10:03:33 +00:00 (Migrated from github.com)

looks like this is fixed in nut and implementations. Closing

looks like this is fixed in nut and implementations. Closing
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
forgejo-admin/nuts#20
No description provided.