{"id":20955122,"url":"https://github.com/bluewallet/silentpayments","last_synced_at":"2025-05-14T04:33:05.151Z","repository":{"id":175358079,"uuid":"653771385","full_name":"BlueWallet/SilentPayments","owner":"BlueWallet","description":"Send bitcoins to SilentPayment static payment codes, in pure typescript","archived":false,"fork":false,"pushed_at":"2025-05-03T22:35:20.000Z","size":311,"stargazers_count":33,"open_issues_count":4,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-03T23:25:23.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/BlueWallet.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,"zenodo":null}},"created_at":"2023-06-14T17:45:52.000Z","updated_at":"2025-05-01T17:57:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"b267c501-9797-452f-9904-ad4679604080","html_url":"https://github.com/BlueWallet/SilentPayments","commit_stats":null,"previous_names":["overtorment/silentpayments","bluewallet/silentpayments"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2FSilentPayments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2FSilentPayments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2FSilentPayments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlueWallet%2FSilentPayments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlueWallet","download_url":"https://codeload.github.com/BlueWallet/SilentPayments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254071370,"owners_count":22009779,"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-11-19T01:18:06.548Z","updated_at":"2025-05-14T04:33:04.793Z","avatar_url":"https://github.com/BlueWallet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SilentPayments (BIP-352)\n\nSend bitcoins to SilentPayment static payment codes, in pure typescript.\n\n## Installation\n\n- `npm i \"github:BlueWallet/SilentPayments\" --save`\n\nLibrary is implemented in pure typescript _without_ js-compiled version committed - you might need to configure javascript build on your side.\nFor example, to use it in `jest` tests:\n\n`package.json`:\n```json\n  \"jest\": {\n    \"transform\": {\n      \"^.+\\\\.(ts|tsx)$\": \"ts-jest\"\n    },\n    \"transformIgnorePatterns\": [\n      \"node_modules/(?!((jest-)?react-native(-.*)?|@react-native(-community)?)|silent-payments/)\"\n    ],\n```\nIf youre using webpack you might need to add a loader in `webpack.config.js`, something like this:\n\n\n```js\n...\n    {\n        test: /node_modules\\/silent-payments\\/.*\\.ts$/,\n        use: [\n          {\n            loader: require.resolve('ts-loader'),\n            options: {\n              allowTsInNodeModules: true,\n              getCustomTransformers: () =\u003e ({\n                before: [isDevelopment \u0026\u0026 ReactRefreshTypeScript()].filter(\n                  Boolean\n                ),\n              }),\n              transpileOnly: isDevelopment,\n            },\n          },\n        ],\n      },\n...\n```\n\n## Usage\n\nYou must provide UTXOs and targets (which might or might not include SilentPayment codes):\n\n```typescript\ncreateTransaction(utxos: UTXO[], targets: Target[]): Target[]\n```\n\nFinally:\n\n```typescript\n\nconst sp = new SilentPayment();\n\nconst targets = sp.createTransaction(\n      [\n        {\n          txid: \"f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16\",\n          vout: 0,\n          wif: ECPair.fromPrivateKey(Buffer.from(\"1cd5e8f6b3f29505ed1da7a5806291ebab6491c6a172467e44debe255428a192\", \"hex\")).toWIF(),\n          utxoType: \"p2wpkh\",\n        },\n      ],\n      [\n        {\n          address: \"3FiYaHYHQTmD8n2SJxVYobDeN1uQKvzkLe\",\n          value: 11_111,\n        },\n        {\n          address: \"sp1qqgste7k9hx0qftg6qmwlkqtwuy6cycyavzmzj85c6qdfhjdpdjtdgqjuexzk6murw56suy3e0rd2cgqvycxttddwsvgxe2usfpxumr70xc9pkqwv\",\n          value: 22_222,\n        },\n        {\n          // no address, which should be interpreted as change\n          value: 33_333,\n        },\n      ]\n    ),\n```\n\nLibrary will unwrap `sp1...` codes into correct receivers address. You _must_ provide correct UTXO types to the library, and you _must_ use the same UTXOs\nin an actual transaction you create. Library will _not_ do coin selection for you.\n\n\n\n## Development\n\n- `npm i`\n- `npm t`\n\n## License\n\nMIT\n\n## References\n\n- [https://github.com/bitcoin/bips/blob/1ae1b4bf80bc21911fbd90033edd8006d5e6b592/bip-0000.mediawiki](https://github.com/bitcoin/bips/pull/1458)\n- https://github.com/josibake/silent-payments-workshop/blob/main/silent-payments-workshop.ipynb\n- https://github.com/bitcoin/bitcoin/pull/27827\n- https://medium.com/@ottosch/how-bip47-works-ee641cc14bf3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluewallet%2Fsilentpayments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluewallet%2Fsilentpayments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluewallet%2Fsilentpayments/lists"}