{"id":13564528,"url":"https://github.com/RiverFinancial/bitcoinex","last_synced_at":"2025-04-03T21:31:03.318Z","repository":{"id":43475220,"uuid":"188153379","full_name":"RiverFinancial/bitcoinex","owner":"RiverFinancial","description":"Bitcoin utilities in Elixir","archived":false,"fork":false,"pushed_at":"2025-03-29T21:17:35.000Z","size":466,"stargazers_count":70,"open_issues_count":19,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-29T22:23:40.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RiverFinancial.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-23T03:16:36.000Z","updated_at":"2025-01-09T17:44:32.000Z","dependencies_parsed_at":"2024-03-18T16:38:01.258Z","dependency_job_id":"8b34b000-2db2-4863-9c86-3a9b85074e96","html_url":"https://github.com/RiverFinancial/bitcoinex","commit_stats":{"total_commits":105,"total_committers":9,"mean_commits":"11.666666666666666","dds":0.6190476190476191,"last_synced_commit":"14f6d7ef9264b6484c1a505087a4e2b40cf98fe5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiverFinancial%2Fbitcoinex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiverFinancial%2Fbitcoinex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiverFinancial%2Fbitcoinex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RiverFinancial%2Fbitcoinex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RiverFinancial","download_url":"https://codeload.github.com/RiverFinancial/bitcoinex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247083081,"owners_count":20880768,"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-01T13:01:32.605Z","updated_at":"2025-04-03T21:31:01.608Z","avatar_url":"https://github.com/RiverFinancial.png","language":"Elixir","funding_links":[],"categories":["Text and Numbers"],"sub_categories":[],"readme":"![Bitcoinex](https://user-images.githubusercontent.com/8378656/102842648-4f671380-43bc-11eb-8e0d-72c2a107e5ed.png)\n# Bitcoinex\n\nBitcoinex is striving to be the best and most up-to-date Bitcoin Library for Elixir.\n\n## Documentation\nDocumentation is available on [hexdocs.pm](https://hexdocs.pm/bitcoinex/api-reference.html).\n\n## Current Utilities\n* Serialization and validation for Bech32 and Base58.\n* Support for standard on-chain scripts (P2PKH..P2WPKH) and Bolt#11 Lightning Invoices.\n* Transaction serialization.\n* Basic PSBT (BIP174) parsing.\n\n## Usage\n\nWith [Hex](https://hex.pm/packages/bitcoinex):\n\n    {:bitcoinex, \"~\u003e 0.1.7\"}\n\nLocal:\n\n    $ mix deps.get\n    $ mix compile\n\n## Examples\n\nDecode a Lightning Network invoice:\n\n  ```elixir\n  Bitcoinex.LightningNetwork.decode_invoice(\"lnbc2500u1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpuaztrnwngzn3kdzw5hydlzf03qdgm2hdq27cqv3agm2awhz5se903vruatfhq77w3ls4evs3ch9zw97j25emudupq63nyw24cg27h2rspfj9srp\")\n\n  {:ok,\n    %Bitcoinex.LightningNetwork.Invoice{\n      amount_msat: 250000000,\n      description: \"1 cup coffee\",\n      description_hash: nil,\n      destination: \"03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad\",\n      expiry: 60,\n      fallback_address: nil,\n      min_final_cltv_expiry: 18,\n      network: :mainnet,\n      payment_hash: \"0001020304050607080900010203040506070809000102030405060708090102\",\n      route_hints: [],\n      timestamp: 1496314658\n    }}\n  ```\n\nParse a BIP-174 Partially Signed Bitcoin Transaction:\n\n  ```elixir\n  Bitcoinex.PSBT.decode(\"cHNidP8BAFUCAAAAASeaIyOl37UfxF8iD6WLD8E+HjNCeSqF1+Ns1jM7XLw5AAAAAAD/////AaBa6gsAAAAAGXapFP/pwAYQl8w7Y28ssEYPpPxCfStFiKwAAAAAAAEBIJVe6gsAAAAAF6kUY0UgD2jRieGtwN8cTRbqjxTA2+uHIgIDsTQcy6doO2r08SOM1ul+cWfVafrEfx5I1HVBhENVvUZGMEMCIAQktY7/qqaU4VWepck7v9SokGQiQFXN8HC2dxRpRC0HAh9cjrD+plFtYLisszrWTt5g6Hhb+zqpS5m9+GFR25qaAQEEIgAgdx/RitRZZm3Unz1WTj28QvTIR3TjYK2haBao7UiNVoEBBUdSIQOxNBzLp2g7avTxI4zW6X5xZ9Vp+sR/HkjUdUGEQ1W9RiED3lXR4drIBeP4pYwfv5uUwC89uq/hJ/78pJlfJvggg71SriIGA7E0HMunaDtq9PEjjNbpfnFn1Wn6xH8eSNR1QYRDVb1GELSmumcAAACAAAAAgAQAAIAiBgPeVdHh2sgF4/iljB+/m5TALz26r+En/vykmV8m+CCDvRC0prpnAAAAgAAAAIAFAACAAAA=\")\n\n  {:ok,\n    %Bitcoinex.PSBT{\n     global: %Bitcoinex.PSBT.Global{\n       proprietary: nil,\n       unsigned_tx: %Bitcoinex.Transaction{...},\n     inputs: [\n       %Bitcoinex.PSBT.In{\n         bip32_derivation: [\n           %{\n             derivation: \"b4a6ba67000000800000008004000080\",\n             public_key: \"03b1341ccba7683b6af4f1238cd6e97e7167d569fac47f1e48d47541844355bd46\"\n           },\n           %{\n             derivation: \"b4a6ba67000000800000008005000080\",\n             public_key: \"03de55d1e1dac805e3f8a58c1fbf9b94c02f3dbaafe127fefca4995f26f82083bd\"\n           }\n         ],\n         final_scriptsig: nil,\n         final_scriptwitness: nil,\n         non_witness_utxo: nil,\n         partial_sig: %{\n           public_key: \"03b1341ccba7683b6af4f1238cd6e97e7167d569fac47f1e48d47541844355bd46\",\n           signature: \"304302200424b58effaaa694e1559ea5c93bbfd4a89064224055cdf070b6771469442d07021f5c8eb0fea6516d60b8acb33ad64ede60e8785bfb3aa94b99bdf86151db9a9a01\"\n         },\n         por_commitment: nil,\n         proprietary: nil,\n         redeem_script: \"0020771fd18ad459666dd49f3d564e3dbc42f4c84774e360ada16816a8ed488d5681\",\n         sighash_type: nil,\n         witness_script: \"522103b1341ccba7683b6af4f1238cd6e97e7167d569fac47f1e48d47541844355bd462103de55d1e1dac805e3f8a58c1fbf9b94c02f3dbaafe127fefca4995f26f82083bd52ae\",\n         witness_utxo: %Bitcoinex.Transaction.Out{\n           script_pub_key: \"a9146345200f68d189e1adc0df1c4d16ea8f14c0dbeb87\",\n           value: 199909013\n         }\n       }\n     ],\n     outputs: []\n    }}\n ```\n\n\nHandle bitcoin addresses:\n\n  ```elixir\n  {:ok, {:mainnet, witness_version, witness_program}} = Bitcoinex.Segwit.decode_address(\"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4\")\n\n  Bitcoinex.Segwit.encode_address(:mainnet, witness_version, witness_program)\n\n  {:ok, \"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4\"}\n  ```\n\n# Decoding a PSBT\n\nWe have a simple script for decoding a PSBT to view the inputs and outputs. Once you've installed elixir, erlang, and the mix dependencies, you can run the command below:\n\n```bash\nmix run scripts/decode_psbt.exs \u003cpsbt_file_path\u003e \n```\n\n## Roadmap\nContinued support for on-chain and off-chain functionality including:\n* Full script support including validation.\n* Block serialization.\n* Transaction creation.\n* Broader BIP support including BIP32.\n\n## Contributing\nWe have big goals and this library is still in a very early stage. Contributions and comments are very much welcome.\n\n\n## DISCLAIMER\n\nThis software is not recommended for use in handling real funds. The addresses, public keys, and signatures generated by this library are not recommended to be used for sending or receiving real funds.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRiverFinancial%2Fbitcoinex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRiverFinancial%2Fbitcoinex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRiverFinancial%2Fbitcoinex/lists"}