[Lightning-dev] Reading moderated emails

2022-04-08 Thread alicexbt via Lightning-dev
Hi Bitcoin Developers,

Since some emails get moderated, I wanted to share one python script that I 
found useful.

Download eml file from moderated archives: 
https://lists.ozlabs.org/pipermail/bitcoin-dev-moderation/

Install fast_mail_parser and use this python script: 
https://github.com/namecheap/fast_mail_parser

This prints body in base64 format and different parts. Email can be read in 
plain text by decoding the relevant line: https://i.imgur.com/nnd56Li.png

Pasting the highlighted content in https://www.base64decode.org/ will decode 
the email content or using b64decode() in python.

/dev/fd0

Sent with [ProtonMail](https://protonmail.com/) secure email.___
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev


Re: [Lightning-dev] Taro: A Taproot Asset Representation Overlay

2022-04-08 Thread David A. Harding

Hi Laolu,

[Dropping the CC to Bitcoin-Dev as my questions below are LN focused.]

Thank your for the detailed proposed BIPs.  One question I have is
whether anything about Taro or the way you plan to implement support for
transferring fungible assets via asset-aware LN endpoints[1] will 
address

the "free call option" problem, which I think was first discussed on
this list by Corné Plooy[2] and was later extended by ZmnSCPxj[3], with
Tamas Blummer[4] providing the following summary:


Failing to route on purpose can be used to opt out of a previously
agreed exchange of two different assets.  A rational actor will opt
out if the exchange is no longer [advantageous to them]. Anyone who
grants an option for free heads [for] financial disaster.

This is not an issue for same asset exchange, as in payment routing,
since the exchange remains [equitable] at any later time point.

Although there is no escape from above reasoning, a market maker could
still be profitable as long as the option is worth less than the
bid-ask spread.  Therefore the issue does not mean that LN cross asset
exchange is not feasible, but that there is lower bound on bid-ask
spread, that of the option premium.


I know several attempts at mitigation have previously been discussed on
this list, such as barrier escrows[5], so I'm curious whether it's your
plan to use one of those existing mitigations, suggest a new mitigation,
or just not worry about it at this point (as Blummer mentioned, it
probably doesn't matter for swaps where price volatility is lower than
fee income).

***

I'd also be curious to learn what you and others on this list think will
be different about using Taro versus other attempts to get LN channels
to cross assets, e.g. allowing payments to be routed from a BTC-based
channel to a Liquid-BTC-based channel through an LN bridge node.  I
believe a fair amount of work in LN's early design and implementation
was aimed at allowing cross-chain transfers but either because of the
complexity, the free call option problem, or some other problem, it
seemed to me that work on the problem was largely abandoned.

Thanks,

-Dave

[1] https://lightning.engineering/posts/2022-4-5-taro-launch/
[2] 
https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-May/001292.html
[3] 
https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-December/001752.html
[4] 
https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-December/001756.html
[5] 
https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-October/002214.html

___
Lightning-dev mailing list
Lightning-dev@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/lightning-dev


Re: [Lightning-dev] [bitcoin-dev] Taro: A Taproot Asset Representation Overlay

2022-04-08 Thread Olaoluwa Osuntokun
Hi Ruben,

Thanks! I don't really consider things final until we have a good set of
test
vectors in the final set, after which we'd start to transition the set of
documents beyond the draft state.

> Seeing as there's a large amount of overlap with RGB, a protocol which I
have
> examined quite extensively, I believe some of the issues I uncovered in
that
> project also apply here.

I'm happy to hear that someone was actually able to extract enough details
from
the RGB devs/docs to be able to analyze it properly! In the past I tried to
ask
their developers questions about how things like transfers worked[1][2],
but it
seemed either people didn't know, or they hadn't finished the core design
(large TBD sections) as they were working on adding other components to
create
a "new new Internet".

> Furthermore, the Taro script is not enforced by Bitcoin, meaning those who
> control the Bitcoin script can always choose to ignore the Taro script and
> destroy the Taro assets as a result.

This is correct, as a result in most contexts, an incentive exists for the
holder of an asset to observe the Taro validation rules as otherwise, their
assets are burnt in the process from the PoV of asset verifiers. In the
single
party case things are pretty straight forward, but more care needs to be
taken
in cases where one attempts to express partial application and permits
anyone
to spend a UTXO in question.

By strongly binding all assets to Bitcoin UTXOs, we resolve issues related
to
double spending or duplicate assets, but needs to mind the fact that assets
can
be burnt if a user doesn't supply a valid witness. There're likely ways to
get
around this by lessening the binding to Bitcoin UTXO's, but then the system
would need to be able to collect, retain and order all the set of possible
spends, essentially requiring a parallel network. The core of the system as
it
stands today is pretty simple (which was an explicit design goal to avoid
getting forever distracted by the large design space), with a minimal
implementation being relatively compact given all the Bitcoin context/design
re-use.

Also one cool trait of the way commitments are designed is that the Taro
commitment impact the final derived taproot output key. As a result,
potential
Script extensions like TAPLEAF_UPDATE_VERIFY can actually be used to further
_bind_ Taro transitions at the Bitcoin level, without Bitcoin explicitly
needing to be aware of the Taro rules. In short, covenants can allow Bitcoin
Script to bind Taro state transitions, without any of the logic bleeding
over,
as the covenant just checks for a certain output key, which is a function of
the Taro commitment being present.

> There are two possible designs here: a.) The token history remains
separate –
> Dave receives Alice's 2 tokens, Bob's tokens are split and he receives 2
(or
> 3 from Bob 1 from Alice).  b.) The token history gets merged – Dave
receives
> 4 tokens (linking the new output with both Alice and Bob's history).

Mechanically, with respect to the way the change/UTXOs work in the system,
both
are expressible: Dave can chose to merge them into a single UTXO (with the
appropriate witnesses included for each of them), or Dave can keep them
distinct in the asset tree. You're correct in that asset issuers may opt to
issue assets in denominations vs allowing them to be fully divisible.
Ultimately, the compatibility with the LN layer will be the primary way to
keep
asset histories compressed, without relying on another trust model, or
relying
on the incentive of an asset issuer to do a "re-genesis" which would
effectively re-create assets in a supply-preserving manner (burn N units,
then
produce a new genesis outpoint for N units). Alternatively, implementations
can
also chose to utilize a checkpointing system similar to what some Bitcoin
full
node clients do today.

>  is that you end up with a linked transaction graph, just like in Bitcoin

This is correct, the protocol doesn't claim to achieve better privacy
guarantees than the base chain. However inheriting this transaction graph
model
imo makes it easier for existing Bitcoin developers to interact with the
system, and all the data structures are very familiar tooling wise. However
any
privacy enhancing protocol used for on-chain top-level Bitcoin UTXOs can
also
be applied to Taro, so people can use things like coinswap and coinjoin,
along
with LN to shed prior coin lineages.

> This implies the location of the Taro tree inside the taproot tree is not
> fixed. What needs to be prevented here is that a taproot tree contains
more
> than one Taro tree, as that would enable the owner of the commitment to
show
> different histories to different people.

Great observation, I patched a similar issue much earlier in the design
process
by strongly binding all signatures to a prevOut super-set (so the outpoint
along with the unique key apth down into the tree), which prevents
duplicating
the asset across outputs, as signature verification would fa