Bitcoin Forum
June 14, 2024, 09:02:18 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Urgent help required in configuring bitcoin core in Ubuntu  (Read 985 times)
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 12, 2017, 10:21:44 PM
 #1

Hi,

I have installed Bitcon core using PPA on ubuntu.  But the fees charged by it is really more.  To send 200000 satoshi it charges 180000 satoshis.. I have no clue where to change that.  Where do i configure the fees in the bitcoin core in ubuntu. Please tell me the command i should run on ubuntu and also suggest me the right value i should configure.  In localbitcoins and coinsecure they charge around 20 to 30k satoshis per transaction. Can i setup like that. Please help me...
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3430
Merit: 6704


Just writing some code


View Profile WWW
July 12, 2017, 11:23:04 PM
 #2

The transaction fee is not based upon the value that you are transacting, but rather on the size of the transaction in bytes. The size of the transaction in bytes is determined by the number of inputs you are spending and the number of outputs. If you have many small inputs, your transaction will be larger and thus you will be paying a higher transaction fee.

You can choose the transaction fee rate that Bitcoin Core uses from the GUI. Just click the "Choose" button next to the where it says "Transaction Fee" at the bottom of the send window.

IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 12, 2017, 11:26:23 PM
 #3

The transaction fee is not based upon the value that you are transacting, but rather on the size of the transaction in bytes. The size of the transaction in bytes is determined by the number of inputs you are spending and the number of outputs. If you have many small inputs, your transaction will be larger and thus you will be paying a higher transaction fee.

You can choose the transaction fee rate that Bitcoin Core uses from the GUI. Just click the "Choose" button next to the where it says "Transaction Fee" at the bottom of the send window.

I am working on a casino project and i have integrated bitcoin core rpc to the php script.  There will be a lot of deposits and withdrawals by the players. If the fees are huge, players won't come to my site. I see many sites charge only 20,000 satoshis as the fees.

Is it possible for me too to setup the fees like 20,000 satoshis.  If yes how do i set up.  In my case ill not be in a position to use the GUI version. Please help me
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3430
Merit: 6704


Just writing some code


View Profile WWW
July 13, 2017, 12:00:26 AM
 #4

I am working on a casino project and i have integrated bitcoin core rpc to the php script.  There will be a lot of deposits and withdrawals by the players. If the fees are huge, players won't come to my site. I see many sites charge only 20,000 satoshis as the fees.

Is it possible for me too to setup the fees like 20,000 satoshis.  If yes how do i set up.  In my case ill not be in a position to use the GUI version. Please help me
Likewise if your fees are too small then players won't come to your site since they won't get their money withdrawn quickly.

Do not use fixed fees. That will likely result in your transactions remaining unconfirmed for a long time. When that happens, you will likely also end up spending from those unconfirmed transactions and make long chains of unconfirmed transactions. When that happens, you will end up making it impossible for anyone to actually get their money off of your service since it is all tied up in long chains of unconfirmed transactions.

If you really do not want to use a dynamic fee rate which will almost always has you pay a sufficient fee for your transactions to actually confirm, you can set a fixed fee rate using the settxfee RPC command. This command allows you to set a fee rate in BTC/kB and your transactions will use that fee rate.

Also, to avoid paying a lot in fees and making a lot of transactions spamming up the network, you should batch your transactions. That means that instead of making one transaction for each withdrawal that a person makes, you instead periodically, say, once an hour, make one large transaction with all of the withdrawals that have been made since the last batch transaction. This allows you to reduce the number of long unconfirmed transaction chains, reduce the number of small change outputs that you need to make, and ultimately reduce the transaction fees that you are paying.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
July 13, 2017, 03:32:16 AM
 #5

You should also seriously consider implementing a "minimum deposit" system. A lot of the bitcoin casinos do this for exactly the reason that achow101 mentioned earlier:
If you have many small inputs, your transaction will be larger and thus you will be paying a higher transaction fee.

By implementing a minimum deposit of say 0.001 you can help avoid people filling your deposit wallets with dust inputs and driving up your transaction fees. It will also discourage people trying to use their deposit accounts receiving "cloud mining" payments etc so they can "consolidate" their payments into larger UTXOs at your expense.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 13, 2017, 08:35:13 AM
 #6

I am working on a casino project and i have integrated bitcoin core rpc to the php script.  There will be a lot of deposits and withdrawals by the players. If the fees are huge, players won't come to my site. I see many sites charge only 20,000 satoshis as the fees.

Is it possible for me too to setup the fees like 20,000 satoshis.  If yes how do i set up.  In my case ill not be in a position to use the GUI version. Please help me
Likewise if your fees are too small then players won't come to your site since they won't get their money withdrawn quickly.

Do not use fixed fees. That will likely result in your transactions remaining unconfirmed for a long time. When that happens, you will likely also end up spending from those unconfirmed transactions and make long chains of unconfirmed transactions. When that happens, you will end up making it impossible for anyone to actually get their money off of your service since it is all tied up in long chains of unconfirmed transactions.

If you really do not want to use a dynamic fee rate which will almost always has you pay a sufficient fee for your transactions to actually confirm, you can set a fixed fee rate using the settxfee RPC command. This command allows you to set a fee rate in BTC/kB and your transactions will use that fee rate.

Also, to avoid paying a lot in fees and making a lot of transactions spamming up the network, you should batch your transactions. That means that instead of making one transaction for each withdrawal that a person makes, you instead periodically, say, once an hour, make one large transaction with all of the withdrawals that have been made since the last batch transaction. This allows you to reduce the number of long unconfirmed transaction chains, reduce the number of small change outputs that you need to make, and ultimately reduce the transaction fees that you are paying.

Yeah i understand that the lower transaction fees will make the transactions confirmation very slower. But at the same time, if the fees is more client may lose interest right.  Other big sites like bitsler and crypto-games charge only around 20,000 to 40,000 Satoshi as the transaction fee. In my case, the default bitcoin core charges fat fees.

Let me test run with settxfee first and check. If i find it is very slow, then ill try to optimize it.

So what command should i run on ubuntu to set up the fixed transaction fee. 

bitcoin-cli settxfee 300

Is the above command correct? 

In this case will it charge 300 Satoshi per KB? Is it enough if i run that command only once?

Batch transaction is interesting. Please guide me the step by step to configure the batch transactions so that it will be processed once in an hour. 

I am new to all these. I am learning things gradually.  Hence i am asking very basic questions. Kindly help me..


IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 13, 2017, 08:36:38 AM
 #7

You should also seriously consider implementing a "minimum deposit" system. A lot of the bitcoin casinos do this for exactly the reason that achow101 mentioned earlier:
If you have many small inputs, your transaction will be larger and thus you will be paying a higher transaction fee.

By implementing a minimum deposit of say 0.001 you can help avoid people filling your deposit wallets with dust inputs and driving up your transaction fees. It will also discourage people trying to use their deposit accounts receiving "cloud mining" payments etc so they can "consolidate" their payments into larger UTXOs at your expense.

thanks for your advice. ill try implementing this...
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 13, 2017, 08:10:02 PM
 #8

any one please help me
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
July 13, 2017, 09:25:54 PM
 #9


bitcoin-cli settxfee 300

Is the above command correct?  

In this case will it charge 300 Satoshi per KB? Is it enough if i run that command only once?

Uh, the documentation says that's BTC per KB so I'm thinking that 300BTC is a little bit too high (although I'm certain your transactions will confirm very quickly).

You should take a look at the configuration options for your bitcoin.conf file if you want to use the same configuration everytime bitcoind starts (your host may reboot, etc).  See here:

See here:

https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File

It looks like the configuration file version of this setting is 'paytxfee'.  You may also want to look at maxtxfee and mintxfee.  This is the help for settxfee:

Code:
$ bitcoin-cli help settxfee
settxfee amount

Set the transaction fee per kB. Overwrites the paytxfee parameter.

Arguments:
1. amount         (numeric or string, required) The transaction fee in BTC/kB

Result
true|false        (boolean) Returns true if successful

Examples:
> bitcoin-cli settxfee 0.00001
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "settxfee", "params": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 13, 2017, 10:20:27 PM
 #10


bitcoin-cli settxfee 300

Is the above command correct?  

In this case will it charge 300 Satoshi per KB? Is it enough if i run that command only once?

Uh, the documentation says that's BTC per KB so I'm thinking that 300BTC is a little bit too high (although I'm certain your transactions will confirm very quickly).

You should take a look at the configuration options for your bitcoin.conf file if you want to use the same configuration everytime bitcoind starts (your host may reboot, etc).  See here:

See here:

https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File

It looks like the configuration file version of this setting is 'paytxfee'.  You may also want to look at maxtxfee and mintxfee.  This is the help for settxfee:

Code:
$ bitcoin-cli help settxfee
settxfee amount

Set the transaction fee per kB. Overwrites the paytxfee parameter.

Arguments:
1. amount         (numeric or string, required) The transaction fee in BTC/kB

Result
true|false        (boolean) Returns true if successful

Examples:
> bitcoin-cli settxfee 0.00001
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "settxfee", "params": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

So i understand that "paytxfee" has to be configured in the config file.  After doing that, if i run the command "settxfee amount" it will overwrite the paytxfee. Please confirm if my understanding is correct?

If my understanding is right, i should not run the command settxfee?

How much satoshi do you suggest to configure in the paytxfee for a reasonable quick transaction.  I see big sites charge around 20,000 satoshi to 30,000 satoshi as the transaction fees.  I too want to charge similar.  Please tell me the right value to set up the settxfee..

what values do you suggest for a min and max fee?  so if i set up min a max fee, i need not setup paytx fee right? please clarify...
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
July 14, 2017, 12:01:03 AM
 #11

I think what you might be missing is that some of the big sites that "only" charge 20K-30K sats for withdraws... will do so in a "batch transaction". So, for example, you get 10 users all decide to withdraw in a given hour... you charge them all 20K sats... then you bundle up all their requests into one transaction and set the fee as required to try and achieve the confirmation time you require. This gives you 200K sats to play with as a "total" fee... but you can reduce your total transaction size by quite a bit... from 2260 bytes (~226 bytes * 10 transactions) down to as low as 532 bytes (1x 148 byte input + 11x 34 byte outputs + 10 byte fixed)...

so instead of having 10 transactions with 88 sats/byte fees (20K / 226 bytes), you could have one transaction with 375 sats/byte fees (200K / 532)... or do what most of the sites do and set the fee to something lower say 200 sats/byte and pocket the rest as 'profit' without most of the users even noticing  Shocked Lips sealed

As for the actual values you should be using for fees... those goal posts are constantly moving... right now, the number of unconfirmed transactions is averaging somewhere near 5K... last month it was like 150K!! Similiarly, with fees... now you can get transactions with fees of 0.00025 BTC/kB (25 sats/byte) confirmed in a couple of hours... last month you were lucky if 0.0025 BTC/kB (or 250 sats/Byte) would confirm in less than a day!


█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 14, 2017, 11:44:47 AM
 #12

I think what you might be missing is that some of the big sites that "only" charge 20K-30K sats for withdraws... will do so in a "batch transaction". So, for example, you get 10 users all decide to withdraw in a given hour... you charge them all 20K sats... then you bundle up all their requests into one transaction and set the fee as required to try and achieve the confirmation time you require. This gives you 200K sats to play with as a "total" fee... but you can reduce your total transaction size by quite a bit... from 2260 bytes (~226 bytes * 10 transactions) down to as low as 532 bytes (1x 148 byte input + 11x 34 byte outputs + 10 byte fixed)...

so instead of having 10 transactions with 88 sats/byte fees (20K / 226 bytes), you could have one transaction with 375 sats/byte fees (200K / 532)... or do what most of the sites do and set the fee to something lower say 200 sats/byte and pocket the rest as 'profit' without most of the users even noticing  Shocked Lips sealed

As for the actual values you should be using for fees... those goal posts are constantly moving... right now, the number of unconfirmed transactions is averaging somewhere near 5K... last month it was like 150K!! Similiarly, with fees... now you can get transactions with fees of 0.00025 BTC/kB (25 sats/byte) confirmed in a couple of hours... last month you were lucky if 0.0025 BTC/kB (or 250 sats/Byte) would confirm in less than a day!



thanks for the detailed explanation brother.  But please guide me how to do the batch transactions?  Should i write that code in php or i have to do that on the server where bitcoin is installed?  Please guide me in detail.  I am in the learning stage..
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
July 14, 2017, 01:55:06 PM
 #13

It seems like if your existing solution doesn't already provide some functionality to batch your transactions, then yes you're going to have to write some code to accomplish it.

Write code which does this:

A user wishes to withdrawl n Satoshis from her balance on your site, You make sure her account has enough to cover the withdrawal + some fee.  You put this information into a queue.

Write other code which does this:

Check the queue to see if you've got sufficient withdrawal to process, or that some max time has passed. If yes, create a bitcoin transaction which pays out the proper amounts to all of the addresses in the transaction queue.

What part is unclear?  I don't expect anyone will write this for you, although it's possible that code already exists for this and someone here might be able to point you to it.



In terms of whether your webserver or your bitcoin server does this work, I could see it going either way:  In one scenario your webserver is just storing the queue and then using bitcoinrpc to build and send the batch transaction.  In the other scenario, you have some secure way to communicate with a script on your bitcoin server and the queue is built up on that computer.  You could use crond to run your processing job every hour.
IGCGamers (OP)
Sr. Member
****
Offline Offline

Activity: 555
Merit: 251


View Profile
July 14, 2017, 07:07:52 PM
 #14

It seems like if your existing solution doesn't already provide some functionality to batch your transactions, then yes you're going to have to write some code to accomplish it.

Write code which does this:

A user wishes to withdrawl n Satoshis from her balance on your site, You make sure her account has enough to cover the withdrawal + some fee.  You put this information into a queue.

Write other code which does this:

Check the queue to see if you've got sufficient withdrawal to process, or that some max time has passed. If yes, create a bitcoin transaction which pays out the proper amounts to all of the addresses in the transaction queue.

What part is unclear?  I don't expect anyone will write this for you, although it's possible that code already exists for this and someone here might be able to point you to it.



In terms of whether your webserver or your bitcoin server does this work, I could see it going either way:  In one scenario your webserver is just storing the queue and then using bitcoinrpc to build and send the batch transaction.  In the other scenario, you have some secure way to communicate with a script on your bitcoin server and the queue is built up on that computer.  You could use crond to run your processing job every hour.

Thanks for your detailed explanation brother. Hope some one here points out the already existing code for that.

Apart from that, i have another question:

How much satoshi do you suggest to configure in the paytxfee for a reasonable quick transaction?  How many kb may be required to process a single transaction (approx)?

what values do you suggest for a min and max fee?  so if i set up min a max fee, i need not setup paytx fee right? please clarify...
ranochigo
Legendary
*
Offline Offline

Activity: 2982
Merit: 4193



View Profile
July 15, 2017, 02:09:33 AM
 #15

By implementing a minimum deposit of say 0.001 you can help avoid people filling your deposit wallets with dust inputs and driving up your transaction fees. It will also discourage people trying to use their deposit accounts receiving "cloud mining" payments etc so they can "consolidate" their payments into larger UTXOs at your expense.
A good system is also to charge a fee of ~0.0003 for each deposit they make. Localbitcoin implements this.
Apart from that, i have another question:

How much satoshi do you suggest to configure in the paytxfee for a reasonable quick transaction?  How many kb may be required to process a single transaction (approx)?

what values do you suggest for a min and max fee?  so if i set up min a max fee, i need not setup paytx fee right? please clarify...
It depends on the current state of the network, usually you can set the fee as 0.002BTC/KB and have it confirmed within an hour. Of course, this isn't true for all the time. It is way better to setup txconfirmtarget=4 and have the client estimate a reasonable fee for it to be confirmed within 4 blocks.

The min and max fee are just boundaries set so your client will never go below the minimum fee and the maximum fee you've set.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
bet101
Full Member
***
Offline Offline

Activity: 266
Merit: 100


View Profile
July 15, 2017, 03:20:18 AM
 #16

You should also seriously consider implementing a "minimum deposit" system. A lot of the bitcoin casinos do this for exactly the reason that achow101 mentioned earlier:
If you have many small inputs, your transaction will be larger and thus you will be paying a higher transaction fee.

By implementing a minimum deposit of say 0.001 you can help avoid people filling your deposit wallets with dust inputs and driving up your transaction fees. It will also discourage people trying to use their deposit accounts receiving "cloud mining" payments etc so they can "consolidate" their payments into larger UTXOs at your expense.
The deposit is a very good point.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!