{"id":15021110,"url":"https://github.com/triska/bitcoinolog","last_synced_at":"2025-09-20T11:47:25.624Z","repository":{"id":83451287,"uuid":"94036618","full_name":"triska/bitcoinolog","owner":"triska","description":"Reason about Bitcoin addresses with Prolog","archived":false,"fork":false,"pushed_at":"2024-03-17T08:15:48.000Z","size":25,"stargazers_count":22,"open_issues_count":0,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-01T05:41:20.941Z","etag":null,"topics":["bitcoin","bitcoin-wallet","cryptocurrency","elliptic-curves","offline-capable","prolog"],"latest_commit_sha":null,"homepage":"https://www.metalevel.at/bitcoinolog/","language":"Prolog","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/triska.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":"2017-06-11T22:53:01.000Z","updated_at":"2024-12-26T19:21:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"373fb9b6-ccde-4f0c-a00e-5856af3e57c5","html_url":"https://github.com/triska/bitcoinolog","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"2a2a404919a55aad26deeb9d273c4d917dd34cb7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triska%2Fbitcoinolog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triska%2Fbitcoinolog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triska%2Fbitcoinolog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/triska%2Fbitcoinolog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/triska","download_url":"https://codeload.github.com/triska/bitcoinolog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238497715,"owners_count":19482302,"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","bitcoin-wallet","cryptocurrency","elliptic-curves","offline-capable","prolog"],"created_at":"2024-09-24T19:56:08.881Z","updated_at":"2025-09-20T11:47:20.573Z","avatar_url":"https://github.com/triska.png","language":"Prolog","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bitcoinolog: Reason about Bitcoin addresses with Prolog\n\n## Offline Bitcoin wallet creation\n\n*Bitcoinolog* uses [Prolog](https://www.metalevel.at/prolog) and the\n[`crrl`](https://github.com/pornin/crrl/) crate to create Bitcoin\naddresses and private\u0026nbsp;keys with several nice properties:\n\n  - generated keys are **cryptographically\u0026nbsp;secure** to the extent that\n    `crrl` guarantees this property\n  - the Prolog code is **short** and uses **no external programs**\n  - keys can be generated **offline**, on a machine that has no\n    Internet\u0026nbsp;connection.\n\nBitcoinolog requires Scryer Prolog.\n\nTo try it, download [**`bitcoinolog.pl`**](bitcoinolog.pl)\nand\u0026nbsp;run:\n\n    $ scryer-prolog bitcoinolog.pl\n\nHere is an example query that you can try:\n\n    ?- repeat,\n           new_private_key(PrivateKey),\n           private_key_to_public_key(PrivateKey, PublicKey),\n           public_key_to_address(PublicKey, Address),\n           private_key_to_wif(PrivateKey, WIF),\n           format:portray_clause((address_key(A, K) :- A=Address, K=WIF)),\n           false.\n\nThis Prolog query *generates* Bitcoin addresses and private\u0026nbsp;keys\nin Wallet Import Format\u0026nbsp;(WIF), yielding:\n\n    address_key(A, B) :-\n         A=\"1Nis7V58Mb839kXb9RZMDzAN6ZTQbNfGC4\",\n         B=\"L1T3AnvHDtaAhkr9zxKokKzqphx26cvdoU8HbEifsWH6chy4bzYS\".\n    address_key(A, B) :-\n         A=\"1D34yFJGRtiLuW2abwPBfks4cCi1Usp9a3\",\n         B=\"L5NUQyHr5zaJgG9ALbVGD1tcxodf51kUvQDANcNhpej1itV9KNLD\".\n    address_key(A, B) :-\n         A=\"12TUkSL2yyiiAD2f4zAcGDQPev2FSQmVwF\",\n         B=\"KyR4Ut96DFadt1LbdZNFzCLuJ2Hw9KSeX6wfMv2dnQwgympWZyyU\".\n    address_key(A, B) :-\n         A=\"1HySx6JBQKZoPqjUPVnbitFASKJjdAWWzx\",\n         B=\"Kxcr5G39Y7jUvsmsoDK5TnezsQ4FkTcYRVTcxzTT3uLYKnHFYiVh\".\n\nFor more information, visit:\n\n[**https://www.metalevel.at/bitcoinolog/**](https://www.metalevel.at/bitcoinolog/)\n\n**Video**: https://www.metalevel.at/prolog/videos/bitcoinolog\n\n## Elliptic Curve Cryptography in Prolog\n\nBitcoinolog uses\n[**`library(crypto)`**](https://github.com/mthom/scryer-prolog/blob/master/src/lib/crypto.pl)\nfor hashing and reasoning over *elliptic\u0026nbsp;curves*.\n\nAlternatively, you can use [**`ecclog.pl`**](ecclog.pl) for reasoning\nover elliptic\u0026nbsp;curves *in\u0026nbsp;Prolog*. Simply use the `ecc_`\npredicates instead of those starting with\u0026nbsp;`crypto_`:\n\n  - `crypto_curve_generator/2` \u0026rightarrow; `ecc_curve_generator/2`\n  - `crypto_curve_order/2` \u0026rightarrow; `ecc_curve_order/2`\n  - etc.\n\nInternally, `library(ecc)` uses\n[CLP(ℤ)\u0026nbsp;constraints](https://www.metalevel.at/prolog/clpz)\nto\u0026nbsp;facilitate\n[declarative\u0026nbsp;debugging](https://www.metalevel.at/prolog/debugging).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriska%2Fbitcoinolog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriska%2Fbitcoinolog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriska%2Fbitcoinolog/lists"}