# @owstack/btc-payment-protocol

> Payment Protocol (BIP70 and related) support for btc.

Latest version **0.0.5** (published 2018-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @owstack/btc-payment-protocol
pnpm add @owstack/btc-payment-protocol
yarn add @owstack/btc-payment-protocol
bun add @owstack/btc-payment-protocol
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2018-07-17 |
| First published | 2017-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 324.8 KB |
| Known vulnerabilities | 0 (+27 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ajp8164, niahmiah |
| Keywords | bitcoin, btc, payment protocol, BIP70 |

## Links

- npm: https://www.npmjs.com/package/@owstack/btc-payment-protocol
- Repository: https://github.com/owstack/btc-payment-protocol
- Homepage: https://github.com/owstack/btc-payment-protocol#readme
- Issues: https://github.com/owstack/btc-payment-protocol/issues
- npm.io page: https://npm.io/package/@owstack/btc-payment-protocol

## Dependencies (8)

- [bs58](https://npm.io/package/bs58.md) ^4.0.1
- [bn.js](https://npm.io/package/bn.js.md) =2.0.4
- [asn1.js](https://npm.io/package/asn1.js.md) =4.9.1
- [jsrsasign](https://npm.io/package/jsrsasign.md) =8.0.4
- [protobufjs](https://npm.io/package/protobufjs.md) =5.0.1
- [asn1.js-rfc3280](https://npm.io/package/asn1.js-rfc3280.md) =4.0.0
- [asn1.js-rfc5280](https://npm.io/package/asn1.js-rfc5280.md) =2.0.0
- [@owstack/btc-lib](https://npm.io/package/@owstack/btc-lib.md) ^0.0.4

## Recent versions

- 0.0.5 (latest) — 2018-07-17
- 0.0.4 — 2017-12-20
- 0.0.3 — 2017-10-30
- 0.0.2 — 2017-10-30
- 0.0.1 — 2017-10-27

## README

Btc Payment Protocol
=======

[![NPM Package](https://img.shields.io/npm/v/btc-payment-protocol.svg?style=flat-square)](https://www.npmjs.org/package/btc-payment-protocol)
[![Build Status](https://img.shields.io/travis/owstack/btc-payment-protocol.svg?branch=master&style=flat-square)](https://travis-ci.org/owstack/btc-payment-protocol)
[![Coverage Status](https://img.shields.io/coveralls/owstack/btc-payment-protocol.svg?style=flat-square)](https://coveralls.io/r/owstack/btc-payment-protocol)

A module for [btc](https://github.com/owstack/btc) that implements [Payment Protocol](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) and other related BIPs.

## Attribution

This repository was created by copy forking [bitcore-payment-protocol commit b086fc6](https://github.com/bitpay/bitcore-payment-protocol/commit/b086fc64ff8e19230ff4352ef0af9af2837bcc46).

## Getting Started

This library is distributed in both the npm and bower packaging systems.

```sh
npm install btc-lib
npm install btc-payment-protocol
```

```sh
bower install btc-lib
bower install btc-payment-protocol
```

There are many examples of how to use it on the developer guide [section for payment protocol](https://btc.io/api/paypro). For example, the following code would verify a payment request:

```javascript
var PaymentProtocol = require('@owstack/btc-payment-protocol');

var body = PaymentProtocol.PaymentRequest.decode(rawbody);
var request = new PaymentProtocol().makePaymentRequest(body);

var version = pr.get('payment_details_version');
var pki_type = pr.get('pki_type');
var pki_data = pr.get('pki_data');
var serializedDetails = pr.get('serialized_payment_details');
var signature = pr.get('signature');

// Verify the signature
var verified = request.verify();
```

## Contributing

See [CONTRIBUTING.md](https://github.com/owstack/btc-lib/blob/master/CONTRIBUTING.md) on the main btc-lib repo for information about how to contribute.

## License

Code released under [the MIT license](https://github.com/owstack/btc-lib/blob/master/LICENSE).

Copyright 2017 Open Wallet Stack.

---
_Source: https://npm.io/package/@owstack/btc-payment-protocol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
