bitcoin-green / bitg-webwallet

Web wallet for Bitcoin Green
MIT License
0 stars 7 forks source link

Set transaction inputs, outputs from UTXOs #25

Closed gedanziger closed 5 years ago

gedanziger commented 5 years ago

Set transaction inputs as each of the UTXOs from step #24.

For each utxo i in the array transactionUtxos:

Follow this pseudocode:

const rawTransaction= new bitcoin.TransactionBuilder()
for (i = 0 : transactionUtxos.length):
  rawTransaction.addInput(transactionUtxos[i].txId, transactionUtxos[i].vout)

This generates the inputs. For the outputs, do the following:

Compute these amounts:

Represent all amounts in satoshi.

rawTransaction.addOutput('RECEIVE_ADDRESS', `amount`)
rawTransaction.addOutput('MY_ADDRESS', `change`)

Set the receive address to the one entered in the input field, and my address to the users own address.

0xweb3builder commented 5 years ago

@gedanziger Can you post details about FEE?

0xweb3builder commented 5 years ago

minor FEE and fixed fee will be used for all transactions?

0xweb3builder commented 5 years ago

Verified by 0a98add0fa383daba235485af4cc78cfdb813cfd