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

Add data as output (via OP_RETURN) #460

Merged
merged 4 commits into from
Nov 9, 2021

Conversation

RCasatta
Copy link
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
@RCasatta
Copy link
Member Author

RCasatta commented Nov 9, 2021

I had to rebase because of a conflict in CHANGELOG

Copy link
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