2015-12-01 01:40:31 +01:00
|
|
|
<pre>
|
2015-12-02 23:44:26 +01:00
|
|
|
BIP: (no number)
|
2015-12-04 23:32:24 +01:00
|
|
|
Title: "Coalescing Transaction" Specification (wildcard inputs)
|
2015-12-01 01:40:31 +01:00
|
|
|
Author: Chris Priest <cp368202@ohiou.edu>
|
|
|
|
Status: Draft
|
|
|
|
Type: Standards Track
|
|
|
|
Created: 2015-11-30
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
==Abstract==
|
|
|
|
|
|
|
|
This specification defines a new type of transaction that supplements (not replaces)
|
2015-12-04 23:32:24 +01:00
|
|
|
normal "non coalescing" bitcoin transactions.
|
2015-12-01 01:40:31 +01:00
|
|
|
|
|
|
|
==Motivation==
|
|
|
|
|
2015-12-04 23:32:24 +01:00
|
|
|
Normal "non-coalescing" Bitcoin Transactions have one large inefficiency: When you want to spend
|
2015-12-02 23:44:26 +01:00
|
|
|
from multiple inputs with the exact same scriptPubKey, you have to list each
|
2015-12-04 23:32:24 +01:00
|
|
|
input separately, along with the same signature multiple times, even though the signature expresses the same information.
|
2015-12-01 22:14:55 +01:00
|
|
|
This bloats the transaction size and makes it expensive to spend from small value inputs.
|
2015-12-01 01:40:31 +01:00
|
|
|
|
|
|
|
Because small value inputs are expensive to send, they remain in the UTXO pool
|
|
|
|
which full nodes have to keep around. It is believed that long term increase of the UTXO
|
|
|
|
set can have negative scaling consequences on the network.
|
|
|
|
|
2015-12-02 23:44:26 +01:00
|
|
|
If maximum blocksize is made to increase *slower* than the actual number of transactions bitcoin users are sending
|
|
|
|
to the network, this problem is projected to get worse. In other words, as transaction
|
|
|
|
fees increase, the minimum economical value of a spending a UTXO will increase.
|
2015-12-01 22:14:55 +01:00
|
|
|
|
2015-12-01 01:40:31 +01:00
|
|
|
==Specification==
|
|
|
|
|
2015-12-04 23:32:24 +01:00
|
|
|
=== Redefinition of Transaction version ===
|
|
|
|
|
2015-12-04 23:34:53 +01:00
|
|
|
First, this BIP redefines the version field on transactions. The first four bytes
|
2015-12-04 23:32:24 +01:00
|
|
|
are defined as the version number, while the last four bytes are defined as the
|
|
|
|
transaction type. Type "0000" denotes normal transactions, and "0001" defines
|
|
|
|
coalescing transaction.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
version 1 transaction with normal inputs:
|
|
|
|
`version: 10000000`
|
|
|
|
|
|
|
|
version 2 transaction with normal inputs:
|
|
|
|
`version: 20000000`
|
|
|
|
|
|
|
|
version 2 transaction with coalescing inputs:
|
|
|
|
`version: 20000001`
|
|
|
|
|
|
|
|
Essentially the last bit in the version field is set to 1 to enable wildcard inputs for all
|
|
|
|
inputs present in the transaction.
|
|
|
|
|
|
|
|
=== Wildcard inputs ====
|
|
|
|
|
|
|
|
A coalescing transaction is formulated the exact same way as a version 1 transaction
|
2015-12-01 01:40:31 +01:00
|
|
|
with one exception: each input is treated as a "wildcard input".
|
|
|
|
|
2015-12-02 23:44:26 +01:00
|
|
|
A wildcard input beings the value of all inputs with the exact same scriptPubKey
|
2015-12-01 01:40:31 +01:00
|
|
|
in a block lower or equal to the block the wildcard input is confirmed into.
|
2015-12-02 23:44:26 +01:00
|
|
|
|
|
|
|
== Changes needed to implement ==
|
|
|
|
|
|
|
|
The bitcoin code needs to be modified in three places in order to handle Version 2 Transactions.
|
|
|
|
|
2015-12-04 23:32:24 +01:00
|
|
|
1. **Full Node Coalescing validation** - When a full node receives a coalescing transaction, it has to
|
2015-12-04 23:37:51 +01:00
|
|
|
aggregate the value of all the UTXOs in the blockchain older than the input
|
|
|
|
with the same scriptPubKey. If this value is greater than or equal to the
|
|
|
|
amount of all outputs, then that coalescing transaction is valid and can be propagated.
|
2015-12-02 23:44:26 +01:00
|
|
|
|
2015-12-04 23:32:24 +01:00
|
|
|
2. **Full Node Non-Coalescing validation** - When a non-coalescing transaction comes in, the code needs to be modified
|
2015-12-04 23:37:51 +01:00
|
|
|
to check if each input has not been spent by a coalescing transaction. If there exist any
|
|
|
|
coalescing transaction in the blockchain with the same scriptPubKey found in a block *after* that input,
|
|
|
|
then the UTXO has been spent and the transaction is invalid.
|
2015-12-02 23:44:26 +01:00
|
|
|
|
|
|
|
3. **Wallet** - The user facing wallet portion of the reference client should notify
|
2015-12-04 23:37:51 +01:00
|
|
|
the user when their wallet contains many UTXOs that qualify it to benefit from
|
|
|
|
a coalescing transaction. Wallets should not simply replace non-coalescing transactions
|
|
|
|
with coalescing transactions in all instances.
|