<oembed><type>rich</type><version>1.0</version><title>Yaacov Akiba Slama [ARCHIVE] wrote</title><author_name>Yaacov Akiba Slama [ARCHIVE] (npub1z0…at6uz)</author_name><author_url>https://yabu.me/npub1z07sgdx84scq77jx3fddj3jt0w2w3vpa0t5gyk0nmcaggs3gyt7s6at6uz</author_url><provider_name>njump</provider_name><provider_url>https://yabu.me</provider_url><html>📅 Original date posted:2019-11-12&#xA;📝 Original message:&#xA;On 11/11/2019 06:11, Rusty Russell wrote:&#xA;&gt; 2) From a technical point of view, it seems that there are already UBL &#xA;&gt; libraries in java and c#. I don&#39;t think such library is hard to write in &#xA;&gt; go, rust.., so every wallet implementation can use them.&#xA;&gt; That is not the problem.  The problem is that our order flow is simple:&#xA;&gt;&#xA;&gt;         Seller: Offer&#xA;&gt;         Buyer: Invoice Request&#xA;&gt;         Seller: Invoice (or updated Offer)&#xA;&gt;         Buyer/Seller: Payment &amp; Acknowledgement (atomic)&#xA;&gt;&#xA;&gt; (This could, of course, fit into a larger business flow.)&#xA;&gt;&#xA;&gt; The closest UBL flow seems to be:&#xA;&gt;&#xA;&gt;         Seller: Quotation&#xA;&gt;         Buyer: Order&#xA;&gt;         Seller: (Prepayment)Invoice (or updated Quotation)&#xA;&#xA;In UBL, 2 flows are defined (Traditional and Self Billing) and from what&#xA;I know, the right flow depends on the country and even on the industry&#xA;(services or goods for instance). What I suggest is to superpose the&#xA;&#34;strict&#34; LN flow (invoice then payment) to the business flow. So for&#xA;instance when a prepayment invoice is needed, the simplified (from UBL&#xA;pov) flow will be:&#xA;&#xA;  Seller: Quotation (UBL)&#xA;&#xA;  Buyer: Order (UBL)&#xA;&#xA;  Seller: Prepayment Invoice (UBL)&#xA;&#xA;  Seller: Invoice (LN)&#xA;&#xA;  Buyer/Seller: Payment &amp; Ack (LN)&#xA;&#xA;  Buyer: Receipt (UBL)&#xA;&#xA;&#xA;The advantage of such workflow are that we don&#39;t need to add any fields&#xA;to the current invoice structure, nor to define in the LN protocol new&#xA;messages like offer or invoice request, nor to intervene in the semantic&#xA;of the business workflow and in the required/optional fields in these&#xA;messages.&#xA;&#xA;&#xA;&gt;&#xA;&gt; It&#39;s also worth noting that, even compressed, none of the UBL examples&#xA;&gt; fit into the 1023 byte limit of the existing invoice format:&#xA;&gt;&#xA;&gt;         UBL-Quotation-2.1-Example.xml: 1864 bytes (gz)&#xA;&gt;         UBL-Order-2.1-Example.xml: 2515 bytes (gz)&#xA;&gt;         UBL-Invoice-2.1-Example.xml: 3163 bytes (gz)&#xA;&gt;&#xA;&gt; Indeed, that Quotation alone requires a 32x32 QR code.&#xA;&gt;&#xA;&gt;&gt;&gt; &#x9;However, since invoices/offers and UBL are both structures, we&#xA;&gt;&gt;&gt; should have an explicit mapping between the two.  What fields should&#xA;&gt;&gt;&gt; have their own existence in the invoice/offer and what should be in a&#xA;&gt;&gt;&gt; general UBL field is a question we have to think on further.&#xA;&gt;&gt; I agree that we don&#39;t want duplication. This is the reason, I propose to &#xA;&gt;&gt; use only ubl structure and add in the ln standard invoice an ubl &#xA;&gt;&gt; &#34;opaque&#34; field which will be self-contained and only add in the &#xA;&gt;&gt; invoice/offer/.. the fields specific to ln.&#xA;&gt; Except we need to go through the UBL spec and indicate exactly what&#xA;&gt; fields are permitted, and which are required.&#xA;&gt;&#xA;&gt; Many UBI fields are not amenable to machine interpretation (eg. note&#xA;&gt; fields).  These must be either explicitly exposed to the buyer (in case&#xA;&gt; the seller uses them) such as shipping conditions, or explicitly&#xA;&gt; forbidden/ignored.&#xA;&gt;&#xA;&gt; This is not a small task, and required intimiate knowledge of the UBL&#xA;&gt; spec.  It&#39;s not enough just to make something *look* like UBL.&#xA;&gt;&#xA;&gt; Does anyone have expertise in this area?  Shall we form a sub-group to&#xA;&gt; investigate this properly?&#xA;&gt;&#xA;&gt; Thanks!&#xA;&gt; Rusty.&#xA;&gt;</html></oembed>