<p>I think you ask about escrow services in lightning. Generally there is a good opportunity to work with preimages. For example if we would move away from sha256 and would use ecdsa public private key encryption or a homomorphic hash function. Several parties could collaborative create a payment hash Wo sich they could only together generate the preimage. Stuff like this would also be possible with scriptless scripts. Also multiparty channels and channel factories could yield such functionality. So yes generally it is possible with lightning to go down this road but currently nothing of that is implemented to the protocol. </p>

CC BY-SA 4.0
2019-04-26T22:44:15.530Z
// , What, pray tell, is a "scriptless script"? (I'm reading up on it now, btw: https://duckduckgo.com/?q=scriptless+script)
Nathan Basanese
CC BY-SA 4.0
2019-04-27T04:37:07.523Z
https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-May/001297.html
Rene Pickhardt
CC BY-SA 4.0
2019-04-26T18:52:06.037Z
2019-04-26T18:52:06.037Z
Rene Pickhardt
<p>I asked @roasbeef last night, and he mentioned that Lightning may soon support multicontrol payments.</p>

<p>I'll add more details once I do some reading on the mailing list.</p>

CC BY-SA 3.0
2017-03-28T18:28:14.920Z
2017-06-26T21:20:48.770Z
2017-06-26T21:20:48.770Z
Nathan Basanese
<p>An oracle can be created on lightning if users set up their HTLCs in such a way that a third party can settle or cancel a bitcoin payment from one party to the other and thus resolve a contract without the oracle ever taking custody of either party’s funds.</p>
<p>How it would work is this: one or both counterparties deposit funds to an HTLC where the oracle can withdraw the funds if it learns the hashlock key and where the hashlock key is only known to that HTLC’s depositor’s counterparty. The result is one or two funded HTLCs.</p>
<p>Next, the oracle prepares an additional HTLC with the counterparty who did not deposit funds. (If both deposited funds, he creates a second HTLC with both.) This second HTLC uses a hashlock identical to the one known by the party with whom it is created. However, no one deposits funds to this HTLC yet. Instead, the oracle assesses the outcome of a real world event.</p>
<p>After the real world event happens, the oracle picks a “winner” and deposits funds into the unfunded HTLC which will be withdrawable by the winner if and only if he or she provides the hashlock key to that contract. If he or she does so, the oracle now has the hashlock key it needs to withdraw the funds that come from the other party -- the “loser” -- thus reimbursing the oracle with the loser’s money.</p>
<p>The timelock on the HTLC that the winner originally deposited funds into will eventually expire, and at that point the winner can recover the funds he or she deposited into that HTLC. The loser gets nothing and cannot recover any funds because that money went into the oracle’s pocket when the oracle reimbursed itself.</p>
<p>An implementation of this for the lightning network is here: <a href="https://github.com/supertestnet/hodlcontracts" rel="nofollow noreferrer">https://github.com/supertestnet/hodlcontracts</a></p>

CC BY-SA 4.0
2021-09-14T20:41:34.717Z
You should mention that you're affiliated with the link you added.  Otherwise, this just looks like spam.
Hannah Vernon
CC BY-SA 4.0
2021-09-02T13:36:28.827Z
2021-09-02T13:36:28.827Z
Super Testnet
<p>I'm not asking for "multisig on the lightning network", but I'm more curious about how one would set up shared control over lightning network transactions in general. </p>

<p>Imagine we don't have a multisig transaction... would it be possible to set up some sort of 3rd party oracle that would "link" a channel? </p>

<p>Or maybe set up some sort of logic implemented by the opening or closing of payment channels on a boutique lightning network? </p>

<p>In 2.2 of the lightning network paper, it says that opening payment channels doesn't actually control the movement of any funds. 
<a href="https://lightning.network/lightning-network-paper.pdf" rel="nofollow noreferrer">https://lightning.network/lightning-network-paper.pdf</a></p>

<p>Some folks came up with an idea for a way to pay an oracle for provable information (especially information that can <em>best</em> be obtained in from a lot of different decentralized nodes at "anti-affinitied" locations) using lightning &amp; bcoin: <a href="https://github.com/michaelfolkson/bcoin-hackathon" rel="nofollow noreferrer">https://github.com/michaelfolkson/bcoin-hackathon</a></p>

<p>My brother wrote an implementation of NAND gates here, <a href="https://github.com/rjb25/gate-wiring" rel="nofollow noreferrer">https://github.com/rjb25/gate-wiring</a> , and since considering both of these I wondered whether one might hook up some sort of gating system whereby a third party could make a decision about two possibilities for distribution of the funds of another two parties. </p>

<p>And now I'm wondering if it'd be possible to set up some sort of private lightning network that uses the opening and closing of payment channels (or resizing them) to do some kind of third party authorization logic for lightning payments?</p>

<p>Perhaps where one person (party A) receives some amount of bitcoin in one case, and another (party B) in a different case, as determined by a third party oracle or mod? </p>

CC BY-SA 3.0
2017-03-27T21:08:04.983Z
Is there any particular reason why you are typing // everywhere?  It doesn't do anything as far as I know.
Nate Eldredge
CC BY-SA 3.0
2017-03-27T21:17:14.993Z
@NateEldredge: I was just editing the same post for the same reason.— Nathan Basanese: please stop doing this. While it may give your posts some additional attention for a moment due to the visual clutter, you're creating unnecessary work for other users.
Murch
CC BY-SA 3.0
2017-03-28T18:23:06.770Z
// , :) I guess not everyone on here can be expected to have a sense of humor about such things
Nathan Basanese
CC BY-SA 3.0
2017-03-28T18:28:03.307Z
// , Do you have any comments about the question itself, or just style guides? I think some stackexchange fora have style guides. Would you link me to the one for bitcoin.stackexchange.com?
Nathan Basanese
CC BY-SA 3.0
2017-03-28T18:51:36.800Z
@NathanBasanese Honestly, I can't tell what you're asking. e.g. `[..] came up with an idea for a way to pay an oracle [..] using lightning & bcoin` What information are we paying for? Why do we trust this oracle to provide it? `My brother wrote an implementation of NAND gates here` That's cool, but what relationship does this have to the rest of the question? You're asking for something that is explicitly not multisig, but it sounds like multisig makes the most sense for your use case.
Nick ODell
CC BY-SA 3.0
2017-03-28T19:52:31.153Z
// , Ah, yes, good questions. I could probably stand to organize the semantics of this a bit better. I wrote it up while talking to someone about this under the assumption that one would have to set up some sort of NAND gate style of logic using the opening or closing of payment channels. From what I've found out so far since I wrote this, "**multisig**" is not supported in the same sense as in bitcoin, but the idea of shared control is possible. More to follow.
Nathan Basanese
<micropaymentchannels><lightning-routing><oracle>
Is there some way to add a third party authorizer to (or by) a lightning network transaction?
Nathan Basanese
# Is there some way to add a third party authorizer to (or by) a lightning network transaction?

(Asked by: username_0 on 2017-03-27)

I'm not asking for "multisig on the lightning network", but I'm more curious about how one would set up shared control over lightning network transactions in general.

Imagine we don't have a multisig transaction... would it be possible to set up some sort of 3rd party oracle that would "link" a channel?

Or maybe set up some sort of logic implemented by the opening or closing of payment channels on a boutique lightning network?

In 2.2 of the lightning network paper, it says that opening payment channels doesn't actually control the movement of any funds.
<https://lightning.network/lightning-network-paper.pdf>

Some folks came up with an idea for a way to pay an oracle for provable information (especially information that can *best* be obtained in from a lot of different decentralized nodes at "anti-affinitied" locations) using lightning & bcoin: <https://github.com/michaelfolkson/bcoin-hackathon>

My brother wrote an implementation of NAND gates here, <https://github.com/rjb25/gate-wiring> , and since considering both of these I wondered whether one might hook up some sort of gating system whereby a third party could make a decision about two possibilities for distribution of the funds of another two parties.

And now I'm wondering if it'd be possible to set up some sort of private lightning network that uses the opening and closing of payment channels (or resizing them) to do some kind of third party authorization logic for lightning payments?

Perhaps where one person (party A) receives some amount of bitcoin in one case, and another (party B) in a different case, as determined by a third party oracle or mod?

**Tags:** micropaymentchannels, lightning-routing, oracle

> **Comments:**
> **username_1**: Is there any particular reason why you are typing // everywhere?  It doesn't do anything as far as I know.  
> **username_2**: @username_1: I was just editing the same post for the same reason.— username_0: please stop doing this. While it may give your posts some additional attention for a moment due to the visual clutter, you're creating unnecessary work for other users.  
> **username_0**: // , :) I guess not everyone on here can be expected to have a sense of humor about such things  
> **username_0**: // , Do you have any comments about the question itself, or just style guides? I think some stackexchange fora have style guides. Would you link me to the one for bitcoin.stackexchange.com?  
> **username_3**: @username_0 Honestly, I can't tell what you're asking. e.g. `[..] came up with an idea for a way to pay an oracle [..] using lightning & bcoin` What information are we paying for? Why do we trust this oracle to provide it? `My brother wrote an implementation of NAND gates here` That's cool, but what relationship does this have to the rest of the question? You're asking for something that is explicitly not multisig, but it sounds like multisig makes the most sense for your use case.  
> **username_0**: // , Ah, yes, good questions. I could probably stand to organize the semantics of this a bit better. I wrote it up while talking to someone about this under the assumption that one would have to set up some sort of NAND gate style of logic using the opening or closing of payment channels. From what I've found out so far since I wrote this, "**multisig**" is not supported in the same sense as in bitcoin, but the idea of shared control is possible. More to follow.  

---

## 3 answers

### Answer by username_4 on 2019-04-26. Score: 1 | Accepted answer

I think you ask about escrow services in lightning. Generally there is a good opportunity to work with preimages. For example if we would move away from sha256 and would use ecdsa public private key encryption or a homomorphic hash function. Several parties could collaborative create a payment hash Wo sich they could only together generate the preimage. Stuff like this would also be possible with scriptless scripts. Also multiparty channels and channel factories could yield such functionality. So yes generally it is possible with lightning to go down this road but currently nothing of that is implemented to the protocol.

> **Comments:**
> **username_0**: // , What, pray tell, is a "scriptless script"? (I'm reading up on it now, btw: https://duckduckgo.com/?q=scriptless+script)  
> **username_4**: https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-May/001297.html  

---

### Answer by username_0 on 2017-03-28. Score: 0

I asked @roasbeef last night, and he mentioned that Lightning may soon support multicontrol payments.

I'll add more details once I do some reading on the mailing list.


---

### Answer by username_5 on 2021-09-02. Score: 0

An oracle can be created on lightning if users set up their HTLCs in such a way that a third party can settle or cancel a bitcoin payment from one party to the other and thus resolve a contract without the oracle ever taking custody of either party’s funds.

How it would work is this: one or both counterparties deposit funds to an HTLC where the oracle can withdraw the funds if it learns the hashlock key and where the hashlock key is only known to that HTLC’s depositor’s counterparty. The result is one or two funded HTLCs.

Next, the oracle prepares an additional HTLC with the counterparty who did not deposit funds. (If both deposited funds, he creates a second HTLC with both.) This second HTLC uses a hashlock identical to the one known by the party with whom it is created. However, no one deposits funds to this HTLC yet. Instead, the oracle assesses the outcome of a real world event.

After the real world event happens, the oracle picks a “winner” and deposits funds into the unfunded HTLC which will be withdrawable by the winner if and only if he or she provides the hashlock key to that contract. If he or she does so, the oracle now has the hashlock key it needs to withdraw the funds that come from the other party -- the “loser” -- thus reimbursing the oracle with the loser’s money.

The timelock on the HTLC that the winner originally deposited funds into will eventually expire, and at that point the winner can recover the funds he or she deposited into that HTLC. The loser gets nothing and cannot recover any funds because that money went into the oracle’s pocket when the oracle reimbursed itself.

An implementation of this for the lightning network is here: <https://github.com/username_5/hodlcontracts>

> **Comments:**
> **username_6**: You should mention that you're affiliated with the link you added.  Otherwise, this just looks like spam.  

---

