{"id":13850270,"url":"https://github.com/Simplexum/python-elementstx","last_synced_at":"2025-07-12T21:33:37.970Z","repository":{"id":57456938,"uuid":"193676240","full_name":"Simplexum/python-elementstx","owner":"Simplexum","description":"Python3 library that implements support for Elements transactions. It builds on top, and is intended to be used along with python-bitcointx library.","archived":false,"fork":false,"pushed_at":"2024-04-09T12:50:16.000Z","size":568,"stargazers_count":13,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-01T21:36:43.725Z","etag":null,"topics":["elements","liquid"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Simplexum.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":"2019-06-25T09:22:37.000Z","updated_at":"2023-05-23T09:13:55.000Z","dependencies_parsed_at":"2024-01-18T10:12:44.541Z","dependency_job_id":"fdf985f6-3134-48ed-919d-b790fae2d8c1","html_url":"https://github.com/Simplexum/python-elementstx","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.016949152542372836","last_synced_commit":"4858587d27c9cdc16eb4d1556f95be33e7406abe"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simplexum%2Fpython-elementstx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simplexum%2Fpython-elementstx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simplexum%2Fpython-elementstx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Simplexum%2Fpython-elementstx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Simplexum","download_url":"https://codeload.github.com/Simplexum/python-elementstx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225839485,"owners_count":17532305,"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":["elements","liquid"],"created_at":"2024-08-04T20:01:02.374Z","updated_at":"2024-11-22T03:30:59.775Z","avatar_url":"https://github.com/Simplexum.png","language":"Python","readme":"This Python3 module implements support for Elements transactions.\n\nIt builds on top, and is intended to be used along with python-bitcointx library.\n\n## Requirements\n\n- [python-bitcointx](https://github.com/Simplexum/python-bitcointx) (version \u003e= 1.0.0)\n- [secp256k1-zkp](https://github.com/ElementsProject/secp256k1-zkp)\n\n  Configure parameters for `secp256k1-zkp`:\n\n```\n    ./configure --enable-experimental \\\n                --enable-module-generator \\\n                --enable-module-rangeproof \\\n                --enable-module-surjectionproof \\\n                --enable-module-ecdh \\\n                --enable-module-recovery\n```\n\n## Usage:\n\nWith contextual switch to Elements parameters:\n\n```python\nimport os\nimport elementstx\nfrom bitcointx import ChainParams, get_current_chain_params\nfrom bitcointx.wallet import CCoinKey, CCoinExtKey, CCoinAddress, P2PKHCoinAddress\n\nwith ChainParams('elements'):\n    k = CCoinExtKey.from_seed(os.urandom(32))\n    a = P2PKHCoinAddress.from_pubkey(k.derive_path(\"m/0'/0'/1\").pub)\n    print('example {} address: {}'.format(get_current_chain_params().name, a))\n    assert CCoinAddress(str(a)) == a\n```\n\nWith global switch to Elements parameters:\n\n```python\nfrom elementstx import ElementsParams\nfrom bitcointx import select_chain_params\n\nselect_chain_params('elements')\n# or, using the chain params class directly\nselect_chain_params(ElementsParams)\n\n# To switch to Liquid Network parameters:\nselect_chain_params('elements/liquidv1')\n\n```\n\nWithout the switch of chain parameters:\n\n```python\nfrom elementstx.core import CElementsTransaction\n\ntransaction_data = read_tx_data()\ntx = CElementsTransaction.deserialze(transaction_data)\nprint(\"Number of txout witnesses:\", len(tx.wit.vtxoutwit))\n\n```\n\n# Example Code\n\nSee `examples/` directory.\n","funding_links":[],"categories":["Development Tools","Python"],"sub_categories":["Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimplexum%2Fpython-elementstx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSimplexum%2Fpython-elementstx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSimplexum%2Fpython-elementstx/lists"}