Re: [Lightning-dev] Lightning over taproot with PTLCs

2021-10-10 Thread Jonas Nick

> H( private-key, msg, other-party's-nonce-pair, 1 )

That should work. I had thought that other-party's-nonce-pair would be unique
unknown randomness, but I can see now that it can be rederived from RA(n) or
RB(n).

> Hmm, you had me panicking that I'd been describing how to combine the
> two despite having decided it wasn't necessary to combine them...

Ah, should have read that part more closely. The proposal uses the single sig
adaptor sig variant.
___
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev


Re: [Lightning-dev] Lightning over taproot with PTLCs

2021-10-09 Thread Jonas Nick

Hi,

it seems like parts of this proposal rely on deterministic nonces in MuSig.
Generally, this is insecure unless combined with heavy machinery that proves
correctness of the nonce derivation in zero knowledge. If one signer uses
deterministic nonces and another signer uses random nonces, then two signing
sessions will have different challenge hashes which results in nonce reuse by
the first signer [0]. Is there a countermeasure against this attack in the
proposal? What are the inputs to the function that derive DA1, DA2? Is the
assumption that a signer will not sign the same message more than once?

It may be worth pointing out that an adaptor signature scheme can not treat
MuSig2 as a black box as indicated in the "Adaptor Signatures" section [1]. In
particular, generally the secret X must be input to the hash function that
generates nonce coefficient k. Otherwise, an attacker can grind through
challenge hashes by varying X without affecting the aggregate nonce and produce
a forgery. For the same reason, the message m is included in hash function
inputs of k. However, taking X into account when computing k shouldn't be an
issue for protocols making use of adaptor signatures because k does not need to
be determined before signing time and X is required to be known at that point
anyway.

[0] 
https://medium.com/blockstream/musig-dn-schnorr-multisignatures-with-verifiably-deterministic-nonces-27424b5df9d6
See "The attack works as follows."
[1] MuSig2 adaptor signature issue: 
https://github.com/ElementsProject/scriptless-scripts/issues/23,
PR: https://github.com/ElementsProject/scriptless-scripts/pull/24
___
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev


Re: [Lightning-dev] A Payment Point Feature Family (MultiSig, DLC, Escrow, ...)

2019-10-11 Thread Jonas Nick
> hashing out old ideas in public like an out-of-the-loop person

Being fully in-the-loop literally seems undesirable anyway. As the scriptless
scripts space gets bigger, I invite everyone to consider contributing to the
scriptless scripts repo at
https://github.com/ElementsProject/scriptless-scripts. This allows to have the
ideas at one place, improve them over time and standardize on terminology and
notation. In particular, the escrow idea seems quite established and would be a
nice to have written down comprehensively along with it's shortcomings.

> OR is harder

Unless you have additional requirements OR is simpler because it just means
creating and revealing the key to the other party. In your exmple "(A AND B) OR
(B AND C) OR (C AND A)", A and B can generate each generate their key and add
it. Then they each split their key into two shares, one is created by adding a
random scalar, the other by subtracting the same random scalar. They each
encrypt their first share to B and the second share to C. They do the same for
C and A. The receivers must check that they've received valid shares, i.e.
their shares sum up to the secret to the A + B key. That's not very efficient
because it requires a lot of communication, but I don't know of a better scheme
for general disjunctive normal forms like that and this helps as a mental
model. Any policy consisting of ANDs and ORs policy can be written in
disjunctive normal form and can therefore be constructed similar to above
example.


On 10/9/19 11:42 PM, Nadav Kohen wrote:
>  Hi list,
> 
> I'm back again with another idea about Payment Points and fun things to do
> with them! Hopefully this time I'm not entirely just hashing out old ideas
> in public like an out-of-the-loop person :)
> 
> *TLDR: Adding and ECDH-ing points gives us AND and OR functionality which
> we can compose to make cool lightning contracts like Multisig, Escrow, and
> DLCs*
> 
> So when looking at the following (likely incomplete) list of things you can
> do with payment points:
> 
> 1) Payment De-correlation
> 2) "Stuckless" Payments
> 3) High AMP
> 4) Selling Signatures
> 5) Selling Pedersen De-commitment
> 6) Escrow Contracts
> 
> I started of trying to classify what kind of thing these new features are
> in hopes of coming across new ones. The first three I clumped into a group
> I called "Payment point addition allows us to do cool things while
> maintaining the Proof of Payment (PoP) property". The next two (4 and 5) I
> called "Commitment applications where point is public". But ZmnSCPxj's
> proposal for lightning escrow contracts (
> https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-June/002028.html)
> struck me as something different that might somehow be made more general.
> 
> Essentially the idea is to use the point S + ECDH(B, E) where S is the
> seller's point, B is the buyer's point and E is the escrow's point. This
> means that the scalar can be discovered by the seller in collaboration with
> the buyer or the escrow, that is, S AND (B OR E). I propose that under
> certain circumstances (such as the parties involved being able to
> interact), this can be generalized to have payments conditioned on
> arbitrary AND/OR circuits.
> 
>  I believe that AND is very straightforward as you simply take two
> conditions A and B and add them together to get a point that requires both
> of their scalars are discoverable (except maybe under certain bad
> circumstances that can be avoided where like B = C - A, this must be
> guarded against).
> 
> OR is harder but I think that it can be achieved in the two party case by
> ECDH and in the n-party case by multi-party key exchanges (which I know
> pretty much nothing about other than that they exist). Given some key
> exchange protocol (preferably non-interactive), KE, KE(A_1, ..., A_n)
> should result in a number known only to those who know any scalar a_1, ...,
> a_n and no one else. Assuming this exists and we can manage to trustlessly
> (in some possibly stretched sense of the word) compute shared keys
> (including such things as KE(A+B, C)), then KE(A, B) acts as A OR B in our
> payment condition contract.
> 
> To restate the escrow contract idea in this setting, the payment is
> conditioned on S + KE(B, E). Important to note is that not all parties must
> know about the details of the payment itself: the Escrow in this example
> knows nothing about this payment (other than that some payment exists)
> unless there is a dispute.
> 
> Lastly, note that contracts following this scheme look indistinguishable to
> normal payments on the network, and are fully compatible with High AMPs
> since we can simply take the payment point specified by our contract and
> add that point to each partial payment point.
> 
> Well this is all nice in theory, but is there anything that will actually
> come out of this thinking? I'll detail the two things I've thought of so
> far for which I'd love critique! I'd also love to hear if anyone else
> 

Re: [Lightning-dev] Selling Signatures: Another Reason to Move to Payment Points

2019-07-20 Thread Jonas Nick
Perhaps worth noting that in addition to selling signatures, it's also possible
to sell blind Schnorr signatures [0] and anonymous credentials [1].

[0] 
https://github.com/ElementsProject/scriptless-scripts/blob/master/md/partially-blind-swap.md
[1] https://youtu.be/XORDEX-RrAI?t=26552, slides 
https://nickler.ninja/slides/2018-bob.pdf

On 7/17/19 3:37 PM, Nadav Kohen wrote:
> Hi All,
> 
> I recently posted a proposal here for a scheme through which a trusted data
> provider can utilize the Lightning Network to privately sell data where
> data is received atomically with purchase.
> 
> I've more recently been thinking about situations where a party, that is
> *not* trusted, is attempting to sell its signature to a known message. One
> example of a situation where this would be useful is if someone is trying
> to offer a DLC-like Option contract where they are essentially
> collateralizing themselves in a funding transaction and then selling their
> signatures to Contract Execution Transactions (CETs). In this example, we
> must ensure that the buyer of the signatures pays if and only if they
> receive valid signatures for the CETs which are known.
> 
> I believe that this is achievable in a relatively straightforward way if we
> were to use ZmnSCPxj's proposed payment points with scalars (as opposed to
> payment hashes with pre-images). The (Schnorr) signature seller could give
> the buyer their one-time public key, `R = k*G`, through which the buyer
> could compute the payment point whose scalar is the seller's signature:
> `sig*G = R + h(m, R)*A` where `A` is the seller's public key. Using this
> value as the payment point, the buyer could be assured that they pay if and
> only if they receive `sig` from the seller, where `sig` is the desired
> valid signature of `m`!
> 
> Best,
> Nadav
> 
> 
> ___
> Lightning-dev mailing list
> Lightning-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev
> 
___
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev