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

Support resource machine client library in the nock backend #3084

Closed
paulcadman opened this issue Oct 7, 2024 · 0 comments · Fixed by #3113
Closed

Support resource machine client library in the nock backend #3084

paulcadman opened this issue Oct 7, 2024 · 0 comments · Fixed by #3113
Labels
anoma backend:nockma enhancement New feature or request october-testnet Issues required to support the Anoma October 2024 testnet pending-review

Comments

@paulcadman
Copy link
Collaborator

paulcadman commented Oct 7, 2024

Requirement

The Anoma client provides a library in the client proving context which includes functions to:

  • Generate proofs
  • Create commitments and nullifiers

This will be provided in the environment slot of a transaction function when it is applied.

Say the transaction function is some nock code [code args env] then when it is applied then the args slot is replaced by the application arguments and the env slot is replaced by the nock code of the resource machine standard library.

The hoon version of the incomplete library is available: https://github.com/anoma/anoma/blob/39c84b01f6af6c0167c67fe6eabc7450464ac5e4/hoon/resource-machine.hoon

We require that the functions defined in this client library are made available to application function authors in frontend Juvix syntax (via builtins).

Implementation

We should use a similar strategy that we use for Anoma Nock standard library calls:

Specifically we need to:

  • Record the nock path offsets for each function in the resource machine client library in a compiler data structure.
  • Capture the client library from the function environment in a similar way to how we capture the scry id from the transaction function arguments.
  • Add frontend builtin calls that call each of the client functions, in a similar way to callStdlib works now.
@paulcadman paulcadman added enhancement New feature or request pending-review backend:nockma anoma october-testnet Issues required to support the Anoma October 2024 testnet labels Oct 7, 2024
lukaszcz pushed a commit that referenced this issue Oct 21, 2024
Most changes in this PR relate to renaming of the Anoma Nock
StandardLibrary to AnomaLibrary. This is because the Anoma library now
consists of a standard library from
[anoma.hoon](https://github.com/anoma/anoma/blob/a20b5e78380b4dcf554fda6f4c75758cc1b70063/hoon/anoma.hoon)
and the resource machine library
[resource-machine.hoon](https://github.com/anoma/anoma/blob/a20b5e78380b4dcf554fda6f4c75758cc1b70063/hoon/anoma.hoon).

The Anoma RM functions and value references are also added. Their
integration into the compiler pipeline will happen in a separate PR.

The Anoma Library RM functions and stdlib functions are enumerated
separately. There is a separate type for Anoma Library values because
these are compiled differently than functions.

Part of:

* #3084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anoma backend:nockma enhancement New feature or request october-testnet Issues required to support the Anoma October 2024 testnet pending-review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant