-
Notifications
You must be signed in to change notification settings - Fork 38.7k
rpc: Add a parameter to sendrawtransaction which sets a maximum value for unspendable outputs. #25943
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
Conversation
10ec3ca to
dd79c5f
Compare
|
Concept ACK I am not sure about name of this argument: |
|
Concept ACK |
|
Concept ACK I agree on @1440000bytes about the name of the argument |
dd79c5f to
b829861
Compare
|
@1440000bytes @brunoerg You are right about the name, I am not sure if the name should be something like |
|
Concept ACK |
b829861 to
1e047b1
Compare
7e486fc to
17f8542
Compare
|
I have some questions:
|
|
Also, I apologize for the obscene number of force pushes when my first edit fails CI because of a silly mistake, I realize this makes review more of a pain, going forward I'll run the test suite locally before force pushing. |
ghost
left a comment
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.
Tested maxburnamount parameter added in sendratransaction RPC and it works as expected:
-
Create a transaction in electrum (signet) with
OP_RETURN 74657374in 'payto' and0.0001in amount. Sign and copy the transaction hex. -
Try to broadcast transaction in bitcoin core with default settings and custom burn amount:
$ bitcoin-cli sendrawtransaction 020000000001019bc0177bd2816b10daecd76401ccbacffa8b4d83c3a1c8f6461fb0c88633de840000000000fdffffff021027000000000000066a047465737430f4080000000000160014d77709c50f964d6ccc668c3345a0dd9ba083e05c0247304402206a0d0cc140d9e99caccc776474669a57bac3f7e1c605b5b5ca7815d021e65ccd02200172ef8fe2693e2d4564b0aec5ebc28cc3c75f8475508a31b5a9c2271658b9c001210205e865e6c9b71d16ce7ba97b999db8a08115648abbaeca59bd462b0a8fd0054a209d0100
OP_RETURN output exceeds maximum set by maxburnamount (code -25)
$ bitcoin-cli -named sendrawtransaction hexstring=020000000001019bc0177bd2816b10daecd76401ccbacffa8b4d83c3a1c8f6461fb0c88633de840000000000fdffffff021027000000000000066a047465737430f4080000000000160014d77709c50f964d6ccc668c3345a0dd9ba083e05c0247304402206a0d0cc140d9e99caccc776474669a57bac3f7e1c605b5b5ca7815d021e65ccd02200172ef8fe2693e2d4564b0aec5ebc28cc3c75f8475508a31b5a9c2271658b9c001210205e865e6c9b71d16ce7ba97b999db8a08115648abbaeca59bd462b0a8fd0054a209d0100 maxburnamount=0.0001
76fe1211a1059ff9bcf6e2b330631c75b901e0884669ff47be82ec948d84e68c
src/util/error.cpp
Outdated
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.
| return Untranslated("OP_RETURN output exceeds maximum set by maxburnamount"); | |
| return Untranslated("OP_RETURN output exceeds maximum configured by user (-maxburnamount)"); |
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.
There's no commandline option like for maxfeerate so there shouldn't be a hyphen, but I'll change to configured by user, thanks.
I think you can just use the solver to check for NULL_DATA outputs. Everything else with an OP_RETURN is nonstandard and is thus rejected anyway (regardless of amount), unless the user modified the settings or the source code. |
17f8542 to
83882e6
Compare
|
I have changed the |
|
As a side note: would it make sense to have an overloaded |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsNo conflicts as of last run. |
|
It may also check for |
ce5f09e to
d4eb4c8
Compare
7f40c73 to
ab8c380
Compare
|
Rebased, I have adjusted the language to indicate that the check is for provable unspendability, instead of just datacarrier txn's and changed the check to use both It seems to me that care should be taken that there are never any previously spendable and legitimate transactions that |
|
ACK ab8c380a7370e29dfedce1399ad1b2a2d234915e
Even if there are, a suitable workaround is to just set |
glozow
left a comment
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.
ACK ab8c380a73 but I think one of the docs is a bit misleading
…o sendrawtransaction. 'maxburnamount' sets a maximum value for outputs heuristically deemed unspendable including datacarrier scripts that begin with `OP_RETURN`.
Co-authored-by: glozow <[email protected]>
ab8c380 to
7013da0
Compare
|
Force-pushed to address @glozow review. |
|
reACK 7013da0 |
|
re-ACK 7013da0 |
This PR adds a user configurable, zero by default parameter —
maxburnamount— tosendrawtransaction. This PR makes bitcoin core reject transactions that contain unspendable outputs which exceedmaxburnamount. closes #25899.As a result of this PR,
sendrawtransactionwill by default block 3 kinds of transactions:OP_RETURN- (datacarriers)The user is able to configure a
maxburnamountthat will override this check and allow a user to send a potentially unspendable output into the mempool.I see two legitimate use cases for this override:
OP_RETURNfor datacarrier transactions that embed data into the blockchain.