extension icon indicating copy to clipboard operation
extension copied to clipboard

Add `OP_RETURN` field to sendTransfer method

Open mefrem opened this issue 2 years ago • 4 comments

Currently, in order to pass data to a Bitcoin transaction's OP_RETURN field, front-end devs have to construct a PSBT and use the PSBT API. Can this method be extended to include fields for OP_RETURN (for instance, for including the Hiro Wallet authenticated Stacks address so that it exists on-Bitcoin-chain)?

cc: @kenrogers

mefrem avatar Jul 07 '23 16:07 mefrem

We've been discussing this as a team and erring towards keeping the sendTransfer method you've referenced simple (with the idea that PSBTs are best for more advanced use cases, since by nature they provide a ton of extensibility). However, there's certainly a trade-off here to requiring users to construct PSBTs as you've indicated.

Would it be sufficiently helpful if we provided guidance on how to construct PSBTs, especially ones with OP_RETURN data?

markmhendrickson avatar Jul 10 '23 11:07 markmhendrickson

I'm not in this conversation, but to me - Yes it would defintily have been useful to see a full end to end example of psbts: I've been asking for this elsewhere and was asked to instead provide example of how I would do it without hiro at all. Im kinda there now anyway via trail and error.... however still riding into some gochyas arround legacy addresses which I am asking about in your discord.

Iheff avatar Jul 10 '23 11:07 Iheff

@markmhx that would be great and I think would sufficiently solve the problem.

kenrogers avatar Jul 10 '23 12:07 kenrogers

Speaking with some external parties, this is a common and quite useful use-case. As it's often used as a memo, of sorts, it seems reasonable sendTransfer would include this ability.

kyranjamie avatar Jul 22 '24 08:07 kyranjamie