-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added BIP 69: Lexicographical Indexing of Inputs and Outputs #157
Conversation
Lexicographical Indexing of Transaction Inputs and Outputs
Electrum 2.3.2 has implemented BIP 69: https://github.com/spesmilo/electrum/blob/master/RELEASE-NOTES |
Maybe add reference to discussion on mailing list: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-June/008484.html |
Added links to discussion per request from laanwj.
Weird: seems to need rebase |
LGTM, anything holding this back? edit: added some comments below |
|
||
Because the hash of previous transactions and output indices must be included in a signed transaction, wallet clients capable of signing transactions will necessarily have access to this data. | ||
|
||
Transaction malleability will not negatively impact the correctness of this process. Even if a wallet client follows this process using unconfirmed UTXOs as inputs and an attacker changes modifies the blockchain’s record of the hash of the previous transaction, the wallet client will include the invalidated previous transaction hash in its input data, and will still correctly sort with respect to that invalidated hash. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is malleability even relevant? I don't foresee this being a common question to ask, but, I guess it doesn't hurt to leave it in.
@kristovatlas, @petertodd thoughts on integrating the anti-fee-sniping behaviour (see bitcoin/bitcoin#6216) into BIP69? |
What's fee sniping? |
@kristovatlas to quote @petertodd from bitcoin/bitcoin#2340
TL;DR: stop miners attempting to orphan current blocks in an attempt to increase their fee subsidy reward, enforced by transactions setting their 'minimum' inclusion time as the current block height. How that is relevant to this BIP is that it does mean transactions are more easily recognized due to |
I can sort of see the relationship there, but I'd prefer to keep this BIP straightforward and restricted to advice to Bitcoin wallet clients. |
Thanks a lot! I will add links to these in the BIP. |
I tried rebasing my local copy but to no avail, so I'm going to try submitting a new PR... |
Conflicts: README.mediawiki
Looks like I managed to resolve them. Please consider merging, @laanwj |
@kristovatlas any chance of addressing the comments I made above? (on the diff) |
@dcousens: Thanks for your feedback. I already spent a long time editing the BIP based on prior feedback and I'm not really interested in spending more editing for the sake of succinctness, which comes with trade-offs. When I interacted with open source contributors to wallets on this topic, I found that they primarily wanted more detail about the scheme and not less. Keep in mind that the audience for BIPs is not necessarily restricted to people who religiously read the dev mailing list -- not that you are suggesting this, it's just a helpful reference point. |
@kristovatlas if possible, I'd prefer to stay away from heresay, as, in my experience, I've only heard the opposite in regards to developer opinion on this BIP. #157 (comment) does not make any sense [to me], although it seems well intentioned, I can't imagine why you have accounted for it, could you clarify that? The BIP is currently a very long explanation for the following algorithm (pseudocode): inputs.sort((a, b) => {
return compare(a.txHash, b.txHash, 32) || a.vout - b.vout
})
outputs.sort((a, b) => {
return a.value - b.value || compare(a.script, b.script, MIN(a.script.length, b.script.length))
}) Where
Very easy to find, very easy to research. I'd really like to see this BIP get through, but as an open source library implementer, it took me more time to decipher the paragraphs behind this BIP than it did to write the ~20 line I'm not trying to be hostile, I'm genuinely just trying to improve the ecosystem, so please don't take these comments the wrong way. |
Okey doke. I don't think this matters at all and is a waste of my time. If you want to fork and make a pull request to my repo, I will promise to review it promptly, however. |
This reverts commit c6ed18d.
@dcousens Any thoughts on if you will try a revision. What you wrote there looks like a reasonable simplification which could be merged with Kristov's work. |
@gmaxwell waiting on kristovatlas#1 |
ACK |
Thanks for the editing help, @dcousens |
@laanwj ping |
1 similar comment
@laanwj ping |
README.mediawiki and bip-0069/bip-0069_examples.py are missing EOF newlines. Anything else needed before merging this draft? |
“README.mediawiki and bip-0069/bip-0069_examples.py are missing EOF newlines. Anything else needed before merging this draft?” — @luke-jr
done |
Added BIP 69: Lexicographical Indexing of Inputs and Outputs
minimum-depth is no longer in the opening message. Closes: bitcoin#157 Signed-off-by: Rusty Russell <[email protected]>
Lexicographical Indexing of Transaction Inputs and Outputs