Return-Path: Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3D36FC002A for ; Tue, 18 Apr 2023 00:48:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0D1B783BD5 for ; Tue, 18 Apr 2023 00:48:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0D1B783BD5 Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=lnp-bp.org header.i=@lnp-bp.org header.a=rsa-sha256 header.s=protonmail2 header.b=QKdOQzqs X-Virus-Scanned: amavisd-new at osuosl.org X-Spam-Flag: NO X-Spam-Score: -2.102 X-Spam-Level: X-Spam-Status: No, score=-2.102 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PB4AL-h80ERU for ; Tue, 18 Apr 2023 00:48:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 94F4183BD4 Received: from mail-41103.protonmail.ch (mail-41103.protonmail.ch [185.70.41.103]) by smtp1.osuosl.org (Postfix) with ESMTPS id 94F4183BD4 for ; Tue, 18 Apr 2023 00:48:09 +0000 (UTC) Date: Tue, 18 Apr 2023 00:47:24 +0000 Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=lnp-bp.org header.i=@lnp-bp.org header.b="QKdOQzqs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lnp-bp.org; s=protonmail2; t=1681778853; x=1682038053; bh=MscAHUE8T+8az0wKRt6QUPSk3NblfuYMqjp1eOHMxMA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=QKdOQzqs6n1Nnv7EKre4/g4MYs04JbKWOfNffdf6HigZVomJeNCFZcW6dw4EAIBOA ETahFo9Zdnwjc7aD9nF+XEbIHhZXpDCpleGXmot++9EVwsm3C0Sl5lObu2z9RHVgzo +llDDo8hHAOgehQzSDpUbWO+H5N3o70LmMeNJ5Tbb87hHL9+o8GAV/8LEy6mhmlXPL aidISWplC3OaeCQeD1BhJ3sxOh1eju2HrqW18KmqdGJBsUYIrWHvHSHQLtAn9OgOUx S/A2B0Y6ueZN1BOKKUYfgvorqVqECqdFNpNGBEVJQQ+OPHZoGX70zcFtghxiQOSPeC HTwsOfjdt0MdA== To: Bitcoin Protocol Discussion From: Dr Maxim Orlovsky Message-ID: In-Reply-To: <3089493b2f202e30af42a485efec3fd1@dtrt.org> References: <3089493b2f202e30af42a485efec3fd1@dtrt.org> Feedback-ID: 18134079:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 18 Apr 2023 00:49:58 +0000 Subject: Re: [bitcoin-dev] RGB protocol announcement X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Apr 2023 00:48:14 -0000 Hi David, Thank you for taking time on doing analysis and writing comments. I will address all small questions in this reply -- with a follow-up=20 e-mail dedicated to the technical question from your letter regarding the problem of "on-publishable conditional statements seemingly being insecure in multiparty protocols", which requires longer write-up. > FYI: the RGB-WG organization page links to a repository whose latest > release is 0.9 and whose latest commit is titled, "Release v.0.9.1", see > https://github.com/RGB-WG/rgb-node/ Thank you for spotting; we hadn't updated the readme. Now its fixed. > > Nevertheless, in 2021 we were able to present both RGB powered with a > > Turing-complete virtual machine (AluVM) [2] and RGB had became > > operational on > > Lightning Network [3] using the LNP Node - a complete rust > > re-implementation of > > the Lightning protocol made by me at the Association [4]. > > Could you clarify the status of these implementations? The status of LNP implementation is "experimental": it is an instrument for testing new protocols in the scope of the Lightning network, and its main feature is in having lightweight and modular architecture. LNP implementation is not anymore required for using RGB on LN - as=20 Federico already mentioned in his reply, Bitfinex team was able to independently integrate RGB with existing LDK codebase [1] (I even=20 didn't know about that before they announced), and there is a WIP on integrating RGB through CLN extensions. So the question of LNP node readiness/completeness is unrelated to the question of RGB readiness, features or technical properties; in my previous e-mail I just had=20 pointed out that at some (past) point in time we had to work on LN=20 re-implementation due to some restrictions we had back those days --=20 like with pay-to-contract commitments which were impossible to=20 implement in the existing nodes due to architecture limitations --=20 but with the change to taproot-based commitments in late 2021- early 2022 this is not true anymore. > While trying to > learn about RGB, I noticed that you don't have much completed > documentation. Previous reviewers also mentioned this and I saw that > you suggested them to read the code or view your videos. A lot of documentation was written and is being written. For instance, if you look at the foundational crates we have in RGB, they are well documented, containing more docs than the code itself, like in Also, we have a number of websites tracking the RGB docs, listed in and - literally dozens of them. So your information is outdated. Of course, much more need to be written - but again, for a small team of community & self-fundend non-profit with the budget comparable to=20 a coffee shop. I think we are doing all what we can. If community=20 needs more docs -- it is welcome to provide more funding or hands in=20 writing them. > When reading your code for your LN implementation (LNP), I noticed it > seemed to be missing a lot of things present in other LN implementations > I regularly review. For example, I can't find where it supports > creating or parsing onions, which seems to be a fundamental requirement > for using LN. It is there, literally for years, where it should be - in P2P protocol, BOLT4, as directory and file names suggest: It is based on our other library which provides encryption: > In trying to figure out how it works, I also noticed that > I couldn't find either unit tests or integration tests---indeed several > of your applications seem to almost entirely lack the string "test". > For example, here are LNP-node and RGB-node compared to the four LN > implementations I regularly monitor: > > /tmp/rgb-node$ git grep -i '\' | wc -l > 7 RGB Node is not a part of the current RGB release -- starting from=20 v0.10 RGB do not require a background service. The node is still useful in server-side environments - but 100% of mobile and most of desktop users and wallet devs would never need to touch it; thus the update of the node to v0.10 will come later. Anyway, there is no reason of doing its extensive test coverage since it its role to be a wrapper around RGB libraries (existing in other repositories) which contain 100% of RGB consensus and applied business logic. Node just manages threads and file I/O - not the stuff which is test-covered first of=20 all (and even for that task it uses others of our libraries with a=20 like io-react, used in other high-load projects. (BTW pls pay=20 attention to how such libs are documented: ). The real RGB code is here, as it is clearly stated in the Github: * consensus-level=20 - - - * integration libraries - With the update to v0.10 a lot of code was changed, so most of tests got outdated and were thrown out. Yes, we need more time and effort to re-do them -- but even taking that into the account, the core of RGB is covered to much greater extent than the estimations you have provided: * client-side-validation library - 80%:=20 * RGB Core - ~25% (due to significant re-write in v0.10) Finally, the most of code coverage happens due to the used strict types system [4], which does compilation-type verification of all data serialization, deserialization and semantic type system. I.e. with its taken into account, the actual code coverage exceeds 2/3 (>60%). I provide more explanations at the end of the letter. > /tmp/lnp-node$ git grep -i '\' | wc -l > 4 > > ~/repos/rust-lightning$ git grep -i '\' | wc -l > 2008 > ~/repos/cln$ git grep -i '\' | wc -l > 1459 > ~/repos/lnd$ git grep -i '\' | wc -l > 3547 > ~/repos/eclair$ git grep -i '\' | wc -l > 2576 Well, that's a strange way to estimate the code coverage by counting lines with the word "test". I usually use code coverage reports, like those coming from codecov.com -- since neither count of unit tests nor code lines in them are a valid metric to see how the code is test-covered. Unlike all those implementations, the node repository doesn't contain any lightning network business logic or protocols - it is just a "shell" providing I/O, networking and thread management, not requiring much testing. Instead, one should look into the actual LNP codebase implementing BOLT standards, which is in . And as one might see from test coverage reports [2] it has 40% of all code covered in tests - which is not huge, yes, but (see next reply)... > I realize those are all projects by larger teams than that which works > on RGB, but a difference of three orders of magnitude is very surprising > to me. Do you have out-of-tree testing or am I missing something else? ... as I pointed above, there is no "three orders of magnitude" difference if the comparison is done correctly. Of course mainstream implementation developed for more than 5 years, with millions invested by large companies/ non-profits and full teams of devs will have more test coverage than an implementation created at my own personal expense - and I do not understand what is surprising here :) I wrote about this implementation to attract more interest from the community devs who may be interested in joining to work/use an independent lightning re-implementation with more open architecture allowing much larger protocol-level customizations than any other mainstream implementation out there. > As your replies to previous reviewers also mentioned that they should > view your Youtube videos, I also tried that. I had never replied to previous _reviewers_ like that. For instance, the protocol was reviewed by Peter Todd and Federico Tenga, as well as by other devs from the community, and I am sure they can confirm that the communications were complete and I was providing all the required answers and comments. If you are talking about Ruben Somsen, he was never introduced to me as a reviewer, nor wrote to me anything other than several sarcastic tweets -- and I rather see him as an internet troll, who, notwithstanding verbal communications and explanations I had provided him over phone call, continues to spread miss-information=20 positioning himself as "RGB expert" -- while still demonstrating absence=20 of desire of reading any recent updates we had even when provided links. > I focused on the ones > discussing LNP, as LN is something I know fairly well, But this discussion is an offtopic to RGB and this letter. I am fine to have it, but let's move it to a separate thread. > I skimmed them quite fast, but I couldn't find any demos where you > progressed beyond using LNP to open a channel with another node. E.g., > they seemed to stop at the same point as this demo: > https://github.com/LNP-WG/lnp-node/blob/c402decc9ff5b557a9e3d542f74e2fd6e= d856742/doc/demo-alpha.4/README.md The current LNP Node version is v0.9, so v0.4-alpha is extremely outdated, as well a doc there. For sure the doc needs an update. These are more=20 recent demos of node operations, with a remote CLN node as of end of 2021: * https://youtu.be/DoNfKLLjzsY * https://youtu.be/L6JlIQXbl6Y > My understanding of the basic goal of RGB from years ago was that it > would allow ordinary users to define new assets on Bitcoin in a way that > would allow those assets to be transferred over LN. As far as I can > tell, it doesn't do that yet, not even in a way that's accessible to a > power user such as myself. I do not know how to compare the power of users, but, for instance it was successfully demonstrated by an independent Bitfinex team using BDK and LDK last month on the stage of Lightning Tuscany Summit. Of course=20 there yet no fancy UI all around, but absence of UI says nothing about technology or its readiness. In fact, several teams are working on the first UI apps using RGB, so this thing will change - and it is not a task for a non-profit protocol-level research organization, but rather for commercial ventures. > Even for that original goal, there are > several problems outstanding---problems which will likely require > significant research and experimentation to overcome, e.g.[2]. > Instead of tackling those problems and building upon existing wallet and > LN libraries, I see an ambitious effort at reimplementation and massive > scope creep. Sorry for not meeting your expectations about how I should use my time, funds and funds of those who support such developments :) The real part of the story is that 80% of the time we were working on solving the original scope you pointed out. It just appeared that there were much more hidden stones (than was expected back in 2018)=20 in doing the idea of "assets over Lightning": * the original single-use-seals didn't worked for the world of multiple assets which may co-exists, which required development of a set of quite complex protocols (still being probably most complex part of RGB); * the original pay-to-contract commitment scheme did work badly on practice, being poorly inter-operable with existing lightning implementations (which took a year of work on LNP node in total, as I mentioned above) and leading to hard problems in wallet integration and compatibility with all existing frameworks. We were solving that problem until Taproot had arrived - and then we switched to Taproot-based commitment scheme. It took another half of year to update the whole code base - but the reward was compatibility with BDK, LDK and other existing tools in the ecosystem, so your comment on "Instead of tackling those problems and building upon existing wallet and LN libraries" is not valid; * as a part of the above, I had to significantly contribute to taproot implementation and maintenance of rust-bitcoin project, being the most active project contributor during the course of 2019-2022 [3] (=3D"building upon existing wallet libraries); * a lot of time was spent on privacy-related improvements, since none of the original authors nor sponsors had seen any value about putting "colored coins on lightning" without worriyng about the privacy; and only after that comes some "fancy stuff", like doing a dedicated virtual machine and rich data type system -- which primary features were not "Turing completeness" but ability of formal verification and compiler-time safety guarantees. For instance, the developed type system [4] allows not just to "compile" any rust data type into a smart contract, but also to prove that all data types used in=20 consensus code do not mutate between releases. If bitcoin had that type system, there would be no "unnoticed" hardforks or risks of them in a future -- and I think not implementing such system in doing a new consensus protocol would be a poor decision. And the last, but not least, I do not want to be in such situation preferring to spend a year more on a proper design instead of "shipping earlier". What is acceptable for networking protocols can't be acceptable for consensus-level protocols, which, unlike even blockchain consensus can't have softforks. ---- Overall, I am quite negatively impressed with the amount of=20 misinterpretations and estimates which are simply wrong - and I know that they are being floated around working like fake news.=20 Unfortunately writing answers to such claims takes a lot of time -=20 and takes it from doing other stuff like writing docs, tests or=20 integrations. I understand that this letter will be read by many,=20 thus I did address some of most common misconceptions. I am doing=20 that on bitcoin-dev mail list, but not elsewhere, since if I were doing that on Twitter I would never have time for anything else. [1]: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-April/021= 558.html [2]: https://app.codecov.io/gh/LNP-WG/lnp-core [3]: https://github.com/rust-bitcoin/rust-bitcoin/graphs/contributors?from= =3D2019-01-11&to=3D2022-04-11&type=3Dc [4]: https://www.strict-types.org