0.1.0 • Published 5 years ago

bitpush v0.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

Bitpush

A simple Bitcoin transaction broadcast microservice

Bitpush is compatible with Bitpay insight endpoints for broadcasting transactions, but with a twist:

  1. It's powered by Datapay
  2. You can send either a signed or an unsigned transaction.
  3. Most Important If you send an unsigned transaction, the microservice has the option to sign with its OWN private key and broadcast.

Two Modes of Bitpush

There are two modes of usage:

  1. Signed: This is just a typical transaction broadcast service. You post a signed transaction string, and the service broadcasts it for you.
  2. Unsigned: This is a unique approach to transaction braodcast. The user does NOT pay for the transaction. Instead the user sends an unsigned raw transaction to the service, and the service signs with its OWN key and broadcasts it. This can be used for various subsidized Bitcoin services.

Setup

Step 1. Download

git clone https://github.com/unwriter/bitpush.git

Step 2. Start

npm start

Step 3. Setup .env

Open .env file in the root folder and store your private keys (as many as you want);

PRIVATE_KEY1=...
PRIVATE_KEY2=...
PRIVATE_KEY3=...
PRIVATE_KEY4=...

Bitpush will shuffle through each key to send transactions out whenever it gets a request.

Step 4. More configuration

You can additionally set the .env file keys to configure the Bitcoin RPC settings:

  • rpc_user: Bitcoin JSON-RPC username (default: 'root')
  • rpc_pass: Bitcoin JSON-RPC password (default: 'bitcoin')
  • host: Bitcoin JSON-RPC host IP (default: your ip)

Usage

The microservice only has a single endpoint (for now).

POST /tx/send

You can pass a JSON object to this endpoint. The supported attributes are:

  • rawtx: raw transaction string
  • signed: true if signed, false (or exclude) if unsigned.

If unsigned, this assumes that the microservice itself will sign the transaction and broadcast for the user, thereby making the transaction FREE for the end-user.

You can try sending your transaction to the endpoint like this:

curl -X POST https://bitpush.bitdb.network/tx/send -H "Content-Type: application/json" -d '{"signed": true, "rawtx": "[SIGNED_TRANSACTION_STRNG]"}'

Free Public Nodes

Feel free to add yours here if you run a node.

Signed Mode

  1. https://bitpush.bitdb.network/tx/send

Unsigned Mode

TBD

0.1.0

5 years ago