From 23570574ffe945e836b503cea3f8ebc4a32895a8 Mon Sep 17 00:00:00 2001 From: Dagur Valberg Johannsson Date: Tue, 26 Jun 2018 00:10:32 +0200 Subject: [PATCH] Add an article about free transactions --- _i18n/en.yml | 6 +- doc/freetransactions.html | 124 ++++++++++++++++++++++++++++++++++++++ doc/index.html | 21 ++++--- doc/txinout.png | Bin 0 -> 5082 bytes 4 files changed, 140 insertions(+), 11 deletions(-) create mode 100644 doc/freetransactions.html create mode 100644 doc/txinout.png diff --git a/_i18n/en.yml b/_i18n/en.yml index 5190265..c5bdc0c 100644 --- a/_i18n/en.yml +++ b/_i18n/en.yml @@ -194,6 +194,10 @@ doc: description: "Documentation resources for Bitcoin XT" developer: "For developers" wiki: Developer wiki - guides: Guides / procedures + articles: Articles moredocs: | More documentation is located in the git repository. + +articles: + freetx: + title: "Free transactions with Bitcoin Cash" diff --git a/doc/freetransactions.html b/doc/freetransactions.html new file mode 100644 index 0000000..6201c9c --- /dev/null +++ b/doc/freetransactions.html @@ -0,0 +1,124 @@ +--- +layout: "base" +title: articles.freetx.title +--- + +
+
+
+

Free transactions with Bitcoin Cash

+

Last updated: 2018-07-20

+

This document describes how Bitcoin XT handles free transactions on the Bitcoin Cash network.

+

The criteria for free transactions

+

For sending a free transaction, your transaction needs to pass a coin age criteria. This criteria is accumulation of the value of the transaction inputs, multiplied by the number of confirmations they have.

+

Using this coin age criteria, we allow for many transactions to pass for free, while not allowing a bad actor to flood the network for free.

+

+ You’re basically rewarded for holding Bitcoin Cash by transacting for free. A bad actor would have to hold a large amount of coins for a long period of time to be able to abuse this. This makes an attack expensive and impractical.

+ +

What are inputs and confirmations?

+

When you create a transaction in Bitcoin Cash, you take one or more inputs from previous transactions you’ve received and you create outputs that can be spent in a later transaction.

+

tx

+

Your coins are basically a collection of unspent outputs. Every time a new block is added to the blockchain, any unspent output you own gets an additional confirmation.

+

The formula

+

A transaction that has a priority larger or equal to the following threshold requires no fee, where COIN is 100 000 000 satoshis (1 BCH). +

priority >= COIN * 144 / 250
+ +

Where priority is calculated as (in pseudo code):

+
+inputPriorty = 0;
+for each input:
+    inputPriority = input.value * input.confirmations
+
+priority = inputPriorty / modified transaction size
+        
+

Where modified transaction size is: +

+size = actual transaction size
+for each input:
+    offset = 41 + min(110, input.scriptSig.size)
+    if (size > offset)
+        size -= offset
+        
+

The modified size is a rebate to incentivizing cleaning up the UTXO set.

+ +

The actual code for this is now located in policy/txpriority.cpp.

+ +

The threshold was originally introduced by Satoshi Nakamoto in commit f35e21e.

+ + + +

Simplified calculator

+

1 day = ~144 confirmations. Calculator assumes average input size is 180 bytes. + + + + + + + + + + + +
InputsSizeCriteria
+

Input:
+ Value    
+ Confirm.  +

+

 

+

+
+

Total size (bytes):

+
+

Priority: 58181818 / 57600000

+

Free: Yes

+
+ +

How fast do free transactions get confirmed?

+

Bitcoin XT will mine all free transactions as long as there is block space available. Priority is not weighted in the block transaction selection. Transactions paying the highest fee have priority over lower fee paying transactions.

+

When blocks are full, Bitcoin XT will accept free transactions into its mempool as long as there is space available. Mempool size defaults to 300MB (maxmempool=300). +

Miners can disable free transactions by adding allowfreetx=0 to their nodes configuration file.

+ +
+
+
diff --git a/doc/index.html b/doc/index.html index 5ebddea..233e859 100644 --- a/doc/index.html +++ b/doc/index.html @@ -7,25 +7,26 @@
-

{% t doc.description %}

-

{% t doc.developer %}

+

{% t doc.title %}

+

{% t doc.articles %}

-

-

{% t doc.guides %}

+

{% t doc.developer %}

diff --git a/doc/txinout.png b/doc/txinout.png new file mode 100644 index 0000000000000000000000000000000000000000..a491e710c54c3bc6d64eb4cfff81e64b2beb518f GIT binary patch literal 5082 zcmd^@XHZk^w#PT3SP*O=iYOvYI!FxC1Vu!Y5_(N&CKQ24ZvqMe3L+Ak5CrL+_#zT| zKtz;|Kp@h^&_YolLHd0-@0ok#y4l=KX!1E_nS7zvKX+nJb7bC}k(l-^HtcMR%YW?1?+c`MQY|v>B ztekguw)>eqJv<%^l#bv8?>Sjvnr{8$s=A#Gnl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