{"id":13561383,"url":"https://github.com/MutinyWallet/bitcoin-waila","last_synced_at":"2025-04-03T17:30:40.423Z","repository":{"id":91148621,"uuid":"607063160","full_name":"MutinyWallet/bitcoin-waila","owner":"MutinyWallet","description":"\"What am I looking at?\" A tool for decoding bitcoin-related strings.","archived":false,"fork":false,"pushed_at":"2024-04-15T18:05:47.000Z","size":243,"stargazers_count":30,"open_issues_count":3,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T10:11:42.939Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/MutinyWallet.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":"2023-02-27T08:29:22.000Z","updated_at":"2025-03-20T11:17:11.000Z","dependencies_parsed_at":"2024-02-20T16:49:11.571Z","dependency_job_id":"1098191b-408e-403b-8538-392fe0ced1b4","html_url":"https://github.com/MutinyWallet/bitcoin-waila","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MutinyWallet%2Fbitcoin-waila","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MutinyWallet%2Fbitcoin-waila/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MutinyWallet%2Fbitcoin-waila/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MutinyWallet%2Fbitcoin-waila/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MutinyWallet","download_url":"https://codeload.github.com/MutinyWallet/bitcoin-waila/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247046773,"owners_count":20874719,"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:00:55.562Z","updated_at":"2025-04-03T17:30:40.028Z","avatar_url":"https://github.com/MutinyWallet.png","language":"Rust","funding_links":[],"categories":["Comapanies support RGB Protocol"],"sub_categories":["Main RGB Standards"],"readme":"# bitcoin-waila\n\n\"What am I looking at?\" A tool for decoding bitcoin-related strings.\n\n## Installing\n\n`bitcoin-waila` is available as a Rust crate and as an npm package.\n\n```\ncargo add bitcoin-waila\n```\n\n```\nnpm i @mutinywallet/waila-wasm\n```\n\n---\n\n## What is this?\n\nThis is a tool for decoding bitcoin-related strings.\nThe goal is to be able to give it any string, and it will decode it for you while giving you all the relevant payment\ninformation.\n\nCurrently supported:\n\n- Bitcoin address\n- BIP-21 URI\n- Lightning invoice\n- Lightning Offer\n- Bolt 12 Refund\n- Node Pubkey\n- LNURL\n- Lightning Address\n- Nostr Pubkey\n- RGB invoice\n\n## Examples\n\nBitcoin Address:\n\n```rust\nlet string = \"1andreas3batLhQa2FawWjeyjCqyBzypd\";\n\nlet decoded = bitcoin_waila::PaymentParams::from_str(string).unwrap();\n\nassert_eq!(decoded.address, Some(Address::from_str(\"1andreas3batLhQa2FawWjeyjCqyBzypd\").unwrap()));\nassert_eq!(parsed.network(), Some(Network::Bitcoin));\n```\n\nBIP 21:\n\n```rust\nlet string = \"bitcoin:BC1QYLH3U67J673H6Y6ALV70M0PL2YZ53TZHVXGG7U?amount=0.00001\u0026label=sbddesign%3A%20For%20lunch%20Tuesday\u0026message=For%20lunch%20Tuesday\u0026lightning=LNBC10U1P3PJ257PP5YZTKWJCZ5FTL5LAXKAV23ZMZEKAW37ZK6KMV80PK4XAEV5QHTZ7QDPDWD3XGER9WD5KWM36YPRX7U3QD36KUCMGYP282ETNV3SHJCQZPGXQYZ5VQSP5USYC4LK9CHSFP53KVCNVQ456GANH60D89REYKDNGSMTJ6YW3NHVQ9QYYSSQJCEWM5CJWZ4A6RFJX77C490YCED6PEMK0UPKXHY89CMM7SCT66K8GNEANWYKZGDRWRFJE69H9U5U0W57RRCSYSAS7GADWMZXC8C6T0SPJAZUP6\";\n\nlet decoded = bitcoin_waila::PaymentParams::from_str(string).unwrap();\n\nassert_eq!(parsed.amount(), Some(Amount::from_btc(0.00001).unwrap()));\nassert_eq!(parsed.address(), Some(Address::from_str(\"BC1QYLH3U67J673H6Y6ALV70M0PL2YZ53TZHVXGG7U\").unwrap()));\nassert_eq!(parsed.memo(), Some(\"For lunch Tuesday\".to_string()));\nassert_eq!(parsed.network(), Some(Network::Bitcoin));\nassert_eq!(parsed.invoice(), Some(Invoice::from_str(\"LNBC10U1P3PJ257PP5YZTKWJCZ5FTL5LAXKAV23ZMZEKAW37ZK6KMV80PK4XAEV5QHTZ7QDPDWD3XGER9WD5KWM36YPRX7U3QD36KUCMGYP282ETNV3SHJCQZPGXQYZ5VQSP5USYC4LK9CHSFP53KVCNVQ456GANH60D89REYKDNGSMTJ6YW3NHVQ9QYYSSQJCEWM5CJWZ4A6RFJX77C490YCED6PEMK0UPKXHY89CMM7SCT66K8GNEANWYKZGDRWRFJE69H9U5U0W57RRCSYSAS7GADWMZXC8C6T0SPJAZUP6\").unwrap()));\nassert_eq!(parsed.node_pubkey(), Some(PublicKey::from_str(\"037cc5f9f1da20ac0d60e83989729a204a33cc2d8e80438969fadf35c1c5f1233b\").unwrap()));\n```\n\nLightning Address:\n\n```rust\nlet parsed = bitcoin_waila::PaymentParams::from_str(\"ben@opreturnbot.com\").unwrap();\nassert_eq!(parsed.lnurl(), Some(LnUrl::from_str(\"lnurl1dp68gurn8ghj7mmswfjhgatjde3x7apwvdhk6tewwajkcmpdddhx7amw9akxuatjd3cz7cn9dc94s6d4\").unwrap()));\n```\n\nBolt 12:\n\n```rust\nlet parsed = bitcoin_waila::PaymentParams::from_str(\"lno1qgs0v8hw8d368q9yw7sx8tejk2aujlyll8cp7tzzyh5h8xyppqqqqqqgqvqcdgq2qenxzatrv46pvggrv64u366d5c0rr2xjc3fq6vw2hh6ce3f9p7z4v4ee0u7avfynjw9q\").unwrap();\nassert_eq!(parsed.amount_msats(), Some(100_000));\nassert_eq!(parsed.offer(), Some(Offer::from_str(\"lno1qgs0v8hw8d368q9yw7sx8tejk2aujlyll8cp7tzzyh5h8xyppqqqqqqgqvqcdgq2qenxzatrv46pvggrv64u366d5c0rr2xjc3fq6vw2hh6ce3f9p7z4v4ee0u7avfynjw9q\").unwrap()));\n```\n\nRGB Invoice:\n\n```rust\nlet parsed = bitcoin_waila::PaymentParams::from_str(\"rgb:Cbw1h3zbHgRhA6sxb4FS3Z7GTpdj9MLb7Do88qh5TUH1/RGB20/1+utxob0KPoUVTWL3WqyY6zsJY5giaugWHt5n4hEeWMQymQJmPRFPXL2n\").unwrap();\nassert!(matches!(parsed, PaymentParams::Rgb(_)));\n```\n\nJavaScript:\n\n```js\n// You need to initialize the wasm\n// There's also an initSync() if you don't like async\nconst waila = await init();\n\nconst string =\n  \"bitcoin:BC1QYLH3U67J673H6Y6ALV70M0PL2YZ53TZHVXGG7U?amount=0.00001\u0026label=sbddesign%3A%20For%20lunch%20Tuesday\u0026message=For%20lunch%20Tuesday\u0026lightning=LNBC10U1P3PJ257PP5YZTKWJCZ5FTL5LAXKAV23ZMZEKAW37ZK6KMV80PK4XAEV5QHTZ7QDPDWD3XGER9WD5KWM36YPRX7U3QD36KUCMGYP282ETNV3SHJCQZPGXQYZ5VQSP5USYC4LK9CHSFP53KVCNVQ456GANH60D89REYKDNGSMTJ6YW3NHVQ9QYYSSQJCEWM5CJWZ4A6RFJX77C490YCED6PEMK0UPKXHY89CMM7SCT66K8GNEANWYKZGDRWRFJE69H9U5U0W57RRCSYSAS7GADWMZXC8C6T0SPJAZUP6\";\n\nconst params = new PaymentParams(string);\n\nconsole.log(params.address);\nconsole.log(params.invoice);\nconsole.log(params.memo);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMutinyWallet%2Fbitcoin-waila","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMutinyWallet%2Fbitcoin-waila","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMutinyWallet%2Fbitcoin-waila/lists"}