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 OP_RETURN into ord wallet send #3067

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grdddj
Copy link

@grdddj grdddj commented Jan 30, 2024

Fixes #3007:

  • adds a new op-return flag to ord wallet send that allows for sending some smaller data in OP_RETURN

Next steps/improvements:

  • adding tests
  • addressing TODOs

Possible next steps:

  • support even multiple OP_RETURNs in one transaction (if possible)
  • add OP_RETURN possibility even to the minting transaction

@raphjaph
Copy link
Collaborator

raphjaph commented Feb 2, 2024

Could you expand a bit on the use cases for this?

@grdddj grdddj marked this pull request as draft February 29, 2024 08:01
@grdddj
Copy link
Author

grdddj commented Feb 29, 2024

Could you expand a bit on the use cases for this?

The use-case is when transferring the inscription between addresses, create some possibility to add some metadata/info to the transfer itself.

Concrete example:

  • inscriptions are held by a service in one wallet, but "owned" by multiple customers of this service (on different addresses)
  • the service allows for on-chain transfer of these inscriptions/certificates, so the transfer of ownership is transparent and verifiable
  • OP_RETURN adds the nice possibility to specify e.g. the price in BTC that one user paid to buy the certificate from the other user
  • the idea is that these OP-returns will be nicely visible e.g. on mempool.space (in the future maybe even in ord explorer) and will add more transparency to the transfer (or any other on-chain action)

image

Marked it as a draft for now, hopefully, I will have time to finish it soon. Thanks :)


if let Some(op_return) = self.op_return {
// TODO: improve the check for checking byte-length
assert!(op_return.len() <= 80);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assert!(op_return.len() <= 80);
assert!(op_return.len() <= 82);

Comment on lines +39 to +40
use bitcoin::blockdata::script::PushBytesBuf;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Inline with the other imports

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.

Feature request: ord wallet send has the possibility of adding OP_RETURN data
2 participants