Skip to content

Add data as output (via OP_RETURN)#460

Merged
notmandatory merged 4 commits intobitcoindevkit:masterfrom
RCasatta:add_data
Nov 9, 2021
Merged

Add data as output (via OP_RETURN)#460
notmandatory merged 4 commits intobitcoindevkit:masterfrom
RCasatta:add_data

Conversation

@RCasatta
Copy link
Copy Markdown
Member

@RCasatta RCasatta commented Oct 27, 2021

Description

This PR add a method fn add_data(&mut self, data: &[u8]) to the TxBuilder as a shortcut to build an op_return output.

Notes to the reviewers

To allow sending outputs with 0 value, the dust check has been modified, excluding from the check scripts that are provably unspendable.

As briefly discussed in the call, while using op_return may be controversial, it exists and it's always better than the alternative for embedding data. For this reasons wallet like bitcoin core and electrum allow to create transactions with it

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature
  • I've updated CHANGELOG.md

@RCasatta RCasatta marked this pull request as ready for review October 28, 2021 08:08
Comment thread src/testutils/blockchain_tests.rs Outdated
@RCasatta
Copy link
Copy Markdown
Member Author

RCasatta commented Nov 9, 2021

I had to rebase because of a conflict in CHANGELOG

Copy link
Copy Markdown
Member

@notmandatory notmandatory left a comment

Choose a reason for hiding this comment

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

ACK aa075f0

@notmandatory notmandatory merged commit aa075f0 into bitcoindevkit:master Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants