{"id":26956298,"url":"https://github.com/horus-org/payjoin-react-native-v2","last_synced_at":"2026-02-16T15:31:35.132Z","repository":{"id":285731318,"uuid":"959127627","full_name":"Horus-Org/payjoin-react-native-v2","owner":"Horus-Org","description":"Preview for Payjoin React Native V2","archived":false,"fork":false,"pushed_at":"2025-04-02T11:57:03.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T14:50:44.817Z","etag":null,"topics":["bitcoin","code-preview","lightning-network","payjoin","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":false,"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/Horus-Org.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,"zenodo":null}},"created_at":"2025-04-02T10:05:09.000Z","updated_at":"2025-08-04T09:29:05.000Z","dependencies_parsed_at":"2025-08-19T14:35:00.359Z","dependency_job_id":"82b27bcb-f7a5-4cb9-827d-a47425806786","html_url":"https://github.com/Horus-Org/payjoin-react-native-v2","commit_stats":null,"previous_names":["horus-org/payjoin-react-native-v2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Horus-Org/payjoin-react-native-v2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Horus-Org%2Fpayjoin-react-native-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Horus-Org%2Fpayjoin-react-native-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Horus-Org%2Fpayjoin-react-native-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Horus-Org%2Fpayjoin-react-native-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Horus-Org","download_url":"https://codeload.github.com/Horus-Org/payjoin-react-native-v2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Horus-Org%2Fpayjoin-react-native-v2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273309453,"owners_count":25082543,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","code-preview","lightning-network","payjoin","typescript"],"created_at":"2025-04-03T03:21:11.627Z","updated_at":"2026-02-16T15:31:35.067Z","avatar_url":"https://github.com/Horus-Org.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Payjoin React Native V2\n\n\u003eThis project implements Bitcoin PayJoin transactions in TypeScript, supporting both PayJoin V1 (BIP-78) and a preview of PayJoin V2 (BIP-77) using `bitcoinjs-lib` and `axios`. PayJoin enhances transaction privacy by allowing the receiver to contribute inputs to a payment.\n\n#### Features\n- **PayJoin V1**: Direct PSBT exchange with a receiver endpoint.\n- **PayJoin V2 Preview**: Simulated asynchronous flow via a directory, without Oblivious HTTP (OHTTP) due to lack of native JS support.\n- Creates, signs, and broadcasts PSBTs using testnet (configurable for mainnet).\n- Fetches UTXOs from Blockstream’s API.\n- Generates V2-compatible BIP-21 URIs.\n\n#### Installation\n```bash\nnpm install bitcoinjs-lib axios buffer typescript ts-node\n```\n\n#### Usage\n1. Save the code as `payjoin.ts`.\n2. Replace `senderWIF` and `senderAddress` with testnet credentials.\n3. Run:\n   ```bash\n   ts-node payjoin.ts\n   ```\n\n#### Example\n```typescript\nawait executePayJoin(\n  'cYourTestnetWIF',           // Sender private key (WIF)\n  'tb1q...',                  // Sender address\n  'tb1q6rz28mcfaxtmd6v789l9rrlrusd9rarc0mh4d0', // Receiver address\n  100000,                     // Amount (satoshis)\n  'https://example.com/payjoin', // V1 endpoint\n  'v1'                        // Version ('v1' or 'v2')\n);\n```\n\n#### PayJoin V2 Preview\n- **Simulation**: Uses plain HTTP to a mock directory (`http://localhost:3000`) instead of OHTTP.\n- **Flow**: Posts PSBT to directory, polls for response, and broadcasts the result.\n- **Mock Directory**: Run a local server for testing:\n  ```bash\n  npm install express\n  ts-node mockDirectory.ts\n  ```\n  Update `PAYJOIN_V2_DIRECTORY` to `http://localhost:3000`.\n\n#### Limitations\n- **V2**: Lacks OHTTP (not available in JS). Full V2 requires an OHTTP client and real directory (e.g., `payjoin.org`).\n- **Directory**: Simulated; replace with a real V2 directory URL for production.\n\n#### Dependencies\n- `bitcoinjs-lib`: Bitcoin transaction handling.\n- `axios`: HTTP requests.\n- `buffer`: Hex encoding/decoding.\n\n#### Notes\n- Tested on testnet; adapt `network` for mainnet.\n- Extend with OHTTP support when a JS library becomes available.\n\n--- \n**Warning: This is only preview implementation. It's not live yet.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorus-org%2Fpayjoin-react-native-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhorus-org%2Fpayjoin-react-native-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhorus-org%2Fpayjoin-react-native-v2/lists"}