Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wallet/Mint] Implement update to NUT-08: Dynamic amount of tokens for change #183

Closed
3 tasks done
callebtc opened this issue Apr 28, 2023 · 7 comments · Fixed by #223
Closed
3 tasks done

[Wallet/Mint] Implement update to NUT-08: Dynamic amount of tokens for change #183

callebtc opened this issue Apr 28, 2023 · 7 comments · Fixed by #223
Labels
mint About the Nutshell mint nuts NUT specs related wallet About the Nutshell wallet

Comments

@callebtc
Copy link
Collaborator

callebtc commented Apr 28, 2023

Instead of using 4 blank outputs, we should use the new dynamic amount. Relates to following NUT update: cashubtc/nuts@1676fe8 which uses ceil(log2(fee_reserve)).

Todo:

  • Mint
  • Wallet
  • Write test for wallet that checks expected returned fees?
@callebtc callebtc added enhancement New feature or request nuts NUT specs related mint About the Nutshell mint wallet About the Nutshell wallet and removed enhancement New feature or request labels Apr 28, 2023
@xphade
Copy link
Collaborator

xphade commented May 14, 2023

I'd take this task in case no one else started yet.

@BilligsterUser
Copy link

BilligsterUser commented May 14, 2023

I think i should be

ceil(log2(fee_reserve))||1

@xphade
Copy link
Collaborator

xphade commented May 15, 2023

I think i should be

ceil(log2(fee_reserve))||1

@BilligsterUser You mean like "the minimum number of blank outputs should be 1"? Yeah, that probably makes sense.

@BilligsterUser
Copy link

Yes

@xphade
Copy link
Collaborator

xphade commented May 15, 2023

@callebtc Can you weigh in on this as well? Should we add the minimum to NUT-08? If yes, I could make it part of my PR cashubtc/nuts#17.

@callebtc
Copy link
Collaborator Author

Correct, thank you for noticing this @BilligsterUser! If fee reserve is set to 1 sat minimum, this would fail.

I would write this as max(ceil(log2(fee_reserve)), 1) to be a bit more explicit maybe.

@xphade please feel free and go ahead with the fix of NUT-08 and also if you'd like to make appropriate changes to Nutshell!

@BilligsterUser
Copy link

cashubtc/nuts#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mint About the Nutshell mint nuts NUT specs related wallet About the Nutshell wallet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants