Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Fix node ID mismatch in consignment #131



Copy link

This is a proposed fix for an issue that I have bumped into when testing the fungible validate command, and that had been reported at #130.

It turns out that the way the Consignment structure was being generated, it ended up with state transition node IDs referenced by different fields of the structure that did not match. More specifically, the state transition node IDs in the endpoints field did not match the state transition node IDs in the state_transitions field.

This happened because the state transition (in my test case there was a single state transition) had some of its assignments concealed before it was added to the state_transitions field but was used as it was in the endpoints field. The modification of the state transition (via the concealment of its assignments) caused its node ID to change, leading to the mismatch.

The proposed fix makes sure that the state transitions are modified as needed (have some of its assignments concealed) before they are assigned to any of the Consignment fields. That way the whole Consignment structure will reference the modified state transitions, avoiding the mismatch. That same scheme is also applied to state extensions.

Copy link

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You did a very untrivial job on discovering the source behind the bug. Unfortunately this specific solution will lead to the confidential information leak: the receiving party will known change UTXO from the sender.

The solution should not expose such information, and the node id must not depend on whether any of the state transition data are concealed or not. Pls see details in my comment #130 (comment)

@dr-orlovsky dr-orlovsky linked an issue Feb 10, 2021 that may be closed by this pull request
@dr-orlovsky dr-orlovsky moved this from Proposed solution to Rejected solutions in Quality Assesment Feb 10, 2021
UkolovaOlga added a commit to LNP-BP/devcalls that referenced this pull request Feb 15, 2021
10.02.2021 Agenda:

Issues from

1. Properly handle result from 'validate' request to Stash daemon - RGB-WG/rgb-node#132
2. Asset state transition node ID mutability
    - RGB-WG/rgb-node#131
    - Asset transfer validation is ineffective: RGB-WG/rgb-node#130
3. Question about fungible asset known allocations semantics - RGB-WG/rgb-node#134
4. Transfer change allocation not being registered - RGB-WG/rgb-node#129
5. Transaction output duplicated by 'fungible transfer' - RGB-WG/rgb-node#127
Copy link

Invalidated by RGB-WG/rgb-core#8

@dr-orlovsky dr-orlovsky added this to the 0.4.0 milestone Mar 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
No open projects
Quality Assesment
Rejected solutions

Successfully merging this pull request may close these issues.

Asset transfer validation is ineffective
2 participants