Skip to content

[DO NOT MERGE] FCMP++: CurveTrees class & implementation of ed25519 outputs -> curve tree leaves function#10360

Open
j-berman wants to merge 11 commits intomonero-project:masterfrom
j-berman:outputs-to-leaves
Open

[DO NOT MERGE] FCMP++: CurveTrees class & implementation of ed25519 outputs -> curve tree leaves function#10360
j-berman wants to merge 11 commits intomonero-project:masterfrom
j-berman:outputs-to-leaves

Conversation

@j-berman
Copy link
Copy Markdown
Collaborator

Builds on top of:

The outputs_to_leaves function introduced in this PR takes in outputs that enter the chain, and converts them into valid leaves prepared to be inserted to the curve trees merkle tree. We do not add invalid outputs to
the tree, so outputs_to_leaves checks outputs for validity and only includes the valid outputs in the final response.

The CurveTrees class is a useful object for updating the curve trees merkle tree. It is instantiated with the widths of each layer in the tree, as well as the curve objects themselves.

"Unified Outputs" are the set of all outputs in the chain (pre-RCT, RCT, and Carrot). Each output has a unified_id, which is the ordered index given to the output upon entering the chain (when the tx that creates the output enters a block in the chain). We use the unified_id to determine the order to insert a batch of outputs into the curve tree merkle tree.

j-berman and others added 11 commits February 27, 2026 17:30
monero-project/research-lab#142

Co-authored-by: Jeffro <jeffro256@tutanota.com>
Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
- Function to convert an {output pubkey, commitment} to an output
tuple {O,I,C} in prepartion to insert the output tuple into the
curve tree.
- O = torsion cleared valid output pubkey checked for identity.
- I = key image generator.
- C = torsion cleared valid Commitment checked for identity.
- None of {O,I,C} should have torsion nor == identity.
- Introduces the OutputPair variant, which can either be Legacy
or Carrot V1 types. Legacy outputs are not checked for torsion
at consensus, and use the legacy biased hash to point fn to derive
the key image generator (I). Carrot V1 outputs **are** checked for
torsion at consensus, and use the unbiased hash to point to derive
the key image generator (I).
- The CurveTrees class is a useful object for updating the curve
trees merkle tree. It is instantiated with the widths of each layer
in the tree, as	well as	the curve objects themselves.
- The outputs_to_leaves function takes in outputs that enter the
chain, and converts them into valid leaves prepared to be inserted
to the curve trees merkle tree.	We do not add invalid outputs to
the tree, so outputs_to_leaves checks outputs for validity and only
includes the valid outputs in the final	response.
@j-berman j-berman changed the title FCMP++: CurveTrees class & implementation of ed25519 outputs -> curve tree leaves function [DO NOT MERGE] FCMP++: CurveTrees class & implementation of ed25519 outputs -> curve tree leaves function Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants