{"id":29124361,"url":"https://github.com/erhant/noir-tckn","last_synced_at":"2026-02-04T15:35:26.805Z","repository":{"id":299449260,"uuid":"1000962410","full_name":"erhant/noir-tckn","owner":"erhant","description":"Verify Turkish ID number validity with Noir.","archived":false,"fork":false,"pushed_at":"2025-06-16T15:46:43.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-16T16:41:46.965Z","etag":null,"topics":["aztec","noir","noir-lang"],"latest_commit_sha":null,"homepage":"","language":"Noir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erhant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-12T15:35:00.000Z","updated_at":"2025-06-16T15:46:47.000Z","dependencies_parsed_at":"2025-06-16T16:41:55.502Z","dependency_job_id":"6a1f120d-e2b4-4fb3-bd3f-5a96ac3311ae","html_url":"https://github.com/erhant/noir-tckn","commit_stats":null,"previous_names":["erhant/noir-tckn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/erhant/noir-tckn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erhant%2Fnoir-tckn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erhant%2Fnoir-tckn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erhant%2Fnoir-tckn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erhant%2Fnoir-tckn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erhant","download_url":"https://codeload.github.com/erhant/noir-tckn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erhant%2Fnoir-tckn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262660024,"owners_count":23344443,"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":["aztec","noir","noir-lang"],"created_at":"2025-06-29T20:07:54.608Z","updated_at":"2026-02-04T15:35:26.759Z","avatar_url":"https://github.com/erhant.png","language":"Noir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# noir-tckn\n\n\u003e [_original snippet from Turkish Wikipedia page on Turkish ID_](https://tr.wikipedia.org/wiki/T.C._Kimlik_Numaras%C4%B1):\n\u003e\n\u003e T.C. Kimlik No, on bir (11) haneden oluşan, Nüfus ve Vatandaşlık İşleri Genel Müdürlüğü tarafından Türk vatandaşlarına verilmiş 11 rakamdan oluşan ve son rakamı bir çift sayı olan kişiye özgü bir sayıdır.\n\u003e\n\u003e Üzerinde basit bir pariteyle hata bulma özelliği bulunmaktadır; ilk 10 rakamın toplamının birler basamağı, 11. rakamı vermektedir. Bu algoritmayı kullanan oluşturucularla yaklaşık 900 milyon kadar geçerli T.C. kimlik numarası üretilebilmektedir.[1]\n\u003e\n\u003e Ayrıca; 1, 3, 5, 7 ve 9. rakamın toplamının 7 katı ile 2, 4, 6 ve 8. rakamın toplamının 9 katının toplamının birler basamağı 10. rakamı; 1, 3, 5, 7 ve 9. rakamın toplamının 8 katının birler basamağı 11. rakamı vermektedir.[2]\n\nThis translates to the following rules for a Turkish National ID (TCKN):\n\n1. A Turkish National ID number consists of **11 digits**.\n2. The **last digit** (11th digit) must be an **even number**.\n3. There are several validation rules:\n   - The ones digit of the sum of the first 10 digits gives the 11th digit\n   - To find the 10th digit: Multiply the sum of digits at positions (1,3,5,7,9) by 7, add it to the sum of digits at positions (2,4,6,8) multiplied by 9, and take the ones digit of the result\n   - To find the 11th digit: Take the ones digit of 8 times the sum of digits at positions (1,3,5,7,9)\n\nUsing these rules, approximately 900 million valid Turkish National ID numbers can be generated.\n\nThis is a [Noir](https://noir-lang.org/) implementation of the Turkish National ID validation rules. The project allows validation of TCKN using zero-knowledge proofs.\n\n## Installation\n\nMake sure you have Nargo (Noir's package manager) installed. If not, follow the [installation instructions](https://noir-lang.org/getting_started/installation).\n\nClone this repository:\n\n```sh\ngit clone https://github.com/erhant/noir-tckn.git\ncd noir-tckn\n```\n\n## Usage\n\nTo verify a TCKN number:\n\n```bash\nnargo execute\n```\n\n\u003e `nargo execute` reads the input from [`Prover.toml`](./Prover.toml)\n\u003e\n\u003e ```toml\n\u003e tckn = [\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"1\",\"4\",\"6\"]\n\u003e ```\n\n## Performance\n\nWe have 3 versions implemented:\n\n- [`v0`](./src/v0.nr) uses a `Field` input, does occasional castings.\n- [`v0.5`](./src/v0_5.nr) gets rids of casting around the place by accepting the casted value as input, albeit at the cost of more gates.\n- [`v1`](./src/v1.nr) uses a better evenness check \u0026 unconstrained and hinted mod 10 trick.\n\n| Version | ACIR Opcodes | Circuit Size |\n| ------- | ------------ | ------------ |\n| v0      | 93           | 3614         |\n| v0.5    | 122          | 2910         |\n| v1      | 50           | 79           |\n\nWe use the following commands for this:\n\n- `nargo info` to get ACIR opcodes\n- `bb gates -b ./target/tckn.json` to get Circuit Size\n\n## Testing\n\nThe project includes test cases for valid and invalid TCKN numbers:\n\n```bash\nnargo test\n```\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferhant%2Fnoir-tckn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferhant%2Fnoir-tckn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferhant%2Fnoir-tckn/lists"}