{"id":21864259,"url":"https://github.com/lightsing/learn_halo2","last_synced_at":"2025-03-21T20:44:35.242Z","repository":{"id":63284594,"uuid":"565855887","full_name":"lightsing/learn_halo2","owner":"lightsing","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-16T07:34:21.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T15:30:03.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightsing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-14T13:25:02.000Z","updated_at":"2022-11-14T13:25:12.000Z","dependencies_parsed_at":"2022-11-16T09:02:31.821Z","dependency_job_id":null,"html_url":"https://github.com/lightsing/learn_halo2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsing%2Flearn_halo2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsing%2Flearn_halo2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsing%2Flearn_halo2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightsing%2Flearn_halo2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightsing","download_url":"https://codeload.github.com/lightsing/learn_halo2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244868087,"owners_count":20523582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T04:08:20.555Z","updated_at":"2025-03-21T20:44:35.223Z","avatar_url":"https://github.com/lightsing.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# learn halo2 by fibonacci\n## Layout\n|  row  |   n    |    l     |   r    | n_inv  | instance |\n|:-----:|:------:|:--------:|:------:|:------:|:--------:|\n|       | Advice |  Advice  | Advice | Advice | Instance |\n|   0   |   n    |  fib(0)  | fib(1) |   *    |  fib(0)  |\n|   1   |  n-1   |  fib(1)  | fib(2) |   *    |  fib(1)  |\n|   2   |  n-2   |  fib(2)  | fib(3) |   *    |     n    |\n|   3   |  n-3   |  fib(3)  | fib(4) |   *    |  fib(n)  |\n|  ...  |  ...   |   ...    |  ...   |  ...   |    ...   |\n|  n-1  |   1    | fib(n-1) | fib(n) |   1    |          |\n|   n   |   0    |  fib(n)  | fib(n) |   0    |          |\n|       |  ...   |   ...    |  ...   |  ...   |    ...   |\n|  MAX  |   0    |  fib(n)  | fib(n) |   0    |          |\n| MAX+1 | UNUSED |  UNUSED  | UNUSED |        |  UNUSED  |\n\n## Constraint Design\n\nThe rows used is defined as a constant `MAX`.\n\n### constraint equal\n\n- `l[0] = instance[0]`\n- `l[1] = instance[1]`\n- `l[MAX] = instance[3]` =\u003e to minimize rows that are equality enabled\n- `n[0] = instance[2]`\n\n### gate for fibonacci\n\n- when `n != 0`, `l' = r, r' = l + r, n' = n - 1`, which in human language: for nth row, l is fib(n) and r is fib(n + 1)\n- when `n == 0`, `l' = r, r' = r, n' = 0`\n\n### gate for zero \"gadget\"\n\n`n * (1 - n * n_inv) = 0` holds for all used column (for easy to setup, n_inv = 0 when n = 0)\n\nthis is to make it easy to use the condition `n != 0`:\n- when `n == 0`, `1 - n * n_inv = 1`\n- when `n != 0`, `1 - n * n_inv = 0`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsing%2Flearn_halo2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightsing%2Flearn_halo2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightsing%2Flearn_halo2/lists"}