This server is intended to send raw transaction into Blockchain by turns.
❓ How you can sign new transaction without confirming the last?
🤔 So, new output of your address haven't confirmed yet. What you can do?
✅ Generate first signed transaction
✅ Artificially generate outputs of second transaction
- Get used output amount from first transaction
- This amount minus send sum minus miner fee will be you new output amount
- Generate tx id of first signed transaction
3.1.Let's say that signed data of this tx is S
3.2.Future tx id of this transaction will sha256(sha256(S)).reverse() - Get another meta information and push it into second tx output
- Sign second transaction
✅ Wait while first transaction will be confirmed
✅ Send second signed transaction into Blockchain
npm i
node server.js
or
sudo docker build -t listener .
sudo docker run -p 3003:3003 listener
- URL
/utxo_tx
- Method
POST
- Body Params
type: Object
{
currency: {String} "BTC" or "BCH" or "LTC"
network: {String} - "testnet" or "livenet"
senderAddress: {String} - Sender address
signedTransactions: {Array} - Array of signed transactions
}
- Response
{error: null|Error, result: 'success'|null}
Using lighty-sig library you can easy sign several transactions and push it into blockchain using this server.
Look at signTransaction
method into lighty-sig library. (the last argument should be "1")