Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Sending OP_RETURN via Bitcoin Lightning

9 messages, Dec 6 to 9, 2021. Started by Undiscussed Horrific Abuse, One Victim of Many.

Christian Moss (3), Peter Todd (3), Undiscussed Horrific Abuse, One Victim of Many, Martin Habovštiak, Alex Schoof

Permalink First message in the Wayback Machine

Undiscussed Horrific Abuse, One Victim of Many permalinkalso on bitcoin-dev original

Hi,

I'm not a bitcoin developer.

On Mon, Dec 6, 2021, 5:05 AM Héctor José Cárdenas Pacheco via bitcoin-dev < bitcoin-dev at lists.linuxfoundation.org> wrote:

Quoted text (6 lines)
> Hello all,
>
> I’ve been thinking about how OP_RETURN is being used to create and trade
> NFTs on Bitcoin (think RarePepes, SoG and other new ones) and was wondering
> if it’s possible to
>

Do you have a link to any of these protocols?

make transactions with this opcode via Lightning.

Quoted text (9 lines)
>
> More specific questions could be:
>
>    1. Can opcodes like OP_RETURN be inside a channel’s opening or closing
>    transaction?
>    2. If so, could that OP_RETURN change hands within that channel or
>    network of channels?
>
> OP_RETURNs do not have ownership according to the bitcoin network.  It is

not hard to define a protocol that associates an OP_RETURN with ownership, and ownership could then be transferred via lightning by sending associated currency via lightning. Robustness improvements seem possible.

Quoted text (5 lines)
>    1. If possible, could the OP_RETURN be divisible? Could one person
>    send a piece of a OP_RETURN just like one can do right now on the primary
>    ledger or would it need to maintain the OP_RETURN code intact?
>
> OP_RETURNs themselves do not have ownership, but you can define a protocol

that gives them divisible ownership, including via lightning.

I’m assuming that, if possible, this would need a protocol layer parallel

Quoted text (14 lines)
> to Bitcoin/Lightning that stores and reads all Bitcoin transactions and the
> ones which involve the node's channels as well as the ones with the
> OP_RETURN, just like CounterParty does right now with the primary ledger.
>
> Thank in advance.
> ——
>
> *Héctor Cárdenas*@hcarpach
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
Martin Habovštiak in reply to Undiscussed Horrific Abuse, One Victim of Many permalinkalso on bitcoin-dev original

I recommend you researching RGB: https://rgb-org.github.io/

On Mon, Dec 6, 2021, 11:21 Karl <gmkarl at gmail.com> wrote:

Quoted text (58 lines)
> Hi,
>
> I'm not a bitcoin developer.
>
> On Mon, Dec 6, 2021, 5:05 AM Héctor José Cárdenas Pacheco via bitcoin-dev <
> bitcoin-dev at lists.linuxfoundation.org> wrote:
>
>> Hello all,
>>
>> I’ve been thinking about how OP_RETURN is being used to create and trade
>> NFTs on Bitcoin (think RarePepes, SoG and other new ones) and was wondering
>> if it’s possible to
>>
>
> Do you have a link to any of these protocols?
>
> make transactions with this opcode via Lightning.
>>
>> More specific questions could be:
>>
>>    1. Can opcodes like OP_RETURN be inside a channel’s opening or
>>    closing transaction?
>>    2. If so, could that OP_RETURN change hands within that channel or
>>    network of channels?
>>
>> OP_RETURNs do not have ownership according to the bitcoin network.  It is
> not hard to define a protocol that associates an OP_RETURN with ownership,
> and ownership could then be transferred via lightning by sending associated
> currency via lightning.  Robustness improvements seem possible.
>
>
>>    1. If possible, could the OP_RETURN be divisible? Could one person
>>    send a piece of a OP_RETURN just like one can do right now on the primary
>>    ledger or would it need to maintain the OP_RETURN code intact?
>>
>> OP_RETURNs themselves do not have ownership, but you can define a
> protocol that gives them divisible ownership, including via lightning.
>
> I’m assuming that, if possible, this would need a protocol layer parallel
>> to Bitcoin/Lightning that stores and reads all Bitcoin transactions and the
>> ones which involve the node's channels as well as the ones with the
>> OP_RETURN, just like CounterParty does right now with the primary ledger.
>>
>> Thank in advance.
>> ——
>>
>> *Héctor Cárdenas*@hcarpach
>>
>> _______________________________________________
>> bitcoin-dev mailing list
>> bitcoin-dev at lists.linuxfoundation.org
>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
Christian Moss in reply to Undiscussed Horrific Abuse, One Victim of Many permalinkalso on bitcoin-dev original

Hi, it is not really possible in the way you think, mainly because lightning relies on liquidity to work, i.,e. lots of bitcoin locked up in channels to allow liquidity, NFTs are not liquid, so if you have 1 NFT then it would be impossible to send on the network

I think the best off chain solution to NFTs on bitcoin is using Ruben Somsens state chain protocol, which allows you to swap utxos off chain, and those off chain utxos could harbour an op return/nft

On Mon, Dec 6, 2021 at 10:36 AM Karl via bitcoin-dev < bitcoin-dev at lists.linuxfoundation.org> wrote:

Quoted text (58 lines)
> Hi,
>
> I'm not a bitcoin developer.
>
> On Mon, Dec 6, 2021, 5:05 AM Héctor José Cárdenas Pacheco via bitcoin-dev <
> bitcoin-dev at lists.linuxfoundation.org> wrote:
>
>> Hello all,
>>
>> I’ve been thinking about how OP_RETURN is being used to create and trade
>> NFTs on Bitcoin (think RarePepes, SoG and other new ones) and was wondering
>> if it’s possible to
>>
>
> Do you have a link to any of these protocols?
>
> make transactions with this opcode via Lightning.
>>
>> More specific questions could be:
>>
>>    1. Can opcodes like OP_RETURN be inside a channel’s opening or
>>    closing transaction?
>>    2. If so, could that OP_RETURN change hands within that channel or
>>    network of channels?
>>
>> OP_RETURNs do not have ownership according to the bitcoin network.  It is
> not hard to define a protocol that associates an OP_RETURN with ownership,
> and ownership could then be transferred via lightning by sending associated
> currency via lightning.  Robustness improvements seem possible.
>
>
>>    1. If possible, could the OP_RETURN be divisible? Could one person
>>    send a piece of a OP_RETURN just like one can do right now on the primary
>>    ledger or would it need to maintain the OP_RETURN code intact?
>>
>> OP_RETURNs themselves do not have ownership, but you can define a
> protocol that gives them divisible ownership, including via lightning.
>
> I’m assuming that, if possible, this would need a protocol layer parallel
>> to Bitcoin/Lightning that stores and reads all Bitcoin transactions and the
>> ones which involve the node's channels as well as the ones with the
>> OP_RETURN, just like CounterParty does right now with the primary ledger.
>>
>> Thank in advance.
>> ——
>>
>> *Héctor Cárdenas*@hcarpach
>>
>> _______________________________________________
>> bitcoin-dev mailing list
>> bitcoin-dev at lists.linuxfoundation.org
>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
Christian Moss in reply to Martin Habovštiak permalinkalso on bitcoin-dev original

As far as I understand it, RGB doesn't scale NFTs as each transaction to transfer ownership of an NFT would require an onchain transaction

On Mon, Dec 6, 2021 at 3:44 PM Martin Habovštiak via bitcoin-dev < bitcoin-dev at lists.linuxfoundation.org> wrote:

Quoted text (67 lines)
> I recommend you researching RGB: https://rgb-org.github.io/
>
> On Mon, Dec 6, 2021, 11:21 Karl <gmkarl at gmail.com> wrote:
>
>> Hi,
>>
>> I'm not a bitcoin developer.
>>
>> On Mon, Dec 6, 2021, 5:05 AM Héctor José Cárdenas Pacheco via bitcoin-dev
>> <bitcoin-dev at lists.linuxfoundation.org> wrote:
>>
>>> Hello all,
>>>
>>> I’ve been thinking about how OP_RETURN is being used to create and trade
>>> NFTs on Bitcoin (think RarePepes, SoG and other new ones) and was wondering
>>> if it’s possible to
>>>
>>
>> Do you have a link to any of these protocols?
>>
>> make transactions with this opcode via Lightning.
>>>
>>> More specific questions could be:
>>>
>>>    1. Can opcodes like OP_RETURN be inside a channel’s opening or
>>>    closing transaction?
>>>    2. If so, could that OP_RETURN change hands within that channel or
>>>    network of channels?
>>>
>>> OP_RETURNs do not have ownership according to the bitcoin network.  It
>> is not hard to define a protocol that associates an OP_RETURN with
>> ownership, and ownership could then be transferred via lightning by sending
>> associated currency via lightning.  Robustness improvements seem possible.
>>
>>
>>>    1. If possible, could the OP_RETURN be divisible? Could one person
>>>    send a piece of a OP_RETURN just like one can do right now on the primary
>>>    ledger or would it need to maintain the OP_RETURN code intact?
>>>
>>> OP_RETURNs themselves do not have ownership, but you can define a
>> protocol that gives them divisible ownership, including via lightning.
>>
>> I’m assuming that, if possible, this would need a protocol layer parallel
>>> to Bitcoin/Lightning that stores and reads all Bitcoin transactions and the
>>> ones which involve the node's channels as well as the ones with the
>>> OP_RETURN, just like CounterParty does right now with the primary ledger.
>>>
>>> Thank in advance.
>>> ——
>>>
>>> *Héctor Cárdenas*@hcarpach
>>>
>>> _______________________________________________
>>> bitcoin-dev mailing list
>>> bitcoin-dev at lists.linuxfoundation.org
>>> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>>>
>> _______________________________________________
>> Lightning-dev mailing list
>> Lightning-dev at lists.linuxfoundation.org
>> https://www.learnbitcoin.com/archive/lists/lightning-dev
>>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
Peter Todd in reply to Christian Moss permalinkalso on bitcoin-dev original

On Mon, Dec 06, 2021 at 04:35:19PM +0000, Christian Moss via bitcoin-dev wrote:

Quoted text (3 lines)
> As far as I understand it, RGB doesn't scale NFTs as each
> transaction to transfer ownership of an NFT would require an onchain
> transaction

RGB intends to scale NFTs and similar things in the future via scalable single-use-seals: https://petertodd.org/2017/scalable-single-use-seal-asset-transfer

Christian Moss in reply to Peter Todd permalinkalso on bitcoin-dev original

pete at petertodd.org, so single use seals require an onchain transaction to post the proof of publication to the ledger (assuming bitcoin is used as the ledger) when an asset is transferred, but it can scale because you can batch many proofs (transfer of ownerships) into a merkle tree and just add the merkle root into the single tx going into the ledger?

On Thu, Dec 9, 2021 at 9:13 AM Peter Todd <pete at petertodd.org> wrote:

Quoted text (13 lines)
> On Mon, Dec 06, 2021 at 04:35:19PM +0000, Christian Moss via bitcoin-dev
> wrote:
> > As far as I understand it, RGB doesn't scale NFTs as each
> > transaction to transfer ownership of an NFT would require an onchain
> > transaction
>
> RGB intends to scale NFTs and similar things in the future via scalable
> single-use-seals:
> https://petertodd.org/2017/scalable-single-use-seal-asset-transfer
>
> --
> https://petertodd.org 'peter'[:-1]@petertodd.org
>
Peter Todd in reply to Christian Moss permalinkalso on bitcoin-dev original

On Thu, Dec 09, 2021 at 09:49:11AM +0000, Christian Moss wrote:

Quoted text (5 lines)
> pete at petertodd.org, so single use seals require an onchain transaction to
> post the proof of publication to the ledger (assuming bitcoin is used as
> the ledger) when an asset is transferred, but it can scale because you can
> batch many proofs (transfer of ownerships) into a merkle tree and just add
> the merkle root into the single tx going into the ledger?

Exactly. And since the aggregation is trustless with respect to validity, users can choose what kind of censorship risk they're willing to take (as well as mitigate it with "multisig" schemes that use multiple aggregators in parallel).

Alex Schoof in reply to Peter Todd permalinkalso on bitcoin-dev original

The multisig scheme is interesting. From my understanding of Single Use Seals, since seal n commits to seal n+1, for the on-chain aggregation seals you would want to pick some common aggregation service provider ahead of time and if that provider disappears, you’re stuck and cant close the next seal. If instead you say “this seal commits to three of the five of these next seals” then you mitigate both availability and censorship risk. Am I getting that right?

Alex

On Thu, Dec 9, 2021 at 5:23 AM Peter Todd <pete at petertodd.org> wrote:

Quoted text (23 lines)
> On Thu, Dec 09, 2021 at 09:49:11AM +0000, Christian Moss wrote:
> > pete at petertodd.org, so single use seals require an onchain transaction
> to
> > post the proof of publication to the ledger (assuming bitcoin is used as
> > the ledger) when an asset is transferred, but it can scale because you
> can
> > batch many proofs (transfer of ownerships) into a merkle tree and just
> add
> > the merkle root into the single tx going into the ledger?
>
> Exactly. And since the aggregation is trustless with respect to validity,
> users
> can choose what kind of censorship risk they're willing to take (as well as
> mitigate it with "multisig" schemes that use multiple aggregators in
> parallel).
>
> --
> https://petertodd.org 'peter'[:-1]@petertodd.org
> _______________________________________________
> Lightning-dev mailing list
> Lightning-dev at lists.linuxfoundation.org
> https://www.learnbitcoin.com/archive/lists/lightning-dev
>
Peter Todd in reply to Alex Schoof permalinkalso on bitcoin-dev original

On Thu, Dec 09, 2021 at 07:12:45AM -0500, Alex Schoof wrote:

Quoted text (7 lines)
> The multisig scheme is interesting. From my understanding of Single Use
> Seals, since seal n commits to seal n+1, for the on-chain aggregation seals
> you would want to pick some common aggregation service provider ahead of
> time and if that provider disappears, you’re stuck and cant close the next
> seal. If instead you say “this seal commits to three of the five of these
> next seals” then you mitigate both availability and censorship risk. Am I
> getting that right?

Re: "some common aggregation service provider", you might be misunderstanding the protocol: since seals are trustless with regard to validity, I can validate your seal, regardless of which aggregation service you use.

But other than that, I think we're on the same page!

A concrete example would be an exchange: they do a lot of transactions, so they could choose to be their own aggregator, and wouldn't need any multisig at all because they can trust themselves not to censor themselves. :) Meanwhile, one of their customers might use 3-of-5 as you suggest, as they only do a few transactions a month.

Interestingly, in some scenarios it might be worthwhile to both run your own aggregator, and use multisig. Eg Alice could use a 2-of-3 with two third-party aggregators, and her own aggregation chain. If both third-parties are up, she does no on-chain transactions at all; if one third-party is down, she can use her own, and the remaining third-party. Thus she would only do an on-chain transaction to defeat censorship/failure.