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

Add RM base interface module #19

Closed
wants to merge 4 commits into from
Closed

Add RM base interface module #19

wants to merge 4 commits into from

Conversation

paulcadman
Copy link
Collaborator

This describes the interface exposed by the transparent instantiation of the RM specification.

Copy link
Member

@mariari mariari left a comment

Choose a reason for hiding this comment

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

Yeah overall this looks mostly accurate, I believe some changes are required on our nock side for some functions but overall looks very close to both specs and what we have in the transparent code.

If you want me to review this for more "specs compliance", then I'd say we'd need clarity on compliance proof inputs for the verify function, but for the purpose this is nice

Comment on lines +61 to +64
--- INST_QUESTION: Can we assume that Kind, Commitment, Proof and
--- Delta types etc. are ;Nock.Atom;s so we don't need to make them builtin axioms?
Copy link
Member

Choose a reason for hiding this comment

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

I'd say yes for Kind Commitment and Proof
Delta Types I'm less sure of, how I represent them is pairing of the kind => quantity and I map it over to Nock.

My translation isn't perfect as instead of using signed numbers, I use [signed-bit number] which is important

I made an issue to track this particular format.

anoma/anoma#1507

@agureev what are your thoughts on this bit?

Comment on lines +164 to +165
--- Application specific data needed to create resource logic proofs.
-- SPEC_QUESTION, INST_QUESTION: The RM instantiation does not enforce
-- this type, it accepts any data. Does this need to be specified?
appData : Set AppDataElement
Copy link
Member

Choose a reason for hiding this comment

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

The type of this likely isn't even a set in how you described it, it's defined as

{(k, (d, deletion_criterion)): k ∈ 𝔽ₖₑ, d ⊆ 𝔽ₐ}

Meaning it's a map from k ---> AppDataValue.

Now take for instance

[mkAppDataElement key: 5 value: (mkAppDataValue value: 1 deletionCritera: 5);
 mkAppDataElement key: 5 value: (mkAppDataValue value: 2 deletionCritera: 5)]
|> Set.from_list
|> mkAction ...

Now we have 2 keys of the same value. I think, because of this limitation of representing it via a Set, a list with no restrictions may make more sense in this representation.

But this is a good Specs question

Copy link
Member

Choose a reason for hiding this comment

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

A lot more detail for this type is needed from the specs, as this implies certain storage behavior that changes how we deal with this quite drastically.

-- SPEC_QUESTION, INST_QUESTION: The RM instantiation does not enforce
-- this type, it accepts any data. Does this need to be specified?
appData : Set AppDataElement
Copy link
Member

Choose a reason for hiding this comment

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

Unless for ZK reasons, I'd say it's morally anything the user wants in there.

If this were an OO language I'd say it's some Object, the Object may be a Set. This is surely overstepping to specify the exact representation unless it's for ZK reasons no?

--- A set of roots of the commitment tree.
-- SPEC_QUESTION, INST_QUESTION: How do we obtain these roots?
roots : Set CommitmentTreeRoot;
Copy link
Member

Choose a reason for hiding this comment

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

You obtain them from the Indexer, you can query for the latest root

@paulcadman paulcadman changed the base branch from main to instantiation/transparent October 31, 2024 13:13
@paulcadman paulcadman changed the base branch from instantiation/transparent to main November 4, 2024 15:07
This describes the interface exposed by the transparent instantiation
of the RM specification.
Most Set operations can be done using the Juvix Set type. The only
operations that are required for the Anoma interface are those which
translate to/from the Stdlib Set type.
@paulcadman
Copy link
Collaborator Author

Closing in favour of #23. Thanks for the answers on here @mariari, these will be incorporated into the other branch.

@paulcadman paulcadman closed this Nov 4, 2024
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 this pull request may close these issues.

2 participants