-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add "In reserve" Rune Field #4265
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
base: master
Are you sure you want to change the base?
Conversation
|
This is really interesting. I'm going to withhold comments on the precise implementation, but I have three questions regarding the design in general:
Not saying any of these questions should hold up this PR. I just need help thinking them through. Follow up |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
On cursory glance this PR looks good (except for the log statements and comments), there's good test coverage as well. I know you went off of @casey's original idea in #3895 but I'm warming up to the idea of @joshdoman, where you have multiple "admin" tokens. A specific use case I can think of is: Let's say we want to issue runes according to release schedule such that only a portion of them unlocks at specific heights (similar to normal Bitcoin). With multiple admin runes you could lock them up in differently timelocked UTXOs and prove that they cannot be spent until a future date. With only one parent/admin rune you couldn't split these up into different outputs with different timelocks (the address would be different). This is probably a bit more complex to implement and I'm not saying we should do it but it has a bit more potential and alleviates some of @joshdoman's concerns. @VanjaRo you probably have some things you want to do with this |
|
Hey @raphjaph In Midl - we are pathing the way for Stablecoins & Protocols tokens to step in and have an opportunity to mint and burn assets, with the specific use-cases of their's. The idea with Reserves is, at least, allows to mint/burn assets on demand. However, we still would be in favor of introducing admin-authorized mint/burn system here as described in #4255 Please let me know of your thoughts! Whatever is the decision here - we'd love to contribute to Runes here at least in that direction & also in others as well. |
This PR implements a new "in reserve" field, referenced in this issue #3895. This field represents the amount of runes held at the same address as the parent inscription. This feature helps users distinguish between the total supply and the portion that's still controlled by the original creator/issuer.
Key Changes:
reservedfield to the Rune structs in API responsescalculate_rune_reservedhelper function to determine the reserved amountreservedsupply separately from circulatingsupplyImplementation Details
The "in reserve" calculation works by:
No changes to the index structure were made. Currently, scans all address outpoints rather than using a direct lookup mechanism.
Test Coverage
Implemented several server tests:
rune_without_parent_shows_no_reserved_supply–– runes without parent inscriptionsrune_shows_reserved_supply–– runes with parent inscriptionsrune_reserved_supply_changes_when_transferred–– the reserved calculations logic is correctOpen to comments and suggestions :)