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

Should the extended-message toggle use a BlockVersion::has_feature() API? #1706

Closed
cbeck88 opened this issue Mar 28, 2022 · 1 comment · Fixed by #1841
Closed

Should the extended-message toggle use a BlockVersion::has_feature() API? #1706

cbeck88 opened this issue Mar 28, 2022 · 1 comment · Fixed by #1841

Comments

@cbeck88
Copy link
Contributor

cbeck88 commented Mar 28, 2022

Shouldn't this use the BlockVersion::has_feature() API?

Originally posted by @jcape in #1700 (comment)

In confidential token ids PR, we added this code:

/// Toggles between old-style and new-style extended message
fn compute_extended_message_either_version(
    block_version: BlockVersion,
    message: &[u8],
    pseudo_output_commitments: &[CompressedCommitment],
    range_proof_bytes: &[u8],
) -> Vec<u8> {
    if block_version >= BlockVersion::THREE {
        // New-style extended message using merlin
        digest_extended_message(message, pseudo_output_commitments, range_proof_bytes).to_vec()
    } else {
        // Old-style extended message
        extend_message(message, pseudo_output_commitments, range_proof_bytes)
    }
}

This is actually not directly related to confidential tokens implementation.

We wanted to change the way the extended message was being computed to follow best practices like domain separation and framing when signing a message.

Reviewers agreed that this is an improvement.

To avoid toggling explicitly on block version values, we could treat this as a feature use_merlin_extended_message_digest or something, which can happen at the same time as the token id change. We need to describe this in an MCIP, either MCIP 25 or another MCIP.

@cbeck88
Copy link
Contributor Author

cbeck88 commented Mar 28, 2022

See also: mobilecoinfoundation/mcips#25 (comment)

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

Successfully merging a pull request may close this issue.

1 participant