1
0
mirror of https://github.com/bitcoin/bips.git synced 2024-11-19 18:00:08 +01:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Matt David 2016-12-02 14:37:53 -08:00
commit 1ba95330d1
14 changed files with 472 additions and 223 deletions

View File

@ -344,6 +344,12 @@ Those proposing changes should consider that ultimately consent may rest with th
| Standard | Standard
| Draft | Draft
|- |-
| [[bip-0090.mediawiki|90]]
| Buried Deployments
| Suhas Daftuar
| Informational
| Draft
|-
| [[bip-0099.mediawiki|99]] | [[bip-0099.mediawiki|99]]
| Motivation and deployment of consensus rule changes ([soft/hard]forks) | Motivation and deployment of consensus rule changes ([soft/hard]forks)
| Jorge Timón | Jorge Timón
@ -385,12 +391,12 @@ Those proposing changes should consider that ultimately consent may rest with th
| Washington Y. Sanchez | Washington Y. Sanchez
| Standard | Standard
| Draft | Draft
|- |- style="background-color: #ffcfcf"
| [[bip-0109.mediawiki|109]] | [[bip-0109.mediawiki|109]]
| Two million byte size limit with sigop and sighash limits | Two million byte size limit with sigop and sighash limits
| Gavin Andresen | Gavin Andresen
| Standard | Standard
| Draft | Rejected
|- style="background-color: #ffffcf" |- style="background-color: #ffffcf"
| [[bip-0111.mediawiki|111]] | [[bip-0111.mediawiki|111]]
| NODE_BLOOM service bit | NODE_BLOOM service bit

View File

@ -74,6 +74,7 @@ For each new BIP that comes in an editor does the following:
* The title should accurately describe the content. * The title should accurately describe the content.
* The BIP draft must have been sent to the Bitcoin development mailing list for discussion. * The BIP draft must have been sent to the Bitcoin development mailing list for discussion.
* Motivation and backward compatibility (when applicable) must be addressed. * Motivation and backward compatibility (when applicable) must be addressed.
* The defined Layer header must be correctly assigned for the given specification.
* Licensing terms must be acceptable for BIPs. * Licensing terms must be acceptable for BIPs.
If the BIP isn't ready, the editor will send it back to the author for revision, with specific instructions. If the BIP isn't ready, the editor will send it back to the author for revision, with specific instructions.
@ -120,6 +121,7 @@ Each BIP must begin with an RFC 822 style header preamble. The headers must appe
<pre> <pre>
BIP: <BIP number, or "?" before being assigned> BIP: <BIP number, or "?" before being assigned>
* Layer: <Consensus (soft fork) | Consensus (hard fork) | Peer Services | API/RPC | Applications>
Title: <BIP title; maximum 44 characters> Title: <BIP title; maximum 44 characters>
Author: <list of authors' real names and email addrs> Author: <list of authors' real names and email addrs>
* Discussions-To: <email address> * Discussions-To: <email address>
@ -137,6 +139,9 @@ Each BIP must begin with an RFC 822 style header preamble. The headers must appe
* Superseded-By: <BIP number> * Superseded-By: <BIP number>
</pre> </pre>
The Layer header (only for Standards Track BIPs) documents which layer of Bitcoin the BIP applies to.
See [[bip-0123.mediawiki|BIP 123]] for definitions of the various BIP layers. Activation of this BIP implies activation of BIP 123.
The Author header lists the names and email addresses of all the authors/owners of the BIP. The Author header lists the names and email addresses of all the authors/owners of the BIP.
The format of the Author header value must be The format of the Author header value must be
@ -191,8 +196,6 @@ A process BIP may change status from Draft to Active when it achieves rough cons
====Progression to Final status==== ====Progression to Final status====
See [[bip-0123.mediawiki|BIP 123]] for definitions of the various BIP layers. Activation of this BIP implies activation of BIP 123.
A soft-fork BIP strictly requires a clear miner majority expressed by blockchain voting (eg, using BIP 9). In addition, if the economy seems willing to make a "no confidence" hard-fork (such as a change in proof-of-work algorithm), the soft-fork does not become Final for as long as such a hard-fork might have majority support, or at most three months. Soft-fork BIPs may also set additional requirements for their adoption. Because of the possibility of changes to miner dynamics, especially in light of delegated voting (mining pools), it is highly recommended that a supermajority vote around 95% be required by the BIP itself, unless rationale is given for a lower threshold. A soft-fork BIP strictly requires a clear miner majority expressed by blockchain voting (eg, using BIP 9). In addition, if the economy seems willing to make a "no confidence" hard-fork (such as a change in proof-of-work algorithm), the soft-fork does not become Final for as long as such a hard-fork might have majority support, or at most three months. Soft-fork BIPs may also set additional requirements for their adoption. Because of the possibility of changes to miner dynamics, especially in light of delegated voting (mining pools), it is highly recommended that a supermajority vote around 95% be required by the BIP itself, unless rationale is given for a lower threshold.
A hard-fork BIP requires adoption from the entire Bitcoin economy, particularly including those selling desirable goods and services in exchange for bitcoin payments, as well as Bitcoin holders who wish to spend or would spend their bitcoins (including selling for other currencies) differently in the event of such a hard-fork. Adoption must be expressed by de facto usage of the hard-fork in practice (ie, not merely expressing public support, although that is a good step to establish agreement before adoption of the BIP). This economic adoption cannot be established merely by a super-majority, except by literally forcing the minority to accept the hard-fork (whether this is viable or not is outside the scope of this document). A hard-fork BIP requires adoption from the entire Bitcoin economy, particularly including those selling desirable goods and services in exchange for bitcoin payments, as well as Bitcoin holders who wish to spend or would spend their bitcoins (including selling for other currencies) differently in the event of such a hard-fork. Adoption must be expressed by de facto usage of the hard-fork in practice (ie, not merely expressing public support, although that is a good step to establish agreement before adoption of the BIP). This economic adoption cannot be established merely by a super-majority, except by literally forcing the minority to accept the hard-fork (whether this is viable or not is outside the scope of this document).
@ -395,6 +398,7 @@ Why is Public Domain no longer acceptable for new BIPs?
* An implementation is now required (when applicable) before BIPs can proceed to Proposed Status. * An implementation is now required (when applicable) before BIPs can proceed to Proposed Status.
* BIP Comments are newly introduced. * BIP Comments are newly introduced.
* The License preamble headers have been added. * The License preamble headers have been added.
* The Layer header is included from BIP 123.
* Non-image auxiliary files are permitted in the bip-XXXX subdirectory. * Non-image auxiliary files are permitted in the bip-XXXX subdirectory.
* Email addresses are now required for authors. * Email addresses are now required for authors.
* The Post-History header may be provided as a link instead of a simple date. * The Post-History header may be provided as a link instead of a simple date.

View File

@ -11,6 +11,10 @@
This BIP describes a new opcode (OP_CHECKHASHVERIFY) for the Bitcoin scripting system, and a new 'standard' transaction type that uses it to enables the receiver of bitcoins to specify the transaction type needed to re-spend them. This BIP describes a new opcode (OP_CHECKHASHVERIFY) for the Bitcoin scripting system, and a new 'standard' transaction type that uses it to enables the receiver of bitcoins to specify the transaction type needed to re-spend them.
==Copyright==
This BIP is licensed under the BSD 2-clause license.
==Motivation== ==Motivation==
The purpose of pay-to-script-hash is to move the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer. The purpose of pay-to-script-hash is to move the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer.

View File

@ -11,6 +11,10 @@
This BIP modifies the basic format of transaction inputs and outputs, replacing the current scriptSig and scriptPubKey (scripts executed to validate a transaction) with new contents: dataSig, scriptCheck, and hashScriptCheck. This BIP modifies the basic format of transaction inputs and outputs, replacing the current scriptSig and scriptPubKey (scripts executed to validate a transaction) with new contents: dataSig, scriptCheck, and hashScriptCheck.
==Copyright==
This BIP is licensed under the BSD 2-clause license.
==Motivation== ==Motivation==
The purpose of pay-to-script-hash is to move the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer. The purpose of pay-to-script-hash is to move the responsibility for supplying the conditions to redeem a transaction from the sender of the funds to the redeemer.

View File

@ -11,6 +11,10 @@
This BIP proposes M-of-N-signatures required transactions as a new 'standard' transaction type using the existing scripting system without significant modifications. This BIP proposes M-of-N-signatures required transactions as a new 'standard' transaction type using the existing scripting system without significant modifications.
==Copyright==
This BIP is licensed under the BSD 2-clause license.
==Motivation== ==Motivation==
Enable secured wallets, escrow transactions, and other use cases where redeeming funds requires more than a single signature. Enable secured wallets, escrow transactions, and other use cases where redeeming funds requires more than a single signature.

View File

@ -12,6 +12,9 @@ BIP 0020 is based off an earlier document by Nils Schneider. '''And has been rep
==Abstract== ==Abstract==
This BIP proposes a URI scheme for making Bitcoin payments. This BIP proposes a URI scheme for making Bitcoin payments.
==Copyright==
This BIP is licensed under the BSD 2-clause license.
==Motivation== ==Motivation==
The purpose of this URI scheme is to enable users to easily make payments by simply clicking links on webpages or scanning QR Codes. The purpose of this URI scheme is to enable users to easily make payments by simply clicking links on webpages or scanning QR Codes.

View File

@ -12,6 +12,10 @@
This BIP describes a new JSON-RPC method for "smart" Bitcoin miners and proxies. This BIP describes a new JSON-RPC method for "smart" Bitcoin miners and proxies.
Instead of sending a simple block header for hashing, the entire block structure is sent, and left to the miner to (optionally) customize and assemble. Instead of sending a simple block header for hashing, the entire block structure is sent, and left to the miner to (optionally) customize and assemble.
==Copyright==
This BIP is licensed under the BSD 2-clause license.
==Specification== ==Specification==
===Block Template Request=== ===Block Template Request===

View File

@ -11,6 +11,10 @@
This BIP describes extensions to the getblocktemplate JSON-RPC call to enhance pooled mining. This BIP describes extensions to the getblocktemplate JSON-RPC call to enhance pooled mining.
==Copyright==
This BIP is licensed under the BSD 2-clause license.
==Specification== ==Specification==
Note that all sections of this specification are optional extensions on top of [[bip-0022.mediawiki|BIP 22]]. Note that all sections of this specification are optional extensions on top of [[bip-0022.mediawiki|BIP 22]].

View File

@ -126,3 +126,8 @@ The authors wish to thank BtcDrak and Luke-Jr for their involvement & contributi
== References == == References ==
<references> <references>
== Copyright ==
This document is placed in the public domain.

96
bip-0090.mediawiki Normal file
View File

@ -0,0 +1,96 @@
<pre>
BIP: 90
Title: Buried Deployments
Author: Suhas Daftuar <sdaftuar@chaincode.com>
Status: Draft
Type: Informational
Created: 2016-11-08
</pre>
==Abstract==
Prior soft forks (BIP 34, BIP 65, and BIP 66) were activated via miner signaling in block version numbers. Now that the chain has long since passed the blocks at which those consensus rules have triggered, we can (as a simplification) replace the trigger mechanism by caching the block heights at which those consensus rules became enforced.
==Motivation==
BIPs 34, 65 and 66 were deployed on mainnet using miner signaling using block version numbers. In short, new consensus rules were proposed for use in blocks with a higher version number (N+1) than the prevailing block version (N) in use on the network, and those rules became enforced under the following conditions:
# 75% rule: If 750 of the prior 1000 blocks are version N+1 or higher, then blocks with version N+1 or higher must correctly enforce the new consensus rule.
# 95% rule: If 950 of the prior 1000 blocks are version N+1 or higher, then blocks with version less than N+1 are invalid.
Please see those [[#References|BIPs]] for more details.
Note that this trigger mechanism is dependent on the chain history. To validate a block, we must test whether the trigger was met by looking at the previous 1000 blocks in the chain before it, which can be inefficient.
In addition, this mechanism for code deployments have been deprecated in favor of BIP 9 deployments, which offer several advantages (please see [https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki BIP 9]).
Thus we propose elimination of the logic implementing these kinds of deployments, by replacing the test which governs enforcement of BIP 34, BIP 65, and BIP 66 with simple height checks, which we choose to be the block height triggering the 95% activation rule on mainnet for each of those deployments. This simplification of the consensus rules would reduce the technical debt associated with deployment of those consensus changes.
==Considerations==
It is technically possible for this to be a non-backwards compatible change. For example, if an alternate chain were created in which BIP 34's 95% activation triggered at a lower height (H') than it did on the current mainnet chain (H), then older software would enforce that version 1 blocks were invalid at heights between H' and H, while newer software implementing this change would not. Similarly, this BIP proposes doing away with the 75% threshold check altogether, which means, for example, that a version 2 block forking off of mainnet at height H-1 which omitted the height in coinbase would be invalid to older software, while accepted by newer software.
However, while newer software and older software might validate old blocks differently, that could only cause a consensus split if there were an extremely large blockchain reorganization onto a chain built off such a block. As of November 2016, the most recent of these changes (BIP 65, enforced since December 2015) has nearly 50,000 blocks built on top of it. The occurrence of such a reorg that would cause the activating block to be disconnected would raise fundamental concerns about the security assumptions of Bitcoin, a far bigger issue than any non-backwards compatible change.
So while this proposal could <i>theoretically</i> result in a consensus split, it is extremely unlikely, and in particular any such circumstances would be sufficiently damaging to the Bitcoin network to dwarf any concerns about the effects of this proposed change.
==Specification==
The BIP 34, 66, and 65 activation heights are set to 227931, 363725, and 388381, respectively.
The 1000-block lookback test, first described in BIP 34, is no longer performed during validation of any blocks. Instead, a new check is added:
if((block.nVersion < 2 && nHeight >= consensusParams.BIP34Height) ||
(block.nVersion < 3 && nHeight >= consensusParams.BIP66Height) ||
(block.nVersion < 4 && nHeight >= consensusParams.BIP65Height))
return state.Invalid(false, REJECT_OBSOLETE, strprintf("bad-version(0x%08x)", block.nVersion),
strprintf("rejected nVersion=0x%08x block", block.nVersion));
Furthermore, rather than consider the block versions of the prior 1000 blocks to determine whether to enforce BIP 34, BIP 65, or BIP 66 on a given block, we instead just compare the height of the block being validated with the stored activation heights:
// Enforce rule that the coinbase starts with serialized block height
if (nHeight >= consensusParams.BIP34Height)
{
CScript expect = CScript() << nHeight;
if (block.vtx[0].vin[0].scriptSig.size() < expect.size() ||
!std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) {
return state.DoS(100, false, REJECT_INVALID, "bad-cb-height", false, "block height mismatch in coinbase");
}
}
and
// Start enforcing the DERSIG (BIP66) rule
if (pindex->nHeight >= chainparams.GetConsensus().BIP66Height) {
flags |= SCRIPT_VERIFY_DERSIG;
}
// Start enforcing CHECKLOCKTIMEVERIFY (BIP65) rule
if (pindex->nHeight >= chainparams.GetConsensus().BIP65Height) {
flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;
}
Please see the implementation for additional details.
==Implementation==
https://github.com/bitcoin/bitcoin/pull/8391.
==References==
[https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki BIP34 Block v2, Height in Coinbase]
[https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki BIP66 Strict DER signatures]
[https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki BIP65 OP_CHECKLOCKTIMEVERIFY]
[https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki BIP9 Version bits with timeout and delay]
==Acknowledgements==
Thanks to Nicolas Dorier for drafting an initial version of this BIP, and to Alex Morcos, Matt Corallo, and Greg Maxwell for suggestions and feedback.
==Copyright==
This document is placed in the public domain.

View File

@ -2,7 +2,7 @@
BIP: 109 BIP: 109
Title: Two million byte size limit with sigop and sighash limits Title: Two million byte size limit with sigop and sighash limits
Author: Gavin Andresen <gavinandresen@gmail.com> Author: Gavin Andresen <gavinandresen@gmail.com>
Status: Draft Status: Rejected
Type: Standards Track Type: Standards Track
Created: 2016-01-28 Created: 2016-01-28
</pre> </pre>

View File

@ -1,6 +1,5 @@
<pre> <pre>
BIP: 123 BIP: 123
Layer: Process
Title: BIP Classification Title: BIP Classification
Author: Eric Lombrozo <elombrozo@gmail.com> Author: Eric Lombrozo <elombrozo@gmail.com>
Status: Draft Status: Draft
@ -31,6 +30,8 @@ Standards BIPs are placed in one of four layers:
# API/RPC # API/RPC
# Applications # Applications
Non-standards BIPs may be placed in these layers, or none at all.
===1. Consensus Layer=== ===1. Consensus Layer===
The consensus layer defines cryptographic commitment structures. Its purpose is ensuring that anyone can locally evaluate whether a particular state and history is valid, providing settlement guarantees, and assuring eventual convergence. The consensus layer defines cryptographic commitment structures. Its purpose is ensuring that anyone can locally evaluate whether a particular state and history is valid, providing settlement guarantees, and assuring eventual convergence.
@ -76,19 +77,26 @@ The applications layer specifies high level structures, abstractions, and conven
!Status !Status
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0001.mediawiki|1]] | [[bip-0001.mediawiki|1]]
| Process |
| BIP Purpose and Guidelines | BIP Purpose and Guidelines
| Amir Taaki | Amir Taaki
| Standard | Process
| Active | Active
|- |-
| [[bip-0002.mediawiki|2]]
|
| BIP process, revised
| Luke Dashjr
| Process
| Draft
|- style="background-color: #cfffcf"
| [[bip-0009.mediawiki|9]] | [[bip-0009.mediawiki|9]]
| Consensus (soft fork) |
| Version bits with timeout and delay | Version bits with timeout and delay
| Pieter Wuille, Peter Todd, Greg Maxwell, Rusty Russell | Pieter Wuille, Peter Todd, Greg Maxwell, Rusty Russell
| Informational | Informational
| Draft | Final
|- |- style="background-color: #ffcfcf"
| [[bip-0010.mediawiki|10]] | [[bip-0010.mediawiki|10]]
| Applications | Applications
| Multi-Sig Transaction Distribution | Multi-Sig Transaction Distribution
@ -97,11 +105,11 @@ The applications layer specifies high level structures, abstractions, and conven
| Withdrawn | Withdrawn
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0011.mediawiki|11]] | [[bip-0011.mediawiki|11]]
| Peer Services | Applications
| M-of-N Standard Transactions | M-of-N Standard Transactions
| Gavin Andresen | Gavin Andresen
| Standard | Standard
| Accepted | Final
|- style="background-color: #ffcfcf" |- style="background-color: #ffcfcf"
| [[bip-0012.mediawiki|12]] | [[bip-0012.mediawiki|12]]
| Consensus (soft fork) | Consensus (soft fork)
@ -122,8 +130,8 @@ The applications layer specifies high level structures, abstractions, and conven
| Protocol Version and User Agent | Protocol Version and User Agent
| Amir Taaki, Patrick Strateman | Amir Taaki, Patrick Strateman
| Standard | Standard
| Accepted | Final
|- style="background-color: #ffcfcf" |-
| [[bip-0015.mediawiki|15]] | [[bip-0015.mediawiki|15]]
| Applications | Applications
| Aliases | Aliases
@ -133,7 +141,7 @@ The applications layer specifies high level structures, abstractions, and conven
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0016.mediawiki|16]] | [[bip-0016.mediawiki|16]]
| Consensus (soft fork) | Consensus (soft fork)
| Pay To Script Hash | Pay to Script Hash
| Gavin Andresen | Gavin Andresen
| Standard | Standard
| Final | Final
@ -142,18 +150,18 @@ The applications layer specifies high level structures, abstractions, and conven
| Consensus (soft fork) | Consensus (soft fork)
| OP_CHECKHASHVERIFY (CHV) | OP_CHECKHASHVERIFY (CHV)
| Luke Dashjr | Luke Dashjr
| Standard
| Withdrawn | Withdrawn
| Draft |- style="background-color: #ffffcf"
|-
| [[bip-0018.mediawiki|18]] | [[bip-0018.mediawiki|18]]
| Consensus (soft fork) | Consensus (soft fork)
| hashScriptCheck | hashScriptCheck
| Luke Dashjr | Luke Dashjr
| Standard | Standard
| Draft | Accepted
|- |-
| [[bip-0019.mediawiki|19]] | [[bip-0019.mediawiki|19]]
| Peer Services | Applications
| M-of-N Standard Transactions (Low SigOp) | M-of-N Standard Transactions (Low SigOp)
| Luke Dashjr | Luke Dashjr
| Standard | Standard
@ -171,21 +179,21 @@ The applications layer specifies high level structures, abstractions, and conven
| URI Scheme | URI Scheme
| Nils Schneider, Matt Corallo | Nils Schneider, Matt Corallo
| Standard | Standard
| Accepted | Final
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0022.mediawiki|22]] | [[bip-0022.mediawiki|22]]
| API/RPC | API/RPC
| getblocktemplate - Fundamentals | getblocktemplate - Fundamentals
| Luke Dashjr | Luke Dashjr
| Standard | Standard
| Accepted | Final
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0023.mediawiki|23]] | [[bip-0023.mediawiki|23]]
| API/RPC | API/RPC
| getblocktemplate - Pooled Mining | getblocktemplate - Pooled Mining
| Luke Dashjr | Luke Dashjr
| Standard | Standard
| Accepted | Final
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0030.mediawiki|30]] | [[bip-0030.mediawiki|30]]
| Consensus (soft fork) | Consensus (soft fork)
@ -199,17 +207,17 @@ The applications layer specifies high level structures, abstractions, and conven
| Pong message | Pong message
| Mike Hearn | Mike Hearn
| Standard | Standard
| Accepted | Final
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0032.mediawiki|32]] | [[bip-0032.mediawiki|32]]
| Applications | Applications
| Hierarchical Deterministic Wallets | Hierarchical Deterministic Wallets
| Pieter Wuille | Pieter Wuille
| Informational | Informational
| Accepted | Final
|- |-
| [[bip-0033.mediawiki|33]] | [[bip-0033.mediawiki|33]]
| API/RPC | Peer Services
| Stratized Nodes | Stratized Nodes
| Amir Taaki | Amir Taaki
| Standard | Standard
@ -217,17 +225,17 @@ The applications layer specifies high level structures, abstractions, and conven
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0034.mediawiki|34]] | [[bip-0034.mediawiki|34]]
| Consensus (soft fork) | Consensus (soft fork)
| Block v2, Height in coinbase | Block v2, Height in Coinbase
| Gavin Andresen | Gavin Andresen
| Standard | Standard
| Accepted | Final
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0035.mediawiki|35]] | [[bip-0035.mediawiki|35]]
| Peer Services | Peer Services
| mempool message | mempool message
| Jeff Garzik | Jeff Garzik
| Standard | Standard
| Accepted | Final
|- |-
| [[bip-0036.mediawiki|36]] | [[bip-0036.mediawiki|36]]
| Peer Services | Peer Services
@ -238,38 +246,24 @@ The applications layer specifies high level structures, abstractions, and conven
|- style="background-color: #cfffcf" |- style="background-color: #cfffcf"
| [[bip-0037.mediawiki|37]] | [[bip-0037.mediawiki|37]]
| Peer Services | Peer Services
| Bloom filtering | Connection Bloom filtering
| Mike Hearn and Matt Corallo | Mike Hearn, Matt Corallo
| Standard | Standard
| Accepted | Final
|- |-
| [[bip-0038.mediawiki|38]] | [[bip-0038.mediawiki|38]]
| Applications | Applications
| Passphrase-protected private key | Passphrase-protected private key
| Mike Caldwell | Mike Caldwell, Aaron Voisine
| Standard | Standard
| Draft | Draft
|- |- style="background-color: #ffffcf"
| [[bip-0039.mediawiki|39]] | [[bip-0039.mediawiki|39]]
| Applications | Applications
| Mnemonic code for generating deterministic keys | Mnemonic code for generating deterministic keys
| Slush | Marek Palatinus, Pavol Rusnak, Aaron Voisine, Sean Bowe
| Standard | Standard
| Draft | Accepted
|-
| 40
| Applications
| Stratum wire protocol
| Slush
| Standard
| BIP number allocated
|-
| 41
| Applications
| Stratum mining protocol
| Slush
| Standard
| BIP number allocated
|- |-
| [[bip-0042.mediawiki|42]] | [[bip-0042.mediawiki|42]]
| Consensus (soft fork) | Consensus (soft fork)
@ -281,31 +275,44 @@ The applications layer specifies high level structures, abstractions, and conven
| [[bip-0043.mediawiki|43]] | [[bip-0043.mediawiki|43]]
| Applications | Applications
| Purpose Field for Deterministic Wallets | Purpose Field for Deterministic Wallets
| Slush | Marek Palatinus, Pavol Rusnak
| Standard | Informational
| Draft | Draft
|- |- style="background-color: #ffffcf"
| [[bip-0044.mediawiki|44]] | [[bip-0044.mediawiki|44]]
| Applications | Applications
| Multi-Account Hierarchy for Deterministic Wallets | Multi-Account Hierarchy for Deterministic Wallets
| Slush | Marek Palatinus, Pavol Rusnak
| Standard | Standard
| Draft | Accepted
|- |- style="background-color: #ffffcf"
| [[bip-0045.mediawiki|45]] | [[bip-0045.mediawiki|45]]
| Applications | Applications
| Structure for Deterministic P2SH Multisignature Wallets | Structure for Deterministic P2SH Multisignature Wallets
| Manuel Araoz | Manuel Araoz, Ryan X. Charles, Matias Alejo Garcia
| Standard | Standard
| Accepted
|-
| [[bip-0047.mediawiki|47]]
| Applications
| Reusable Payment Codes for Hierarchical Deterministic Wallets
| Justus Ranvier
| Informational
| Draft | Draft
|- |-
| [[bip-0050.mediawiki|50]] | [[bip-0049.mediawiki|49]]
| Applications
| Derivation scheme for P2WPKH-nested-in-P2SH based accounts
| Daniel Weigl
| Informational | Informational
| Draft
|- style="background-color: #cfffcf"
| [[bip-0050.mediawiki|50]]
|
| March 2013 Chain Fork Post-Mortem | March 2013 Chain Fork Post-Mortem
| Gavin Andresen | Gavin Andresen
| Informational | Informational
| Draft | Final
<!-- 50 series reserved for a group of post-mortems -->
|- |-
| [[bip-0060.mediawiki|60]] | [[bip-0060.mediawiki|60]]
| Peer Services | Peer Services
@ -313,97 +320,118 @@ The applications layer specifies high level structures, abstractions, and conven
| Amir Taaki | Amir Taaki
| Standard | Standard
| Draft | Draft
|- |- style="background-color: #cfffcf"
| [[bip-0061.mediawiki|61]] | [[bip-0061.mediawiki|61]]
| Peer Services | Peer Services
| "reject" P2P message | Reject P2P message
| Gavin Andresen | Gavin Andresen
| Standard | Standard
| Final | Final
|- |- style="background-color: #ffcfcf"
| [[bip-0062.mediawiki|62]] | [[bip-0062.mediawiki|62]]
| Consensus (soft fork) | Consensus (soft fork)
| Dealing with malleability | Dealing with malleability
| Pieter Wuille | Pieter Wuille
| Standard | Standard
| Draft | Withdrawn
|-
| 63
| Applications
| Stealth Addresses
| Peter Todd
| Standard
| BIP number allocated
|- |-
| [[bip-0064.mediawiki|64]] | [[bip-0064.mediawiki|64]]
| Peer Services | Peer Services
| getutxos message | getutxo message
| Mike Hearn | Mike Hearn
| Standard | Standard
| Draft | Draft
|- |- style="background-color: #cfffcf"
| [[bip-0065.mediawiki|65]] | [[bip-0065.mediawiki|65]]
| Consensus (soft fork) | Consensus (soft fork)
| OP_CHECKLOCKTIMEVERIFY | OP_CHECKLOCKTIMEVERIFY
| Peter Todd | Peter Todd
| Standard | Standard
| Draft | Final
|- |- style="background-color: #cfffcf"
| [[bip-0066.mediawiki|66]] | [[bip-0066.mediawiki|66]]
| Consensus (soft fork) | Consensus (soft fork)
| Strict DER signatures | Strict DER signatures
| Pieter Wuille | Pieter Wuille
| Standard | Standard
| Draft | Final
|- |- style="background-color: #ffffcf"
| [[bip-0067.mediawiki|67]] | [[bip-0067.mediawiki|67]]
| Applications | Applications
| Deterministic P2SH multi-signature addresses | Deterministic Pay-to-script-hash multi-signature addresses through public key sorting
| Thomas Kerin | Thomas Kerin, Jean-Pierre Rupp, Ruben de Vries
| Standard | Standard
| Draft | Accepted
|- |- style="background-color: #cfffcf"
| [[bip-0068.mediawiki|68]] | [[bip-0068.mediawiki|68]]
| Consensus (soft fork) | Consensus (soft fork)
| Consensus-enforced transaction replacement signalled via sequence numbers | Relative lock-time using consensus-enforced sequence numbers
| Mark Friedenbach | Mark Friedenbach, BtcDrak, Nicolas Dorier, kinoshitajona
| Standard
| Final
|- style="background-color: #ffffcf"
| [[bip-0069.mediawiki|69]]
| Applications
| Lexicographical Indexing of Transaction Inputs and Outputs
| Kristov Atlas
| Informational
| Accepted
|- style="background-color: #cfffcf"
| [[bip-0070.mediawiki|70]]
| Applications
| Payment Protocol
| Gavin Andresen, Mike Hearn
| Standard
| Final
|- style="background-color: #cfffcf"
| [[bip-0071.mediawiki|71]]
| Applications
| Payment Protocol MIME types
| Gavin Andresen
| Standard
| Final
|- style="background-color: #cfffcf"
| [[bip-0072.mediawiki|72]]
| Applications
| bitcoin: uri extensions for Payment Protocol
| Gavin Andresen
| Standard
| Final
|- style="background-color: #cfffcf"
| [[bip-0073.mediawiki|73]]
| Applications
| Use "Accept" header for response type negotiation with Payment Request URLs
| Stephen Pair
| Standard
| Final
|-
| [[bip-0074.mediawiki|74]]
| Applications
| Allow zero value OP_RETURN in Payment Protocol
| Toby Padilla
| Standard | Standard
| Draft | Draft
|- |-
| [[bip-0070.mediawiki|70]] | [[bip-0075.mediawiki|75]]
| Applications | Applications
| Payment protocol | Out of Band Address Exchange using Payment Protocol Encryption
| Gavin Andresen | Justin Newton, Matt David, Aaron Voisine, James MacWhyte
| Standard
| Final
|-
| [[bip-0071.mediawiki|71]]
| Applications
| Payment protocol MIME types
| Gavin Andresen
| Standard
| Final
|-
| [[bip-0072.mediawiki|72]]
| Applications
| Payment protocol URIs
| Gavin Andresen
| Standard
| Final
|-
| [[bip-0073.mediawiki|73]]
| Applications
| Use "Accept" header with Payment Request URLs
| Stephen Pair
| Standard | Standard
| Draft | Draft
|- |-
| [[bip-0080.mediawiki|80]] | [[bip-0080.mediawiki|80]]
| Applications |
| Hierarchy for Non-Colored Voting Pool Deterministic Multisig Wallets | Hierarchy for Non-Colored Voting Pool Deterministic Multisig Wallets
| Monetas | Justus Ranvier, Jimmy Song
| Informational | Informational
| Draft | Deferred
|-
| [[bip-0081.mediawiki|81]]
|
| Hierarchy for Colored Voting Pool Deterministic Multisig Wallets
| Justus Ranvier, Jimmy Song
| Informational
| Deferred
|- |-
| [[bip-0083.mediawiki|83]] | [[bip-0083.mediawiki|83]]
| Applications | Applications
@ -413,18 +441,18 @@ The applications layer specifies high level structures, abstractions, and conven
| Draft | Draft
|- |-
| [[bip-0099.mediawiki|99]] | [[bip-0099.mediawiki|99]]
| Informational |
| Motivation and deployment of consensus rule changes ([soft/hard]forks) | Motivation and deployment of consensus rule changes ([soft/hard]forks)
| Jorge Timón | Jorge Timón
| Informational / Process | Informational
| Draft | Draft
|- |- style="background-color: #ffcfcf"
| [[bip-0101.mediawiki|101]] | [[bip-0101.mediawiki|101]]
| Consensus (hard fork) | Consensus (hard fork)
| Increase maximum block size | Increase maximum block size
| Gavin Andresen | Gavin Andresen
| Standard | Standard
| Draft | Withdrawn
|- |-
| [[bip-0102.mediawiki|102]] | [[bip-0102.mediawiki|102]]
| Consensus (hard fork) | Consensus (hard fork)
@ -442,7 +470,7 @@ The applications layer specifies high level structures, abstractions, and conven
|- |-
| [[bip-0105.mediawiki|105]] | [[bip-0105.mediawiki|105]]
| Consensus (hard fork) | Consensus (hard fork)
| Consensus based block size retargetting algorithm | Consensus based block size retargeting algorithm
| BtcDrak | BtcDrak
| Standard | Standard
| Draft | Draft
@ -461,25 +489,39 @@ The applications layer specifies high level structures, abstractions, and conven
| Standard | Standard
| Draft | Draft
|- |-
| [[bip-0109.mediawiki|109]]
| Consensus (hard fork)
| Two million byte size limit with sigop and sighash limits
| Gavin Andresen
| Standard
| Draft
|- style="background-color: #ffffcf"
| [[bip-0111.mediawiki|111]] | [[bip-0111.mediawiki|111]]
| Peer Services | Peer Services
| NODE_BLOOM service bit | NODE_BLOOM service bit
| Matt Corallo, Peter Todd | Matt Corallo, Peter Todd
| Standard | Standard
| Draft | Accepted
|- |- style="background-color: #cfffcf"
| [[bip-0112.mediawiki|112]] | [[bip-0112.mediawiki|112]]
| Consensus (soft fork) | Consensus (soft fork)
| CHECKSEQUENCEVERIFY | CHECKSEQUENCEVERIFY
| BtcDrak, Mark Friedenbach, Eric Lombrozo | BtcDrak, Mark Friedenbach, Eric Lombrozo
| Standard | Standard
| Draft | Final
|- |- style="background-color: #cfffcf"
| [[bip-0113.mediawiki|113]] | [[bip-0113.mediawiki|113]]
| Consensus (soft fork) | Consensus (soft fork)
| Median time-past as endpoint for locktime calculations | Median time-past as endpoint for lock-time calculations
| Thomas Kerin, Mark Friedenbach | Thomas Kerin, Mark Friedenbach
| Standard | Standard
| Final
|-
| [[bip-0114.mediawiki|114]]
| Consensus (soft fork)
| Merkelized Abstract Syntax Tree
| Johnson Lau
| Standard
| Draft | Draft
|- |-
| [[bip-0120.mediawiki|120]] | [[bip-0120.mediawiki|120]]
@ -504,32 +546,39 @@ The applications layer specifies high level structures, abstractions, and conven
| Draft | Draft
|- |-
| [[bip-0123.mediawiki|123]] | [[bip-0123.mediawiki|123]]
| Process |
| BIP Classification | BIP Classification
| Eric Lombrozo | Eric Lombrozo
| Standard | Process
| Draft | Draft
|- |-
| [[bip-0124.mediawiki|124]] | [[bip-0124.mediawiki|124]]
| Applications | Applications
| Hierarchical Deterministic Script Templates | Hierarchical Deterministic Script Templates
| Eric Lombrozo, William Swanson | Eric Lombrozo, William Swanson
| Standard | Informational
| Draft | Draft
|- |- style="background-color: #ffffcf"
| [[bip-0125.mediawiki|125]] | [[bip-0125.mediawiki|125]]
| Peer Services | Applications
| Opt-in Full Replace-by-Fee Signaling | Opt-in Full Replace-by-Fee Signaling
| David Harding, Peter Todd | David A. Harding, Peter Todd
| Standard | Standard
| Draft | Accepted
|- |-
| [[bip-0126.mediawiki|126]]
|
| Best Practices for Heterogeneous Input Script Transactions
| Kristov Atlas
| Informational
| Draft
|- style="background-color: #ffffcf"
| [[bip-0130.mediawiki|130]] | [[bip-0130.mediawiki|130]]
| Peer Services | Peer Services
| sendheaders message | sendheaders message
| Suhas Daftuar | Suhas Daftuar
| Standard | Standard
| Draft | Accepted
|- |-
| [[bip-0131.mediawiki|131]] | [[bip-0131.mediawiki|131]]
| Consensus (hard fork) | Consensus (hard fork)
@ -537,12 +586,26 @@ The applications layer specifies high level structures, abstractions, and conven
| Chris Priest | Chris Priest
| Standard | Standard
| Draft | Draft
|- |- style="background-color: #ffcfcf"
| [[bip-0132.mediawiki|132]] | [[bip-0132.mediawiki|132]]
| Process |
| Committee-based BIP Acceptance Process | Committee-based BIP Acceptance Process
| Andy Chase | Andy Chase
| Process | Process
| Withdrawn
|-
| [[bip-0133.mediawiki|133]]
| Peer Services
| feefilter message
| Alex Morcos
| Standard
| Draft
|-
| [[bip-0134.mediawiki|134]]
| Consensus (hard fork)
| Flexible Transactions
| Tom Zander
| Standard
| Draft | Draft
|- |-
| [[bip-0140.mediawiki|140]] | [[bip-0140.mediawiki|140]]
@ -564,7 +627,7 @@ The applications layer specifies high level structures, abstractions, and conven
| Address Format for Segregated Witness | Address Format for Segregated Witness
| Johnson Lau | Johnson Lau
| Standard | Standard
| Draft | Deferred
|- |-
| [[bip-0143.mediawiki|143]] | [[bip-0143.mediawiki|143]]
| Consensus (soft fork) | Consensus (soft fork)
@ -578,6 +641,47 @@ The applications layer specifies high level structures, abstractions, and conven
| Segregated Witness (Peer Services) | Segregated Witness (Peer Services)
| Eric Lombrozo, Pieter Wuille | Eric Lombrozo, Pieter Wuille
| Standard | Standard
| Draft | Draft
|-
| [[bip-0145.mediawiki|145]]
| API/RPC
| getblocktemplate Updates for Segregated Witness
| Luke Dashjr
| Standard
| Draft
|-
| [[bip-0146.mediawiki|146]]
| Consensus (soft fork)
| Dealing with signature encoding malleability
| Johnson Lau, Pieter Wuille
| Standard
| Draft
|-
| [[bip-0147.mediawiki|147]]
| Consensus (soft fork)
| Dealing with dummy stack element malleability
| Johnson Lau
| Standard
| Draft
|-
| [[bip-0150.mediawiki|150]]
| Peer Services
| Peer Authentication
| Jonas Schnelli
| Standard
| Draft
|-
| [[bip-0151.mediawiki|151]]
| Peer Services
| Peer-to-Peer Communication Encryption
| Jonas Schnelli
| Standard
| Draft
|-
| [[bip-0152.mediawiki|152]]
| Peer Services
| Compact Block Relay
| Matt Corallo
| Standard
| Draft
|} |}

View File

@ -29,7 +29,7 @@ in future. Soft fork upgrades will become much easier and cleaner this
way. way.
This protocol upgrade cleans up past soft fork changes like BIP68 which This protocol upgrade cleans up past soft fork changes like BIP68 which
reuse existing fields and do them in a much better to maintain and easier reuse existing fields and do them in a better to maintain and easier
to parse system. It creates the building blocks to allow new features to be to parse system. It creates the building blocks to allow new features to be
added much cleaner in the future. added much cleaner in the future.
@ -39,14 +39,29 @@ history. Tests show that this can reduce space usage to about 75%.
==Motivation== ==Motivation==
After 8 years of using essentially the same transaction version and layout
Bitcoin is in need of an upgrade and lessons learned in that time are
taking into account when designing it. The most important detail is that
we have seen a need for more flexibility. For instance when the 'sequence'
fields were introduced in the old transaction format, and later deprecated
again, the end result was that all transactions still were forced to keep
those fields and grow the blockchain while they all were set to the default
value.
The way towards that flexibility is to use a generic concept made popular
various decades ago with the XML format. The idea is that we give each
field a name and this means that new fields can be added or optional fields
can be omitted from individual transactions. Some other ideas are the
standardization of data-formats (like integer and string encoding) so
we create a more consistent system.
One thing we shall not inherit from XML is its text-based format. Instead
we use the [https://github.com/bitcoinclassic/documentation/blob/master/spec/compactmessageformat.md Compact Message Format]
(CMF) which is optimized to keep the size small and fast to parse.
Token based file-formats are not new, systems like XML and HTMl use a Token based file-formats are not new, systems like XML and HTMl use a
similar system to allow future growth and they have been quite successful similar system to allow future growth and they have been quite successful
for decades in part because of this property. for decades in part because of this property.
Bitcoin needs a similar way of making the transaction future-proof because
re-purposing not used fields for new features is not good for creating
maintainable code.
Next to that this protocol upgrade will re-order the data-fields which Next to that this protocol upgrade will re-order the data-fields which
allows us to cleanly fix the malleability issue which means that future allows us to cleanly fix the malleability issue which means that future
technologies like Lightning Network will depend on this BIP being deployed. technologies like Lightning Network will depend on this BIP being deployed.
@ -55,6 +70,19 @@ At the same time, due to this re-ordering of data fields, it becomes very
easy to remove signatures from a transaction without breaking its tx-id, easy to remove signatures from a transaction without breaking its tx-id,
which is great for future pruning features. which is great for future pruning features.
=== Features ===
* Fixes malleability
* Linear scaling of signature checking
* Very flexible future extensibility
* Makes transactions smaller
* Supports the Lightning Network
Additionally, in the v4 (flextrans) format we add the support for the
following proofs;
* input amount. Including the amount means we sign this transaction only if the amount we are spending is the one provided. Wallets that do not have the full UTXO DB can safely sign knowing that if they were lied to about the amount being spent, their signature is useless.
* scriptBase is the combined script of input and output, without signatures naturally. Providing this to a hardware wallet means it knows what output it is spending and can respond properly. Including it in the hash means its signature would be broken if we lied..
* Double spent-proof. Should a node detect a double spent he can notify his peers about this fact. Instead of sending the entire transactions, instead he sends only a proof. The node needs to send two pairs of info that proves that in both transactions the CTxIn are identical.
=== Tokens === === Tokens ===
@ -63,7 +91,8 @@ define how these tokens are named, where they can be placed and which are
optional. To refer to XML, this specification would be the schema of optional. To refer to XML, this specification would be the schema of
a transaction. a transaction.
CMF tokens are triplets of name, format (like PositiveInteger) and value. [https://github.com/bitcoinclassic/documentation/blob/master/spec/compactmessageformat.md CMF]
tokens are triplets of name, format (like PositiveInteger) and value.
Names in this scope are defined much like an enumeration where the actual Names in this scope are defined much like an enumeration where the actual
integer value (id, below) is equally important to the written name. integer value (id, below) is equally important to the written name.
If any token found that is not covered in the next table it will make the If any token found that is not covered in the next table it will make the
@ -73,114 +102,92 @@ transaction that contains it invalid.
|- |-
! Name !! id !! Format !! Default Value !! Description ! Name !! id !! Format !! Default Value !! Description
|- |-
|TxEnd || 0 ||BoolTrue || Required ||A marker that is end of the transaction. |TxEnd || 0 ||BoolTrue || Required ||A marker that is the end of the transaction
|- |-
|TxInPrevHash || 1 ||ByteArray|| Required ||TxId we are spending |TxInPrevHash || 1 ||ByteArray|| Required ||TxId we are spending
|- |-
|TxPrevIndex || 2 ||Integer || 0 ||Index in prev tx we are spending (applied to previous TxInPrevHash) |TxPrevIndex || 2 ||Integer || 0 ||Index in prev tx we are spending (applied to previous TxInPrevHash)
|- |-
|TxInScript || 3 ||ByteArray|| Required ||The 'input' part of the script |TxInputStackItem || 3 ||ByteArray|| &nbsp; ||A 'push' of the input script
|- |-
|TxOutValue || 4 ||Integer || Required ||Amount of Satoshis to transfer |TxInputStackItemContinued||4||ByteArray|| &nsbp; ||Another section for the same input
|- |-
|TxOutScript || 5 ||ByteArray|| Required ||The 'output' part of the script |TxOutValue || 5 ||Integer || Required ||Amount of Satoshis to transfer
|- |-
|LockByBlock || 6 ||Integer || Optional ||BIP68 replacement |TxOutScript || 6 ||ByteArray|| Required ||The output script
|- |-
|LockByTime || 7 ||Integer || Optional ||BIP68 replacement |TxRelativeBlockLock|| 7 ||Integer || Optional ||Part of the input stating the amount of blocks (max 0XFFFF) after that input was mined, it can be mined
|- |-
|ScriptVersion || 8 ||Integer || 2 ||Defines script version for outputs following |TxRelativeTimeLock || 8 ||Integer || Optional ||Part of the input stating the amount of time (max 0XFFFF) after that input was mined, it can be mined. 1 Unit is 512 seconds
|-
|CoinbaseMessage || 9 ||ByteArray|| Optional ||A message and some data for a coinbase transaction. Can't be used in combination with any TxIn\* tags
|-
|NOP_1x || 1x || &nbsp;|| Optional ||Values that will be ignored by anyone parsing the transaction
|- |-
|NOP_1x || 1x || . || Optional ||Values that will be ignored by anyone parsing the transaction
|} |}
=== Scripting changes === === Scripting changes ===
In the current version of Bitcoin-script, version 1, there are various In Bitcoin transactions version 1, checking of signatures is performed by
opcodes that are used to validate the cryptographic proofs that users have various opcodes. The OP_CHECKSIG, OP_CHECKMULTISIG and their equivalents
to provide in order to spend outputs. that immediately VERIFY. These are used to validate the cryptographic
proofs that users have to provide in order to spend outputs.
We additionally have some hashing-types in like SIGHASH_SINGLE that all
specify slightly different subsections of what part of a transaction will
be hashed in order to be signed.
For transactions with version 4 we calculate a sha256 hash for signing an
individual input based on the following content;
# If the hash-type is 0 or 1 we hash the tx-id of the transaction. For other hash types we selectively ignore parts of the transaction exactly like it has always worked. With the caveat that we never serialize any signatures.
# the TxId of the transaction we are spending in this input.
# the index of output of the transaction we are spending in this input.
# the input script we are signing (without the signature, naturally).
# the amount, as a var-int.
# the hash-type as a var-int.
The OP_CHECKSIG is the most well known and, as its name implies, it
validates a signature.
In the new version of 'script' (version 2) the data that is signed is
changed to be equivalent to the transaction-id. This is a massive
simplification and also the only change between version 1 and version 2 of
script.
=== Serialization order=== === Serialization order===
The tokens defined above shall be serialized in a certain order for the
transaction to be valid. Not serializing transactions in the
order specified would allow multiple interpretations of the data which
can't be allowed.
There is still some flexibility and for that reason it is important for
implementors to remember that the actual serialized data is used for the
calculation of the transaction-id. Reading and writing it may give you a
different output and when the txid changes, the signatures will break.
At a macro-level the transaction has these segments. The order of the To keep in line with the name Flexible Transactions, there is very little
segments can not be changed, but you can skip segments. requirement to have a specific order. The only exception is cases where
there are optional values and reordering would make unclear what is meant.
For this reason the TxInPrevHash always has to be the first token to start
a new input. This is because the TxPrevIndex is optional. The tokens
TxRelativeTimeLock and TxRelativeBlockLock are part of the input and
similarly have to be set after the TxInPrevHash they belong to.
Similarly, the TxInputStackItem always has to be the first and can be
followed by a number of TxInputStackItemContinued items.
At a larger scope we define 3 sections of a transaction.
{| class="wikitable" {| class="wikitable"
!Segment !! Description !Segment !! Tags !! Description
|- |-
| Inputs || Details about inputs. |Transaction||all not elsewhere used||This section is used to make the TxId
|- |-
| Outputs || Details and scripts for outputs |Signatures||TxInputStackItem, TxInputStackItemContinued||The input-proofs
|- |-
| Additional || For future expansion |TxEnd||TxEnd||&nbsp;
|-
| Signatures || The scripts for the inputs
|-
| TxEnd || End of the transaction
|} |}
The TxId is calculated by taking the serialized transaction without the The TxId is calculated by taking the serialized transaction without the
Signatures and the TxEnd and hashing that. Signatures and the TxEnd and hashing that.
{| class="wikitable"
!Segment !! Tags !! Description
|-
|Inputs||TxInPrevHash and TxInPrevIndex||Index can be skipped, but in any input the PrevHash always has to come first
|-
|Outputs||TxOutScript, TxOutValue||Order is not relevant
|-
|Additional||LockByBlock LockByTime NOP_1x
|-
|Signatures||TxInScript||Exactly the same amount as there are inputs
|-
|TxEnd||TxEnd
|}
TxEnd is there to allow a parser to know when one transaction in a stream TxEnd is there to allow a parser to know when one transaction in a stream
has ended, allowing the next to be parsed. has ended, allowing the next to be parsed.
Notice that the token ScriptVersion is currently not allowed because we
don't have any valid value to give it. But if we introduce a new script
version it would be placed in the outputs segment.
=== Script v2 ===
The default value of ScriptVersion is number 2, as opposed to the version 1
of script that is in use today. The version 2 is mostly identical
to version one, including upgrades made to it over the years and in the
future. The only exception is that the OP_CHECKSIG is made dramatically
simpler. The input-type for OP_CHECKSIG is now no longer configurable, it is
always '1' and the content that will be signed is the txid.
TODO: does check-multisig need its own mention?
=== Block-malleability === === Block-malleability ===
The effect of leaving the signatures out of the calculation of the The effect of leaving the signatures out of the calculation of the
transaction-id implies that the signatures are also not used for the transaction-id implies that the signatures are also not used for the
calculation of the merkle tree. This means that changes in signatures calculation of the merkle tree. This means that changes in signatures
would not be detectable. Except naturally by the fact that missing or would not be detectable and open an attack vector.
broken signatures breaks full validation. But it is important to detect
modifications to such signatures outside of validating all transactions.
For this reason the merkle tree is extended to include (append) the hash of For this reason the merkle tree is extended to include (append) the hash of
the v4 transactions. The markle tree will continue to have all the the v4 transactions. The markle tree will continue to have all the
@ -188,9 +195,8 @@ transactions' tx-ids but appended to that are the v4 hashes that include the
signatures as well. Specifically the hash is taken over a data-blob that signatures as well. Specifically the hash is taken over a data-blob that
is built up from: is built up from:
1. the tx-id # the tx-id
2. the CMF-tokens 'TxInScript' # The entire bytearray that makes up all of the transactions signatures. This is a serialization of all of the signature tokens, so the TxInputStackItem and TxInputStackItemContinued in the order based on the inputs they are associated with.
=== Future extensibility === === Future extensibility ===
@ -207,9 +213,18 @@ trivially use these tokens for their own usage without cooperation and
communication with the rest of the Bitcoin ecosystem as miners certainly communication with the rest of the Bitcoin ecosystem as miners certainly
have the option to reject transactions that use unknown-to-them tokens. have the option to reject transactions that use unknown-to-them tokens.
The amount of tokens that can be added after number 19 is practically
unlimited and they are currently specified to not be allowed in any
transaction and the transaction will be rejected if they are present.
In the future a protocol upgrade may chance that and specify meaning for
any token not yet specified here. Future upgrades should thus be quite a
lot smoother because there is no change in concepts or in format. Just new
data.
==Backwards compatibility == ==Backwards compatibility ==
Fully validating older clients are not compatible with this change. Fully validating older clients will not be able to understand or validate
version 4 transactions and will need to be updated to restore that ability.
SPV (simple payment validation) wallets need to be updated to receive or SPV (simple payment validation) wallets need to be updated to receive or
create the new transaction type. create the new transaction type.
@ -220,11 +235,12 @@ backwards compatible for any existing data or parsing-code.
==Reference Implementation== ==Reference Implementation==
Bitcoin Classic includes this in its beta releases and a reference Bitcoin Classic includes an implementation that is following this spec.
implementation can be found at; The spec-author rejects the notion of reference implementation. The
specification is always authoritative, the implementation is not.
https://github.com/bitcoinclassic/bitcoinclassic/pull/186
The official spec can be found at;
https://github.com/bitcoinclassic/documentation/blob/master/spec/transactionv4.md
==Deployment== ==Deployment==

View File

@ -31,9 +31,6 @@ my %MiscField = (
'Resolution' => undef, 'Resolution' => undef,
); );
my %ValidLayer = (
Process => undef,
);
my %ValidStatus = ( my %ValidStatus = (
Draft => undef, Draft => undef,
Deferred => undef, Deferred => undef,
@ -106,8 +103,6 @@ while (++$bipnum <= $topbip) {
} else { } else {
$type = $val; $type = $val;
} }
} elsif ($field eq 'Layer') { # BIP 123
die "Invalid layer $val in $fn" unless exists $ValidLayer{$val};
} elsif (exists $DateField{$field}) { } elsif (exists $DateField{$field}) {
die "Invalid date format in $fn" unless $val =~ /^20\d{2}\-(?:0\d|1[012])\-(?:[012]\d|30|31)$/; die "Invalid date format in $fn" unless $val =~ /^20\d{2}\-(?:0\d|1[012])\-(?:[012]\d|30|31)$/;
} elsif (exists $EmailField{$field}) { } elsif (exists $EmailField{$field}) {