{"id":15446661,"url":"https://github.com/jochasinga/firma","last_synced_at":"2025-11-17T12:02:18.201Z","repository":{"id":149002446,"uuid":"123096369","full_name":"jochasinga/firma","owner":"jochasinga","description":"Simple Merkle tree implementation based on the Bitcoin white paper.","archived":false,"fork":false,"pushed_at":"2020-12-02T04:13:24.000Z","size":20,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-18T15:18:08.683Z","etag":null,"topics":["bitcoin","blockchain","firma","hashtree","merkle","ocaml","security"],"latest_commit_sha":null,"homepage":"","language":"OCaml","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/jochasinga.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-27T08:20:08.000Z","updated_at":"2022-02-04T17:23:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"867b143b-43c4-40fb-b05c-550f558d351d","html_url":"https://github.com/jochasinga/firma","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/jochasinga%2Ffirma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochasinga%2Ffirma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochasinga%2Ffirma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochasinga%2Ffirma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jochasinga","download_url":"https://codeload.github.com/jochasinga/firma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249795330,"owners_count":21326778,"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":["bitcoin","blockchain","firma","hashtree","merkle","ocaml","security"],"created_at":"2024-10-01T20:01:55.006Z","updated_at":"2025-11-17T12:02:13.166Z","avatar_url":"https://github.com/jochasinga.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firma\n\nBlockchain focusing on security token issuance and decentralized cap table.\n\n## Testing on Ocaml's toplevel\n\nCompile the module interface\n\n```bash\n\n$ ocamlc -c merkle.ml     # merkle.cmi\n\n```\n\nFind and link dependencies, then compile to module object file (`.cmo`)\n\n```bash\n\n$ ocamlfind ocamlc -package cryptokit,yojson -c merkle.ml\n\n```\n\nInstruction [here](http://projects.camlcity.org/projects/dl/findlib-1.2.6/doc/guide-html/quickstart.html) is awesome for linking libraries.\n\nthen load `merkle.cmo` on Ocaml's toplevel / utop:\n\n```bash\n\n#load \"merkle.cmo\";;\nopen Merkle;;\n\n```\n\n## example\n\n```ocaml\n\n(** Print out all the tree's nodes *)\n\ntree_of_txs [\"A\"; \"B\"; \"C\"; \"D\"] |\u003e peek_all ;;\n\n```\n\n## Run JSON API server\n\nFind the root directory where `api_server.ml`is located, then run:\n\n```bash\n\n$ dune build api_server.exe\n$ ./_build/default/api_server.exe\n\n```\n\nIf nothing goes wrong, you should see this being printed:\n\n```bash\n\nListening for HTTP on port 8080\nTry 'curl http://localhost:8080/merkle?txs=x,y,z'\n\n```\n\nThe API server writes a JSON structure representing a binary Merkle tree created\nfrom the input of transactions (`txs`).\n\n## example\n\nProvided transactions `A`, `B`, `C`, and `D`:\n\n```bash\n\ncurl http://localhost:8080/merkle?txs=A,B,C,D\u0026debug=true\n\n```\nThe JSON string being returned is\n\n```json\n\n{\n  \"data\": {\n    \"hash\": \"ABCD\",\n    \"children\": [\n      {\n        \"hash\": \"AB\",\n        \"children\": [\n          {\n            \"hash\": \"A\",\n            \"children\": []\n          },\n          {\n            \"hash\": \"B\",\n            \"children\": []\n          }\n        ]\n      },\n      {\n        \"hash\": \"CD\",\n        \"children\": [\n          {\n            \"hash\": \"C\",\n            \"children\": []\n          },\n          {\n            \"hash\": \"D\",\n            \"children\": []\n          }\n        ]\n      }\n    ]\n  }\n}\n\n```\n\nSetting `debug` query parameter to anything other than `true` or leave empty\nwill default to `debug=false` and hash strings are returned instead.\n\nJSON with `null` data will be returned if the number of `tx` is not a power of two.\nRead [merkle.mli](./merkle.mli) to find out more.\n\n# WIP\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochasinga%2Ffirma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjochasinga%2Ffirma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochasinga%2Ffirma/lists"}