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 the compilation of validity predicates that can be deployed to Anoma #1355

Closed
paulcadman opened this issue Jun 28, 2022 · 2 comments · Fixed by #1449, #1425 or #1426
Closed

Support the compilation of validity predicates that can be deployed to Anoma #1355

paulcadman opened this issue Jun 28, 2022 · 2 comments · Fixed by #1449, #1425 or #1426
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@paulcadman
Copy link
Collaborator

Currently minijuvix compile produces WASI binaries that can be executed using a local WASM runtime like wasmer.

This issue is to add support for compilation of pure WASM binaries that export a function that can be executed on Anoma.

(See https://github.com/anoma/anoma/blob/5831077bf1f1ff917f97264471b0ddcae224e739/macros/src/lib.rs#L75 for the corresponding Rust validity predicate macro that produces the WASM signature via C FFI).

@paulcadman paulcadman self-assigned this Jun 28, 2022
@paulcadman paulcadman added the enhancement New feature or request label Jun 28, 2022
@cwgoes
Copy link
Contributor

cwgoes commented Jul 1, 2022

Example validity predicates:

  • Fungible token
  • Tic-tac-toe game: one party can initiate a new game, two players can make moves in succession, at the end the VP checks whether one player won or the game was a tie and writes state to keep track of everyone's score

@paulcadman
Copy link
Collaborator Author

After #1449 we've demonstrated the ability to run a validity predicate compiled from Juvix in Anoma.

See:

https://github.com/anoma/juvix/blob/7bf337217d3fdcc1f8f5d5b976577d2e76555caa/tests/positive/MiniC/AlwaysValidVP/Input.juvix

We do not have support for deserialising the arguments (Address struct, transaction data, set of keys changed and set of verifiers) that are passed to the validity predicate.

For this we'll need to support decoding a pointer to a Juvix type using the Borsh spec https://borsh.io

@paulcadman paulcadman modified the milestones: 0.2.4, 0.2.3 Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment