{"id":18731154,"url":"https://github.com/qustavo/go-wallet","last_synced_at":"2025-04-12T17:53:01.659Z","repository":{"id":57634087,"uuid":"419201687","full_name":"qustavo/go-wallet","owner":"qustavo","description":"A work-in-progress Bitcoin wallet based on Output Descriptors","archived":false,"fork":false,"pushed_at":"2021-11-15T20:39:59.000Z","size":64,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T05:14:57.446Z","etag":null,"topics":["bitcoin","descriptors","multisig","wallet"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qustavo.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}},"created_at":"2021-10-20T05:51:25.000Z","updated_at":"2023-08-01T09:17:42.000Z","dependencies_parsed_at":"2022-09-17T04:40:51.594Z","dependency_job_id":null,"html_url":"https://github.com/qustavo/go-wallet","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fgo-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fgo-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fgo-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qustavo%2Fgo-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qustavo","download_url":"https://codeload.github.com/qustavo/go-wallet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610408,"owners_count":21132920,"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","descriptors","multisig","wallet"],"created_at":"2024-11-07T14:56:30.193Z","updated_at":"2025-04-12T17:53:01.637Z","avatar_url":"https://github.com/qustavo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-wallet\n[![Build Status](https://github.com/qustavo/go-wallet/actions/workflows/test.yml/badge.svg)](https://github.com/qustavo/go-wallet/actions)\n[![Go Reference](https://pkg.go.dev/badge/github.com/qustavo/go-wallet.svg)](https://pkg.go.dev/github.com/qustavo/go-wallet)\n\nA work-in-progress Bitcoin wallet\n\n## Descriptors\n`go-wallet` is designed around [Bitcoin Descriptors](https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki).\nIt implements a Output Script Descriptors language parser which returns valid outputs scripts.\nThe script package also implements a Output Script DSL to build scripts with a fluent API.\n\n### Supported scripts\n\n| Script Type |Operator                   | |\n|-------------|---------------------------|-|\n| P2SH        | `sh(SCRIPT)`              |✓|\n| P2WSH       | `wsh(SCRIPT)`             |✓|\n| P2PK        | `pk(KEY)`                 |✗|\n| P2PKH       | `pkh(KEY)`                |✓|\n| P2WPKH      | `wpkh(KEY)`               |✓|\n|             | `combo(KEY)`              |✗|\n| Multi       | `multi(k,\u003ckeys\u003e`          |✓|\n| Sortedmulti | `sortedmulti(k,\u003ckeys\u003e`    |✓|\n| P2TR        | `tr()` or `tr(KEY, TREE)` |✗|\n|             | `addr(ADDR)`              |✗|\n|             | `hex(HEX)`                |✗|\n\n### Example\nThe following example shows how generate addresses for an output descriptor using the cli tool:\n\n```bash\n$ wallet-cli newaddrs --num=1 \"wsh(sortedmulti(2,\n\t0375e00eb72e29da82b89367947f29ef34afb75e8654f6ea368e0acdfd92976b7c,\n\t03a1b26313f430c4b15bb1fdce663207659d8cac749a0e53d70eff01874496feff,\n\t03c96d495bfdd5ba4145e3e046fee45e84a8a48ad05bd8dbb395c011a32cf9f880\n))\"\n\nm/0/0: bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej\n```\n\nOr using the wallet API:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/qustavo/go-wallet\"\n\t\"github.com/qustavo/go-wallet/script\"\n)\n\nfunc main() {\n\tw, err := wallet.NewWallet(`\n\t\twsh(sortedmulti(2,\n\t\t\t0375e00eb72e29da82b89367947f29ef34afb75e8654f6ea368e0acdfd92976b7c,\n\t\t\t03a1b26313f430c4b15bb1fdce663207659d8cac749a0e53d70eff01874496feff,\n\t\t\t03c96d495bfdd5ba4145e3e046fee45e84a8a48ad05bd8dbb395c011a32cf9f880\n\t))`, script.Mainnet)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"\u003e addr: %s\\n\", w.Address())\n}\n```\n\nThe same can be expresses using the script API.\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t. \"github.com/qustavo/go-wallet/script\"\n)\n\nfunc main() {\n\tscript := Wsh(Sortedmulti(2,\n\t\t\"0375e00eb72e29da82b89367947f29ef34afb75e8654f6ea368e0acdfd92976b7c\",\n\t\t\"03a1b26313f430c4b15bb1fdce663207659d8cac749a0e53d70eff01874496feff\",\n\t\t\"03c96d495bfdd5ba4145e3e046fee45e84a8a48ad05bd8dbb395c011a32cf9f880\",\n\t))\n\teval, err := script.Eval()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"\u003e addr: %s\\n\", eval.Address(Mainnet))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqustavo%2Fgo-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqustavo%2Fgo-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqustavo%2Fgo-wallet/lists"}