Bitcoin Forum
December 12, 2017, 02:38:29 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Specifying transaction fee with omnicored  (Read 481 times)
JollyTrades
Hero Member
*****
Offline Offline

Activity: 560



View Profile
July 07, 2017, 04:48:29 PM
 #1

Hi all,

I am unable to find a way to specify the transaction fee myself. Any help is appreciated.

https://github.com/OmniLayer/omnicore/blob/master/src/omnicore/doc/rpc-api.md

Thanks,

Jian
1513046309
Hero Member
*
Offline Offline

Posts: 1513046309

View Profile Personal Message (Offline)

Ignore
1513046309
Reply with quote  #2

1513046309
Report to moderator
1513046309
Hero Member
*
Offline Offline

Posts: 1513046309

View Profile Personal Message (Offline)

Ignore
1513046309
Reply with quote  #2

1513046309
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
HCP
Sr. Member
****
Offline Offline

Activity: 448

<insert witty quote here>


View Profile
July 07, 2017, 11:31:54 PM
 #2

With Bitcoin, you technically don't directly specify the fee as such... You specify the inputs and outputs and the fee is just the difference between total inputs and total outputs. That is to say:

Transaction Fee = Total Inputs - Total Outputs.

Quote from: createrawtransaction()
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime )

Create a transaction spending the given inputs and creating new outputs.
Outputs can be addresses or data.
Returns hex-encoded raw transaction.
Note that the transaction's inputs are not signed, and
it is not stored in the wallet or transmitted to the network.

Arguments:
1. "inputs"                (array, required) A json array of json objects
     [
       {
         "txid":"id",    (string, required) The transaction id
         "vout":n,         (numeric, required) The output number
         "sequence":n      (numeric, optional) The sequence number
       }
       ,...
     ]
2. "outputs"               (object, required) a json object with outputs
    {
      "address": x.xxx,    (numeric or string, required) The key is the bitcoin address, the numeric value (can be string) is the BTC amount
      "data": "hex"      (string, required) The key is "data", the value is hex encoded data
      ,...
    }
3. locktime                  (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs

Result:
"transaction"              (string) hex string of the transaction

Most wallets calculate the fee (or let the user specify the fee) and then just adjust the "change" output such that the difference between inputs and outputs equals the calculated fee. NOTE: this may mean adding additional inputs to cover the fee and/or making the change = 0 and not having a "change" output.

Not sure how this works with the Omni Core Fork tho... given that it is a fork of Bitcoin Core, I would assume it works the same way...

JollyTrades
Hero Member
*****
Offline Offline

Activity: 560



View Profile
July 08, 2017, 10:39:09 AM
 #3

@HCP,

Thank you very much!

Best,

Jian
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!