Bitcoin contract fee interest

①How to calculate the transaction fee of Bitcoin China’s trading platform

For example, EASYBTC, ordinary users do not need any fees for buying and selling. That is, some advertisers need to spend money, so you might as well register to experience it.

②How is the funding fee of okex bitcoin perpetual contract calculated

funding fee = position value * funding rate, when the funding rate is positive When counting, longs pay shorts; when the funding rate is negative, shorts pay longs, understand?

③ Does the plus or minus of the bitcoin contract include handling fees?

When people promote bitcoin, they often say: “You can transfer money to all kinds of Zhang San and Li Si for free. “In fact, not necessarily, sometimes there is a fee.

In 2013, the price of one bitcoin was $20. In 2017, it cost $20 to transfer one bitcoin.
The purpose of the handling fee is to encourage miners to keep mining, and secondly to maintain the security of the Bitcoin network (stability maintenance fee?). The basic salary of early miners is relatively high, 50 BTC per block, but after the genesis block, the basic salary is halved for every 210,000 blocks (every four years). After all 21 million bitcoins have been mined, transaction fees act as mining rewards.

The code for the halving algorithm looks like this.

CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
{
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return 0;

CAmount nSubsidy = 50 * COIN;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy;
}
The reward was halved from 50 bitcoins in 2012 25 bitcoins, halved from 25 bitcoins to 12.5b bitcoins in 2016. It will be halved to 6.25 bitcoins in about 2020.

So, how do you determine when you need to pay transaction fees and how much is appropriate?

Bitcoin network rules have a built-in transaction fee structure that depends on the (standard) client side recommended by the system. Let’s take bitcoin core as an example, and see how many steps are required when transferring money:

1. What coins are spent?

The client first determines which coins to use to complete the payment.

For example, Bob transfers 2 bitcoins to Alice; Rose transfers 3 bitcoins to Alice, then the two transfer amounts will lie in Alice’s wallet separately until they are spent. . (Note: two transfers will not be “auto-merged” to 5BTC).

So, after a while, different amounts of Bitcoin will accumulate in the wallet, so I said, you have to consider which ones to use for payment.

The available amount is called the “input” of the transaction, and the final amount sent (including the change back to the wallet) is called the “output”.

2. Avoid overly fragmented payments

If the transaction “output” (including change) is less than 0.01BTC, a handling fee of 0.0001BTC will be charged. When “selection of coins”, the algorithm will try to avoid those coins whose change amount is less than 0.01BTC.

3. Priority for old coins and large-value transactions

If the amount of bitcoin sent is too small, or the coin age is too low, it is likely to be charged. Each transaction has a priority, determined by the age of the “input”, the amount, and the number of transaction inputs.

Specifically, the client multiplies the amount of each input by the time the input exists in the block, adds all the multiplication results, and divides it by the transaction byte size.

If the result is less than 0.576, a transaction fee will be charged. So, if you have a bunch of fragmentary and/or very new “inputs”, and you don’t want to pay the fees, you can do it by adding a large and older input to the transaction. Here, what is more critical is the average value of this amount x age.

If a transaction was originally charged in step 3, but as time passes, new blocks are continuously generated, then the “input” age in the original transaction also increases, and further The priority of the transaction has been increased, so the fee incurred in step 3 may be waived.

4. “Weighing” charges (charged per kilobyte)

Finally, the client checks the byte length of the transaction. The length depends on the number of inputs and outputs, and can be roughly calculated by the following formula:

148 * number of inputs + 34 * number of outputs + 10

If the length is less than 10000 bytes and in If there is a high enough priority in step 3, then this transaction is finally confirmed as free, otherwise it will be charged, and the default fee is 0.0001BTC/kilobyte (if it is less than 1k, it will be calculated as 1k). You can change the transaction fee amount in the client-side related settings. Settings below 0.0001BTC will not take effect. Step 2 will be overridden once the new fee settings take effect.� costs, the two do not stack.

Let’s talk about a few examples:

1. It’s too late

Said: Alice has two “inputs” in her wallet, the amount is 1BTC and 2BTC. Then Alice wants to buy a cup of coffee for 2.99999BTC. At this time, there is no such thing as choosing coins, because there are only two inputs, and both of them are enough for coffee money, and the remaining 0.00001BTC is used for change. Note that step 2 mentioned: If the transaction “output” (including change) is less than 0.01BTC, a handling fee of 0.0001BTC will be charged. Note, coffee transactions will be charged a handling fee of 0.0001BTC. The result is that the transaction fails because Alice does not have enough balance in her hand.

This is interesting: Alice has 3BTC in hand, but cannot buy 2.99999BTC of coffee. Alice can pay the merchant all 3BTC to avoid the fee (assuming the fee in step 3 is 0), but some merchants may ask for the exact amount.

2. Personality outbreak

Said: Alice’s personality broke out. In a gambling game with odds of 64000, she used 0.02BTC to dial 1280BTC. When the website paid the bonus, I didn’t have the 1280BTC in my wallet, so I could only use various pieces of input (including change) to make up.

Finally, the size of the bonus is 51203 bytes. That’s right, if the transaction size exceeds 10,000 bytes, the fee increases to 0.0005BTC/kbyte (in fact, the transaction fee in the early stage was 0.0005, and later became 0.0001), then the fee here is 52*0.0005 = 0.026BTC. Higher than the player’s book.

Of course, it’s still cheaper than PayPal.

Note: The handling fee for using Paypal is 4.4% + 0.3 USD per transaction.

For example, 1280 dollars transfer, 1280*4.4% + 0.3 = 56.62 dollars

Note: The final fee paid is 0.0286BTC, which may be because it is not used (recommended ) standard client to create transactions, then this client has a little problem calculating fees.

This is a real thing, see: Bitcoin Transaction

3. The agency does all the calculations and does not pay for it

There is a kind of transaction that is free On the edge of the cliff, with a size of 9999 bytes, it is called the king of transaction fee dodge. Only one of the total inputs is 1 satoshi (the smallest unit of Bitcoin, 0.000 000 01 BTC = 1 satoshi, in tribute to Bitcoin founder Satoshi Nakamoto); but there is another large input that raises the priority and exempts transactions cost.

Do I have to pay a handling fee?

By the way, the handling fee is not mandatory. Some miners don’t pay much attention to these fees and will record some transactions without fees in the block. Transactions with lower fees than standard fees can be created using the “raw transactions” interface of the standard client, and there is still a chance that a burst of character can be packaged into blocks by miners.

④ How is the Bitcoin contract income calculated?

Twenty times the full position contract is equivalent to buying 2,000 yuan of bitcoin with 100 yuan, an increase of ten One point your income is 200 yuan (+100), the next day your account is 300 yuan, continue to fill the position 20 times and then increase ten points, your income is 600 yuan (+300), and so on,
But if it falls by 5 points, your principal will be gone, commonly known as liquidation.

⑤ What is the transaction rate of Bitcoin

OKEx Bitcoin exchange has the lowest handling fee in the world, 0.15%-0.02%, and And the platform currency OKB does not charge any fees.

In Bybit, for each successful order, the Bybit platform will automatically decide to charge fees or provide rewards according to the order attributes. For the “market maker” of the market: for each successful limit order, the system will give a reward of 0.025% based on the contract value.

For the “takers” of the market: For each successful market order, the system will charge a fee of 0.075% of the contract value based on the contract value. A $5 bitcoin transaction might have the same fee as a $5,000 bitcoin transaction.

They are measured in “satoshis per byte of data”.

⑥Bitcoin handling fee

Bitcoin transaction fees are generally between 0.0001-0.0005BTC. Of course, the amount accepted by each miner and miner association is different. Sometimes, there is no fee for large bitcoin transactions, such as more than 100BTC. If the small transaction is less than 0.01BTC, a certain amount of handling fee will be charged. Of course, some Bitcoin clients can set the Bitcoin transaction fee. If you set the transaction fee very low, the transaction confirmation time will be very long.
First of all, it should be understood that this fee is rewarded to miners to encourage miners to continue mining to provide enough computing power for Bitcoin to ensure the security of the Bitcoin network. At present, the main income of miners is to obtain BTC rewards by creating new blocks, but this reward decreases every 4 yearsHalf, Bitcoin transaction fees will gradually replace Bitcoin rewards over time.
When do I need to pay the handling fee? What is the amount?

The Bitcoin system has a series of network rules, including fee rules, which are also “what the client should do”. When you use a Bitcoin client (wallet, Bitcoin-Qt) to send bitcoins, the whole process is roughly divided into the following steps:

1. Prepare the bitcoins you want to send

The client is responsible for collecting the bitcoin balance in your wallet (Bitcoin-Qt) in preparation for payment, because every bitcoin you receive is stored in your wallet until you spend them.

If you withdraw 3BTC and 2BTC twice at OKCoin, their records in your wallet are independent of each other, that is, one 3BTC and one 2BTC, instead of being combined into 5BTC (the wallet only records transaction details, The balance is not merged, but you can see the total balance on the wallet interface). Over time, your wallet will accumulate a lot of Bitcoins of varying amounts. It is conceivable that in the OKCoin Bitcoin wallet There must be thousands of such records. So when you send bitcoins the wallet has to decide which of the above records is best for this send.

The bitcoins you get in a transaction are called “inputs”, the bitcoins you spend are called “outputs”, and there are multiple inputs and outputs in your wallet .

2. Prevent a large number of micro (st) payments from impacting the network

If you deposit less than 0.01BTC (including changes in funds in your wallet) to the OKCoin bitcoin exchange , you have to pay a handling fee of 0.0001. The wallet has an established rule when preparing your payment amount, that is, when preparing the payment amount among many inputs, try to avoid any change in the amount less than 0.01BTC (for example, if you want to recharge OKCoin Bitcoin with 5.005BTC, the wallet Choose 3+2.005 or 1+1+3.005 whenever possible, not 5+0.005).

3. The larger the amount, the higher the age of the coin, the higher the priority

If you send a small amount or your bitcoins have just been mined, Then your transfers are no longer free. Each transaction is assigned a priority based on how old the coin is, the number of bytes in the transaction, and the number of transactions. Specifically, for each input (inputs), the client will first multiply the number of bitcoins by the time these coins have been in the block (age), and then add up all the products and divide by this The size of the transaction (in bytes). The calculation formula is: priority = sum(input_value_in_base_units * input_age)/size_in_bytes. If the calculation result is less than 0.576, then the transaction must pay a handling fee. This is also the reason why you need to add 0.0001 when you withdraw Bitcoin in OKCoin, because Bitcoin transfers in the OKCoin wallet are frequent, and the time of Bitcoin in the block is relatively short, so you need to pay a handling fee. If you do have a large number of small inputs, such as small miners, and want to transfer for free, you can add a large amount of bitcoins with a large age, which will increase the average priority, so that you can transfer for free. out bitcoin.

4. Charges per kilobyte

At the end of the transfer, the client will calculate the size of the transfer (in bytes), and the size generally depends on the input and the output amount, the calculation formula is as follows: 148 × input amount + 34 × output amount + 10, if the size of the transfer exceeds 10,000 bytes but the priority meets the free standard, then you can still enjoy free transfer, otherwise you need to pay handling fee. The fee per 1000 bytes is 0.0001BTC by default, but you can also add it in the client, open the tab “Settings > Options > Main” in turn to adjust the fee. If the handling fee you are setting is less than 0.0001BTC, it will be calculated as 0.0001. When this rule applies, it will supersede the rule of step 2 and not accumulate.

0

Related Ad

Comments (No)

Leave a Reply