-
Notifications
You must be signed in to change notification settings - Fork 138
docs: add docs for how burns work within the protocol and codebase #1786
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: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 17600559753Details
💛 - Coveralls |
@ffranr: review reminder |
``` | ||
|
||
When a burn request arrives, the system first performs comprehensive input | ||
validation. The implementation supports both binary and hex string asset IDs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding a note that if this gets merged after #1812, then we should change asset IDs
by asset IDs or group keys
or similar.
Following initial validation, the system attempts to resolve the asset's group | ||
membership. This resolution step, while currently limited in its application due | ||
to the single-asset restriction, lays the groundwork for future group-based burn | ||
operations. The system queries the asset store to identify whether the target | ||
asset belongs to a group, information that becomes crucial for proper burn key | ||
derivation and commitment management. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whole paragraph becomes unnecessary if the PR goes after #1812
preventing scenarios where insufficient funds or incorrect asset types might | ||
lead to failed transactions. | ||
|
||
Coin selection follows, utilizing the PreferMaxAmount strategy to minimize the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coin selection follows, utilizing the PreferMaxAmount strategy to minimize the | |
Coin selection follows, utilizing the `PreferMaxAmount` strategy to minimize the |
Verbatim
firstPrevID := asset.PrevID{ | ||
OutPoint: firstInput.AnchorPoint, | ||
ID: firstInput.Asset.ID(), | ||
ScriptKey: asset.ToSerialized(firstInput.Asset.ScriptKey.PubKey), | ||
} | ||
burnKey := asset.NewScriptKey(asset.DeriveBurnKey(firstPrevID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
firstPrevID := asset.PrevID{ | |
OutPoint: firstInput.AnchorPoint, | |
ID: firstInput.Asset.ID(), | |
ScriptKey: asset.ToSerialized(firstInput.Asset.ScriptKey.PubKey), | |
} | |
burnKey := asset.NewScriptKey(asset.DeriveBurnKey(firstPrevID)) | |
firstPrevID := pkt.Inputs[0].PrevID | |
burnKey := asset.NewScriptKey(asset.DeriveBurnKey(firstPrevID)) |
I think we can omit the rest that doesn't seem relevant to the paragraph.
transfers that might create tombstones. | ||
|
||
Input commitment allocation represents one of the most complex aspects of the | ||
burn process. The createFundedPacketWithInputs function maps selected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
burn process. The createFundedPacketWithInputs function maps selected | |
burn process. The `createFundedPacketWithInputs` function maps selected |
The system enforces several critical constraints during execution. The full burn | ||
prevention mechanism blocks attempts to burn all assets in an anchor output, | ||
preventing the creation of empty outputs that would waste Bitcoin UTXO space. | ||
The single packet restriction currently limits burns to one virtual packet, | ||
effectively preventing group-based burns. These constraints, while limiting in | ||
some scenarios, ensure system stability and prevent edge cases that could | ||
compromise the burn mechanism's integrity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The system enforces several critical constraints during execution. The full burn | |
prevention mechanism blocks attempts to burn all assets in an anchor output, | |
preventing the creation of empty outputs that would waste Bitcoin UTXO space. | |
The single packet restriction currently limits burns to one virtual packet, | |
effectively preventing group-based burns. These constraints, while limiting in | |
some scenarios, ensure system stability and prevent edge cases that could | |
compromise the burn mechanism's integrity. |
Unnecessary paragraph after #1812
No description provided.