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

Sudoku Example #118

Open
2 of 5 tasks
Acentelles opened this issue Jan 31, 2023 · 2 comments
Open
2 of 5 tasks

Sudoku Example #118

Acentelles opened this issue Jan 31, 2023 · 2 comments

Comments

@Acentelles
Copy link
Contributor

Acentelles commented Jan 31, 2023

The goal of this application is to demo how Taiga works. Pending work:

  • Define Token VP
  • Define Intent VP
  • Define Sudoku App VP
  • Reward design and implementation
  • Write documentation
@XuyangSong
Copy link
Collaborator

XuyangSong commented Mar 6, 2023

doc: https://hackmd.io/@yulia/sudoku

Circuit details:

  • Dealer Intent App VP
  1. check app_data = hash(encoded_puzzle || sudoku_app_vk)
  2. if it is an output note, there are no constraints
  3. if it is a spend note, check that there is a puzzle note with zero value, the state of the puzzle note is equal to encoded_puzzle, and sudoku_app_vk is equal to the app_vk of the puzzle note.
  • Sudoku App VP
  1. check the encoding of the current_state
  2. check app_data = hash(init_state || current_state)
  3. check current_state is a valid sudoku
  4. if it is the init sudoku note(output note), check init_state = current_state
  5. if it is an output note(the puzzle state is updated from the spend note), check spend_note_init_state = output_note_init_note and spend_note_vk = output_note_vk
  6. if it is a spend note, the output_note_current_state is a better solution than the spend_note_current_state. If the output_note_current_state is the final solution, check the value of output_note is zero; else, check the value of output_note is one.

Merged in #127

@XuyangSong
Copy link
Collaborator

Some minor TODO lists

  • Sudoku state encoding constraints in application vp
  • Add the constraints for non_zero_sudoku_cells assignment in check_puzzle
  • Consider if we need to make the app_data_static of the application vp unique. A potential solution is to embed the spend note rho into app_data_static when creating the note.

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

No branches or pull requests

2 participants