Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiagolr/bchandshake
https://github.com/tiagolr/bchandshake
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tiagolr/bchandshake
- Owner: tiagolr
- Created: 2019-12-16T18:14:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T19:21:47.000Z (about 2 years ago)
- Last Synced: 2023-03-27T08:50:20.855Z (almost 2 years ago)
- Language: JavaScript
- Size: 1.1 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bcevents
Establish a shared secret between two parties over the blockchain using ECDH (Elliptic-curve Diffie–Hellman).
## Install
```
npm install bchandshake datapay bsv
```## Get Started
```js
// client
var Handshake = require('bchandshake')
var handshake = new Handshake({ pkey: 'privkey for tx fees' })
const res = await handshake.request()
console.log(res.sharedKey) // e4f56533a941d809.....// oracle
var handshake = new Handshake({ pkey: 'privkey for tx fees' })
handshake.onRequest(req => {
req.accept() // completes the handshake
console.log(req.sharedKey) // 'e4f56533a941d809.....
})
```## Protocol
## Examples
### Encrypted ping-pong
// complete ping-pong example (use custom genKey, regenerate keys after each message)