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

Use 32-bit integers for transaction output indexes in single-use seals #45

Closed
dr-orlovsky opened this issue May 12, 2020 · 4 comments · Fixed by #57
Closed

Use 32-bit integers for transaction output indexes in single-use seals #45

dr-orlovsky opened this issue May 12, 2020 · 4 comments · Fixed by #57
Assignees
Labels
*compatibility* Interoperability and compatibility issues
Milestone

Comments

@dr-orlovsky
Copy link
Member

Bitcoin normally uses VarInt to represent the number of transaction outputs that may be contained in a given transaction and 32-bit integer to reference specific transaction output from other's transaction input. While with the given block size limit transaction containing more than 2^16 outputs can't fit the block, it's better not to diverge from bitcoin data structure. The original reason why 16-bit integers were introduced is to save some storage space for RGB client-validated data; however bitcoin transaction output single-use seals are more generic standard and RGB consensus commitment encoding does not require storage space optimization. RGB P2P protocols and vendor-specific RGB storage may still use 16-bit integers; however this should not be required by the LNP/BP standards.

@dr-orlovsky dr-orlovsky added the *compatibility* Interoperability and compatibility issues label May 12, 2020
@dr-orlovsky dr-orlovsky added this to the RGB Beta milestone May 12, 2020
@dr-orlovsky dr-orlovsky self-assigned this May 12, 2020
@rajarshimaitra
Copy link
Contributor

Is this issue still open? I am willing to work on it, if it is.

@dr-orlovsky
Copy link
Member Author

It is opened, you are welcome!

@rajarshimaitra
Copy link
Contributor

To make sure that I understand correctly. The concerning index here is vout right? which is 16 bits and needs to be changed to 32 bits.

pub struct OutpointReveal {
/// Blinding factor preventing rainbow table bruteforce attack based on
/// the existing blockchain txid set
pub blinding: u64,
/// Txid that should be blinded
pub txid: Txid,
/// Tx output number that should be blinded
pub vout: u16,
}

@dr-orlovsky
Copy link
Member Author

Correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*compatibility* Interoperability and compatibility issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants