opoll / opollminer

Official mining application for OpenPoll Platform
1 stars 0 forks source link

Assess Transaction Fees #65

Open zack-w opened 6 years ago

zack-w commented 6 years ago

Create a function to assess the fee of any given transaction. All transaction fees will use the following formula in the MVP Release:

txn.fee = txn.amount * 0.01

When a mainchain block is being mined, the last transaction should contain the entire reward the miner receives.

When an updated ledger is being created from a mainchain block, the miner should...

  1. calculate the transaction fee for each transaction
  2. credit the recipient with only the amount minus the transaction fee
  3. ensure the miner's amount adds up to all the transaction fees

If any of the checks 1-3 above fail, the block should fail and not be accepted.

{
    senderAddress: “000000000… 64 times”,
    recieverAddress: {MINER ADDRESS},
    timestamp: {TIMESTAMP OF MAINCHAIN}
    amount: {TOTAL OF ALL FEES},
    signature: “000000000… 1024 times”
}
gitsomedev commented 6 years ago

Completed