{"id":20305702,"url":"https://github.com/bitpay/bitcore-payment-code","last_synced_at":"2025-07-13T12:12:50.442Z","repository":{"id":66192370,"uuid":"46870398","full_name":"bitpay/bitcore-payment-code","owner":"bitpay","description":"Payment Code BIP47 for Bitcore Lib","archived":false,"fork":false,"pushed_at":"2015-12-04T19:53:26.000Z","size":52,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-18T18:36:59.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bitpay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-25T15:34:49.000Z","updated_at":"2022-11-22T14:33:52.000Z","dependencies_parsed_at":"2023-02-20T00:01:00.512Z","dependency_job_id":null,"html_url":"https://github.com/bitpay/bitcore-payment-code","commit_stats":null,"previous_names":["bitpay/bitcore-payment-codes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-payment-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-payment-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-payment-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitpay%2Fbitcore-payment-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitpay","download_url":"https://codeload.github.com/bitpay/bitcore-payment-code/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248424812,"owners_count":21101238,"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-14T17:09:27.812Z","updated_at":"2025-04-11T14:51:26.572Z","avatar_url":"https://github.com/bitpay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"http://bitcore.io/css/images/module-payment-protocol.png\" alt=\"bitcore payment protocol\" height=\"35\"\u003e\nBIP47 Payment Code support for bitcore\n=======\n\n[![NPM Package](https://img.shields.io/npm/v/bitcore-payment-code.svg?style=flat-square)](https://www.npmjs.org/package/bitcore-payment-code)\n[![Build Status](https://img.shields.io/travis/bitpay/bitcore-payment-code.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/bitpay/bitcore-payment-code)\n[![Coverage Status](https://img.shields.io/coveralls/bitpay/bitcore-payment-code.svg?style=flat-square)](https://coveralls.io/r/bitpay/bitcore-payment-code)\n\nA module for [bitcore](https://github.com/bitpay/bitcore) that implements [Payment Code](https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki)\n\n## Getting Started\n\nThis library is distributed in both the npm and bower packaging systems.\n\n```sh\nnpm install bitcore-payment-code\nbower install bitcore-payment-code\n```\n\n\n\n```javascript\n\n// Generating a Payment code and its notification address for Alice\n\nvar PaymentCode = require('bitcore-payment-code');\n\n// Alice's extended private key: MasterPrivKey\n\nvar xPrivKey = MasterPrivKey.derive(\"m/47'/0'/0'\"); // See BIP47 for details\nvar xPubKey = xPrivKey.hdPublicKey;\n\n\nvar alicePc = new PaymentCode([xPubKey]); // Generate a payment Code\n//also, new PaymentCode([xPubKey0, ..., xPubKeyN], m)  // Multisig M-N\n\nvar serializedPaymentCode = alicePc.toString(); // PaymentCode to share\n\nvar aliceNotificationPubKey = alicePc.publicKey;  \nvar aliceNotificationAddress = aliceNotificationPubKey.toAddress();\n\n\n// Making a payment to Bob\nvar paymentInfo = alice.makePaymentInfo(BobPaymentCode, xPrivKey, index, outpoint);\n\n// Index is the alice-\u003ebob payment order\n// outpoint is where in the transaction the public key will be exposed\n\n// Sample output:\n { \n  publicKeys: [ '023ded791973898f6892cead1b62ba57b9e5dc6c45aeaf0f20813acec96540cec1' ],\n  paymentAddress: '1AJ3gNTaJ96NBDcj4cVmPZVBB7sF9rVA31',\n  notificationOutputs: [ '010003874d18c82ce5fa774d3cefa16129159cc893007015e5791c0e1d1edba8d4fec48654656a77d16a1c25aaf61423c56973f71d526aab8a10fcc6cb65f3f21c403d00000000000000000000000000' ],\n  notificationAddresses: [ '14L2fpcYwQQMmJvVJeewyuvdGfi49HmCZY' ] }\n  }\n\n// Then alice needs to send a notification TX:\n// .from should be a valid UTXO\n\n\n\n// Then the TX should be broadcasted... And the actual payment sent to `paymentInfo.paymentAddress`\n// For future payments, index should be incremented.\n\n\n// ===================================================\n// Bob retrieval of the payment....\n\n\n// When Bob receives a TX on his notification address:\n\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](https://github.com/bitpay/bitcore/blob/master/CONTRIBUTING.md) on the main bitcore repo for information about how to contribute.\n\n## License\n\nCode released under [the MIT license](https://github.com/bitpay/bitcore/blob/master/LICENSE).\n\nCopyright 2015 BitPay, Inc. Bitcore is a trademark maintained by BitPay, Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fbitcore-payment-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitpay%2Fbitcore-payment-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitpay%2Fbitcore-payment-code/lists"}