Skip to content
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

BIP 337: Compressed Transactions #1556

Merged

Conversation

TomBriar
Copy link
Contributor

@TomBriar TomBriar commented Mar 5, 2024

This document proposes a serialization scheme for compressing bitcoin transactions. The compressed bitcoin transactions can reach a serialized size of less than 50% of the original serialized transaction. One of the methods for compressing, involves reducing the transaction outpoints in a potentially lossy way, therefore it is an optional path for compression. Without compressing the outpoints, compressed transactions still reach less then 70% of the original size.

Reference Implementation:
bitcoin/bitcoin#29134

The reference implementation includes two new RPC endpoints to demonstrate how to use compressed transactions. The compressrawtransaction takes in a raw hex-encoded transaction and returns a compressed hex-encoded transaction, while the decompressrawtransaction accepts a compressed hex-encoded transaction and returns the original raw hex-encoded transaction.

Thanks-
Tom.

@apoelstra
Copy link
Contributor

Hi Tom,

Thanks for posting this. I'd suggest rewording the abstract and PR description to avoid talking in terms of Core internals (classes, subclasses, etc) and instead simply describe the serialization. It's fine to describe suggested RPC endpoints since these give an idea of how the specification might be used.

@TomBriar TomBriar force-pushed the bip-tombriar-compressed-transactions branch 3 times, most recently from be1f84e to e5af215 Compare April 1, 2024 20:07
@TomBriar TomBriar force-pushed the bip-tombriar-compressed-transactions branch from e5af215 to b6be561 Compare April 15, 2024 15:56
Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Light first review. Looks pretty good, could you please add the mandatory "Backwards Compatibility" section (even if it just says that there are no concerns) and take a look at the preamble?

bip-tombriar-compressed-transactions.mediawiki Outdated Show resolved Hide resolved
bip-tombriar-compressed-transactions.mediawiki Outdated Show resolved Hide resolved
bip-tombriar-compressed-transactions.mediawiki Outdated Show resolved Hide resolved
@murchandamus murchandamus added the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label May 14, 2024
@TomBriar TomBriar force-pushed the bip-tombriar-compressed-transactions branch from b6be561 to 95fbf60 Compare May 14, 2024 16:34
@TomBriar
Copy link
Contributor Author

Thank you @murchandamus, all changes were accepted!

@murchandamus murchandamus removed the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label May 14, 2024
@murchandamus
Copy link
Contributor

Thanks, I aim to give this a proper review soon

Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @TomBriar, I went over the complete document, the Bitcoin Core pull request, and the mailing list. Your document almost fulfills the formatting requirements, I left one nit and one open question that you may want to consider. The description is clear, concise, and appears to be comprehensive. Since the Bitcoin Core pull request was closed, I was wondering whether this proposal is actively deployed by other software (although that is not necessary for this to be merged).

bip-tombriar-compressed-transactions.mediawiki Outdated Show resolved Hide resolved
bip-tombriar-compressed-transactions.mediawiki Outdated Show resolved Hide resolved
@murchandamus
Copy link
Contributor

Hey @TomBriar, I’m not sure what happened here, it looks like you started working on this, but maybe you did not push the changes yet?

If the answer to my two open questions would be that alternative designs are not relevant, and the proposal is currently not implemented in any software that would be satisfactory answers to me—I just thought if those answers were different it would be nice to mention it.

As soon as you push your changes, I can take it from there. The only things missing would be to assign a number and merge it, which I can take care of.

@TomBriar
Copy link
Contributor Author

@murchandamus Hi, Yes there is actually a relevant implementation I am finishing the finial touches on it today and I'll link it all together and have this ready to go by EOD. Thank you for your patience!

Thanks-
Tom.

@murchandamus
Copy link
Contributor

I see, thanks for the update!

@TomBriar
Copy link
Contributor Author

Hi,

Just pushed changes that address all of the above reviews, As stated, there is a project that I am aware of that will enable people to use steganography to encode data into images although it is not complete and I was not given an ETA. That said I have built a tool that implements the scheme described here. The hope is that with this BIP, future projects will all use this scheme for compressed Bitcoin transactions, and potentially bitcoin core itself can use parts of it in P2P or Block Storage.

https://github.com/TomBriar/compressed_transactions

Thanks-
Tom.

@murchandamus
Copy link
Contributor

Hey, you wrote that you pushed, but I don’t see a change. Could you check whether the push went through?

@TomBriar TomBriar force-pushed the bip-tombriar-compressed-transactions branch from 95fbf60 to a4089c8 Compare May 28, 2024 18:14
Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotted a missing word here, but otherwise LGTM.

bip-tombriar-compressed-transactions.mediawiki Outdated Show resolved Hide resolved
@murchandamus
Copy link
Contributor

I assign this BIP 337

@murchandamus murchandamus changed the title bip-tombriar-compressed-transactions BIP 337: Compressed Transactions May 28, 2024
@TomBriar TomBriar force-pushed the bip-tombriar-compressed-transactions branch from a4089c8 to 3c32769 Compare May 28, 2024 18:29
@TomBriar
Copy link
Contributor Author

Hi, Thanks!

I made that change and fixed the BIP number field.

-Tom

@murchandamus murchandamus force-pushed the bip-tombriar-compressed-transactions branch from 4cdcce6 to 7847554 Compare May 28, 2024 18:43
@murchandamus murchandamus force-pushed the bip-tombriar-compressed-transactions branch from 7847554 to f240c40 Compare May 28, 2024 18:45
@murchandamus
Copy link
Contributor

I fixed the Comments-URI header, added an entry in the README.mediawiki table, and moved your BIP to the numbered file

@TomBriar
Copy link
Contributor Author

Awesome thank you!

@murchandamus murchandamus merged commit 79be0f9 into bitcoin:master May 28, 2024
3 checks passed
@murchandamus
Copy link
Contributor

Thank you, and congrats! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants