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

State transition bundle to witness transaction relation ambiguity #247

Closed
dr-orlovsky opened this issue Jul 31, 2024 · 0 comments · Fixed by #248
Closed

State transition bundle to witness transaction relation ambiguity #247

dr-orlovsky opened this issue Jul 31, 2024 · 0 comments · Fixed by #248
Assignees
Labels
bug Something isn't working epic Epic task covering multiple steps of implementation refactoring Code refactoring
Milestone

Comments

@dr-orlovsky
Copy link
Member

dr-orlovsky commented Jul 31, 2024

My research has shown that the assumption that each witness transaction has 1-to-1 relations with anchor and state transition bundle, used in developing Index for standard library, is invalid.

The problem comes from so-called "pay-to-witness" state transitions, which doesn't contain txid in their seal definition. This means that if one does an RBF for a pay-to-witness invoice - or use RGB in lightning channel, when RGB state is not changed (only bitcoin amount in witness transactions output), the resulting bundle for both transactions (pre-RBF or pre-channel-update - and post) will be the same. Thus, multiple witness transactions can be related to the same state transition bundle.

The situation can be "saved" by requiring RBF and LN channels to force-change bundle using "salt" values in state values. However, this is hacky and may also not always work: if a state transition defines just pay-to-witness seals and void state ("state rights"), there is no salt available to change the bundle id.

Thus, the index must be able to contain information about multiple witness transactions for any bundle id. This creates a problem during the consignment construction (of which witness transaction must be selected for the consignment), but this can be solved via newly introduces witness state information managed by the contract state object, which should be implemented as a part of Stock business logic.

Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working epic Epic task covering multiple steps of implementation refactoring Code refactoring
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant