{"id":23448801,"url":"https://github.com/zkfriendly/bip47","last_synced_at":"2025-04-13T17:33:29.149Z","repository":{"id":65524175,"uuid":"466165744","full_name":"zkfriendly/bip47","owner":"zkfriendly","description":"bip47 core utility functions","archived":false,"fork":false,"pushed_at":"2024-09-17T05:35:11.000Z","size":234,"stargazers_count":21,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-22T22:49:49.818Z","etag":null,"topics":["bip47","payment-codes"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/zkfriendly.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":"2022-03-04T15:02:33.000Z","updated_at":"2024-09-17T05:35:14.000Z","dependencies_parsed_at":"2024-03-04T19:36:20.482Z","dependency_job_id":"f48cda31-e53b-47ad-8079-f261cb096693","html_url":"https://github.com/zkfriendly/bip47","commit_stats":{"total_commits":53,"total_committers":5,"mean_commits":10.6,"dds":0.3584905660377359,"last_synced_commit":"5dc78baa0eb5bbe492a3e6589dfe16c1da7e03c3"},"previous_names":["spsina/bip47"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkfriendly%2Fbip47","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkfriendly%2Fbip47/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkfriendly%2Fbip47/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zkfriendly%2Fbip47/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zkfriendly","download_url":"https://codeload.github.com/zkfriendly/bip47/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248752644,"owners_count":21156131,"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":["bip47","payment-codes"],"created_at":"2024-12-23T22:18:43.819Z","updated_at":"2025-04-13T17:33:29.114Z","avatar_url":"https://github.com/zkfriendly.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BIP-47 Reusable Payment Codes\n\nA [BIP47](https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki) compatible library written in TypeScript with transpiled JavaScript committed to git.\n\n## Examples\ntypescript\n\n```typescript\nimport ECPairFactory from 'ecpair';\nimport * as ecc from 'tiny-secp256k1';\nimport BIP47Factory from '.';\n// You must wrap a tiny-secp256k1 compatible implementation\nconst ECPair = ECPairFactory(ecc);\n\nconst aliceSeedPhrase = 'response seminar brave tip suit recall often sound stick owner lottery motion';\nconst bobSeedPhrase = 'reward upper indicate eight swift arch injury crystal super wrestle already dentist';\nconst bobPaymentCode = 'PM8TJS2JxQ5ztXUpBBRnpTbcUXbUHy2T1abfrb3KkAAtMEGNbey4oumH7Hc578WgQJhPjBxteQ5GHHToTYHE3A1w6p7tU6KSoFmWBVbFGjKPisZDbP97';\n\n// alice private bip47\nconst aliceBip47 = BIP47Factory(ecc).fromBip39Seed(aliceSeedPhrase);\n\n// base58 payment code\nconst alicePaymentCode = aliceBip47.getSerializedPaymentCode();\n\n// P2PKH notification address\nconst aliceNotificationAddress = aliceBip47.getNotificationAddress();\n\n// bip47 from payment code\nconst bobPublicBip47 = BIP47Factory(ecc).fromPaymentCode(bobPaymentCode);\n\n// third payment address from alice to bob\nconst paymentAddress = aliceBip47.getPaymentAddress(bobPublicBip47.getPaymentCodeNode(), 2);\n\n// bob private bip47\nconst bobPrivateBip47 = BIP47Factory(ecc).fromBip39Seed(bobSeedPhrase);\n\n// third alice to bob wallet (bip32)\nconst wallet = bobPrivateBip47.getPaymentWallet(aliceBip47.getPaymentCodeNode(), 2);\n\n// third wallet private key\nconst privateKey = wallet.privateKey?.toString('hex');\n\n// examples of how to generate blinded payment code\n// and retrieving payment code from notification transaction\n// can be found in tests\n\n```\n\nsee tests for more examples.\n\n\n## Supported Functionality\n- generate payment code from seed phrase or seed hex\n- generate payment addresses\n- generate notification address from payment code\n- generate receiving addresses/privateKeys for a payment code\n- generate blinded payment code for notification transaction\n- retrieve payment code from raw notification transaction\n\n\n## Reference\n[BIP-47](https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki)\n\n[BIP-47 Test Vectors](https://gist.github.com/SamouraiDev/6aad669604c5930864bd)\n\n## Donations\nWe appreciate your donations if you found this repository useful :)\n- btc: `bc1qujem059ce55c2uwusrtv97e26ulmz43w3cz6gn`\n- payment code: `PM8TJLSPLroADRS1hJafJEUmRvuXZpE2YmRrfHT1LrYmQW6t4ZxtP73sjh5qUmxMMrpsioFHxaHFpGgkHz5Ubidyzc1orYjcAWYzdA71RVZshdytY67m`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkfriendly%2Fbip47","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzkfriendly%2Fbip47","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzkfriendly%2Fbip47/lists"}