{"id":13619731,"url":"https://github.com/maitrebitcoin/bitcoin-bitvm-compiler","last_synced_at":"2025-04-14T16:32:38.675Z","repository":{"id":204105151,"uuid":"711121360","full_name":"maitrebitcoin/bitcoin-bitvm-compiler","owner":"maitrebitcoin","description":"Generate a logical circuit for BitVM Bitcoin from a C like source code","archived":false,"fork":false,"pushed_at":"2024-09-08T07:02:21.000Z","size":658,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-08T08:21:28.221Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maitrebitcoin.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}},"created_at":"2023-10-28T09:26:03.000Z","updated_at":"2024-09-08T07:02:24.000Z","dependencies_parsed_at":"2024-06-23T16:40:45.864Z","dependency_job_id":"8ac2a4db-4f0b-4369-9e65-4c79177ca33a","html_url":"https://github.com/maitrebitcoin/bitcoin-bitvm-compiler","commit_stats":null,"previous_names":["maitrebitcoin/bitcoin-bitvm-compiler"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maitrebitcoin%2Fbitcoin-bitvm-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maitrebitcoin%2Fbitcoin-bitvm-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maitrebitcoin%2Fbitcoin-bitvm-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maitrebitcoin%2Fbitcoin-bitvm-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maitrebitcoin","download_url":"https://codeload.github.com/maitrebitcoin/bitcoin-bitvm-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223638174,"owners_count":17177754,"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-08-01T21:00:47.734Z","updated_at":"2025-04-14T16:32:38.663Z","avatar_url":"https://github.com/maitrebitcoin.png","language":"C++","funding_links":[],"categories":["Libraries"],"sub_categories":["Potential Use Case"],"readme":"# bitcoin-bitvm-compiler \n\nGenerate one or more logical circuits for BitVM Bitcoin from a C like source code\n\n\n## Example :\n\n```c\n// simple test program\nint8 main(int8 a, int8 b) \n{\n\tint8 local_a_and_b = a \u0026 b;\n\treturn local_a_and_b; \n}\n```\n\nGenerate the circuit(s) with :\n```\n bitvmcompiler.exe source.bvc export.txt\n```\n\nOutput : \n```\n16 16\n16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n8 17 19 21 23 25 27 29 31\n1 16 1 0 8 NAND\n1 17 1 16 16 NAND\n1 18 1 1 9 NAND\n1 19 1 18 18 NAND\n1 20 1 2 10 NAND\n1 21 1 20 20 NAND\n1 22 1 3 11 NAND\n1 23 1 22 22 NAND\n1 24 1 4 12 NAND\n1 25 1 24 24 NAND\n1 26 1 5 13 NAND\n1 27 1 26 26 NAND\n1 28 1 6 14 NAND\n1 29 1 28 28 NAND\n1 30 1 7 15 NAND\n1 31 1 30 30 NAND\n\n```\n\n## Testing\n\nThe circuit can be tested with -run \nex:\n```Batchfile\n bitvmcompiler.exe test_int8.bvc -run a=0x73,b=0x5F\n```\nOutput : \n```\nRunning with : a=0x73,b=0x5F\nSimulation result : 0x53\n```\n\nTested and build with Visual Studio 2022\n\n# Notes\n\nBits are in low endian (x86 format)\n\n# Current todo list :\n\n- function call ... in progress...\n- #include support ... in progress...\n- set a limit to the number of gates\n- operators : \\* / % \n- basic function stdlib (sha256, shnor, min, max,... )\n- write a better language documentation\n- linux : create a makefile\n- wasm support and browser demo site\n- check for unused inputs instead of a \"no more gates\" error\n- optimize the generated circuit (use less gates)\n- better syntax error messages\n- +=  operator\n- save the build circuit in a file, and load it for execution / generation \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaitrebitcoin%2Fbitcoin-bitvm-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaitrebitcoin%2Fbitcoin-bitvm-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaitrebitcoin%2Fbitcoin-bitvm-compiler/lists"}