<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[IT's what we do!]]></title><description><![CDATA[IT's a war – and here are some thoughts, stories, dreams, observations, experiences, and ideas from the trenches ]]></description><link>https://blog.alco.dk/</link><image><url>https://blog.alco.dk/favicon.png</url><title>IT&apos;s what we do!</title><link>https://blog.alco.dk/</link></image><generator>Ghost 5.12</generator><lastBuildDate>Sat, 11 Apr 2026 18:15:35 GMT</lastBuildDate><atom:link href="https://blog.alco.dk/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Components in Phlex 2.0]]></title><description><![CDATA[Phlex helps you clean up your views, speed up page views, and offer an easy path to building components for web pages]]></description><link>https://blog.alco.dk/components-in-phlex-2-0/</link><guid isPermaLink="false">67a602437803d90007000f26</guid><category><![CDATA[rails]]></category><category><![CDATA[ruby]]></category><category><![CDATA[phlex]]></category><category><![CDATA[html]]></category><category><![CDATA[code]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Fri, 07 Feb 2025 13:47:34 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1704026437278-77f1db74859c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDQ4fHxhc3NlbWJsZSUyMGNvbXBvbmVudHxlbnwwfHx8fDE3Mzg5MzU3MTl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1704026437278-77f1db74859c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDQ4fHxhc3NlbWJsZSUyMGNvbXBvbmVudHxlbnwwfHx8fDE3Mzg5MzU3MTl8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Components in Phlex 2.0"><p>Quiz time: Old enough to remember <a href="https://haml.info/">Haml</a>?<br>To some limited degree <a href="https://phlex.fun">Phlex</a> is like <strong>Haml</strong> -- I know; it&apos;s not fair to neither but please bear with me! <strong>Haml</strong> made it fun and easy to write HTML soup and had it not been for the strict formating I&apos;d probably still be doing it!<br>Enter <strong>Phlex</strong> and all of a sudden your <a href="https://www.youtube.com/watch?v=2SkYNSKB1aM">old habits die hard - again</a><br>Consider this tiny clip:</p><pre><code class="language-ruby">div(class:&quot;m-2&quot;) do
  plain { &quot;Enter Phlex and all of a sudden your &quot;}
  a(href: &quot;https://www.youtube.com/watch?v=2SkYNSKB1aM&quot;) { &quot;old habits...&quot; }
end
</code></pre><p>If you squint your eyes and let them just sweep the code block for a quick look-see? It could fool me - if I dropped the &apos;end&apos; and added a &apos;%&apos; on the p&apos;s and a&apos;s :)</p><p>(<strong>Phlex</strong> even has a page in the new <a href="https://beta.phlex.fun/compare/haml.html#phlex-vs-haml">beta 2.0 documentation</a> assigned to the difference between <strong>Haml</strong> and <strong>Phlex</strong> so I guess it&apos;s not all smoke and mirrors)<br>Anyways with that introduction off my chest let&apos;s get this band on the road!</p><h3 id="airborne">Airborne</h3><p>First I added the gem to my new-ish Rails project (it&apos;s actually running off of the main branch on github - so quite new in fact, but you don&apos;t have to be leaning over the edge to join the [phlex.]fun):</p><p><code>bundle add phlex-rails --version=2.0.0.rc1</code></p><p>I willingly stayed in character as the <a href="https://en.wikipedia.org/wiki/Bonus_pater_familias">bonus pater familias</a> and did the</p><p><code>bundle exec rails generate phlex:install</code></p><p>So, now I was ready to start porting my components library to Phlex 2.0 &#x2013; components that I use for index views and forms, mainly and in this post I&apos;ll focus on the index views.</p><h3 id="getting-the-hang-of-it">Getting the hang of it</h3><p><em>&quot;You cannot walk until you master crawling&quot;</em> is a life experience of mine so let&apos;s crawl for a start!<br>The Phlex documentation starts of with building a component but I&apos;d like to introduce you to a slightly different learning curve. We&apos;ll build that index action on a home controller &#x2013; in essence an endpoint like <a href="https://app.mortimer.pro/">https://app.mortimer.pro/</a>, which coincidentally is the entry to a product that you can read more about <a href="https://mortimer.pro">https://mortimer.pro</a></p><p>Three <a href="https://rubyonrails.org/">Rails</a> files comes to mind: <code>views/layouts/application.html.erb</code>, &#xA0;<code>views/home/index.html.erb</code> and <code>controllers/home_controller.rb</code></p><p>From the docs we know where this is all going to end so let&apos;s do the obvious thing and write what we&apos;d like to have</p><pre><code class="language-ruby"># controllers/home_controller.rb
class HomeController &lt; ApplicationController
  def index
    render Views::Home::Index.new
  end
end</code></pre><p>Reloading <a href="https://localhost:3000">https://localhost:3000</a> immediately confirms what we feared the most &#x2013; something is missing (and if you&apos;re getting that dreaded almost blank screen informing you that there is an issue with security &#x2013; I have <a href="https://spaquet.medium.com/setting-up-ssl-on-localhost-for-rails-development-with-puma-211574dbfb87">just the medicin</a> for you)!</p><figure class="kg-card kg-image-card"><img src="https://blog.alco.dk/content/images/2025/02/Sk-rmbillede-2025-02-07-kl.-14.12.25.png" class="kg-image" alt="Components in Phlex 2.0" loading="lazy" width="1114" height="673" srcset="https://blog.alco.dk/content/images/size/w600/2025/02/Sk-rmbillede-2025-02-07-kl.-14.12.25.png 600w, https://blog.alco.dk/content/images/size/w1000/2025/02/Sk-rmbillede-2025-02-07-kl.-14.12.25.png 1000w, https://blog.alco.dk/content/images/2025/02/Sk-rmbillede-2025-02-07-kl.-14.12.25.png 1114w" sizes="(min-width: 720px) 720px"></figure><p>Try this in your CLI (you could bring one up using [Cmd+j] if you&apos;re using <a href="https://code.visualstudio.com/">VS Code</a> with default keyboard shortcuts on a Mac) <code>bundle exec rails generate phlex:view home::index</code><br>Another reload in the browser and we&apos;re once again good &#x2013; kind&apos;a</p><h3 id="inheritance-and-composition">Inheritance and composition</h3><p>So far we&apos;ve managed little besides exchanging <em>html.erb</em> with <em>rb</em> but that is about to change &#x2013; scouts honour!<br>Once again let&apos;s write what we want to end up having</p><pre><code class="language-ruby"># controllers/home_controller.rb
class HomeController &lt; ApplicationController
  layout false

  ...8&lt;..
</code></pre><p>Reloading tell us that the layout went away. We&apos;ll fix that</p><p>First back in the CLI do <code>bundle exec rails g phlex:component layout</code></p><p>Then follow up with these changes</p><pre><code class="language-ruby"># views/home/index.rb
class Views::Home::Index &lt; Views::Base
  def page_title = &quot;Home&quot;
  def layout = Layout

  ...8&lt;..

# views/base.rb
class Views::Base &lt; Components::Base
  PageInfo = Data.define(:title)
  def around_template 
    render layout.new(page_info) do 
      super 
    end
  end
  
  def page_info 
    PageInfo.new( title: page_title ) 
  end
end
</code></pre><p>We are one change short - but before we add that one allow me to introduce you to one of my absolute favorite web services: <a href="https://phlexing.fun/">phlexing.fun</a><br>Its service is so simple and yet so powerful: have html -&gt; get phlex<br>So copy the contents of your <code>views/layouts/application.html.erb</code> and paste it into the textarea with the placeholder &quot;Paste ERB here&quot; and shortly after you&apos;ll have a copy-ready snippet of Phlex to paste into your layout.rb<br>(be prepared to follow the &apos;prompting&apos; when reloading - your HTML will probably contain a number of calls to Rails specifics - like <code>csrf_meta_tags</code> but Phlex has answers for most)</p><pre><code class="language-ruby"># components/layout.rb
class Components::Layout &lt; Components::Base
  def initialize(page_info)
    @page_info = page_info
  end

  def view_template
    doctype
    html do
      head do
        title { @page_info.title }
        meta(name: &quot;viewport&quot;, 
          content: &quot;width=device-width,initial-scale=1&quot;)
        meta(name: &quot;apple-mobile-web-app-capable&quot;, 
          content: &quot;yes&quot;)
        meta(name: &quot;mobile-web-app-capable&quot;, 
          content: &quot;yes&quot;)
        csrf_meta_tags
        
        # csp_meta_tag
        # Enable PWA manifest for installable apps 
        # (make sure to enable in config/routes.rb too!)
        # = tag.link rel: &quot;manifest&quot;, 
        #  href: pwa_manifest_path(format: :json)
        
        link(rel: &quot;icon&quot;, href: &quot;/icon.png&quot;, type: &quot;image/png&quot;)
        link(rel: &quot;icon&quot;, href: &quot;/icon.svg&quot;, type: &quot;image/svg+xml&quot;)
        link(rel: &quot;apple-touch-icon&quot;, href: &quot;/icon.png&quot;)

        # Includes all stylesheet files in app/assets/stylesheets
        stylesheet_link_tag &quot;tailwind&quot;,
          &quot;inter-font&quot;,
          &quot;data-turbo-track&quot;: &quot;reload&quot;

        stylesheet_link_tag :app, 
          &quot;data-turbo-track&quot;: &quot;reload&quot;

        javascript_importmap_tags
      end

      body do
        main(class: &quot;container mx-auto mt-28 px-5 flex flex-col&quot;) do
          yield
        end
      end
    end
  end
end
</code></pre><p>Agreed, this did not bring us Total World Domination or Peace To All Mankind but we took a decent step towards DRY-ing up and <em>componentizing</em> our views &#x2013; more on that in the next post, and while I hurry to post that you could give <a href="https://blog.alco.dk/how-i-almost-lost-the-c-in-mvc/">this one</a> a quick skim; it&apos;s on DRY-ing up the controller!</p>]]></content:encoded></item><item><title><![CDATA[How I almost lost the C in MVC]]></title><description><![CDATA[DRY-ing up your controllers is not a novelty but I like to think that my 'version' keeps the magic going without getting too magical]]></description><link>https://blog.alco.dk/how-i-almost-lost-the-c-in-mvc/</link><guid isPermaLink="false">6788c2224c1dad0007be250d</guid><category><![CDATA[ruby]]></category><category><![CDATA[rails]]></category><category><![CDATA[MVC]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Thu, 16 Jan 2025 09:15:56 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1507730756279-dc621038850f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE0fHxjb250cm9sbGVyfGVufDB8fHx8MTczNzAxODc4NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1507730756279-dc621038850f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE0fHxjb250cm9sbGVyfGVufDB8fHx8MTczNzAxODc4NHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="How I almost lost the C in MVC"><p>Model-View-Control is one of a list of cornerstones in Ruby on Rails and a pattern in general implementation of man-machine interfaces. The C handles the request from the &apos;man&apos;, collects data from the the M (model) that interfaces with data whether it&apos;s persisted in some (r)DBMS or elsewhere, and finally handing it back to the &apos;man&apos; with the help of the V (view) that assists by generating some sort of output whether HTML, JSON, or something entirely different.</p><p>How did I (almost) lose the C?</p><p>Back in the day there was this thing called <a href="http://railscasts.com/episodes/230-inherited-resources">inherited_resources</a> that I grew very fond of and as time passed it morphed into this:</p><!--kg-card-begin: markdown--><pre><code class="language-ruby">class MortimerController &lt; BaseController
  #
  # defined in the resourceable concern
  before_action :set_resource, only: %i[ new show edit update destroy ]
  before_action :set_filter, only: %i[ index destroy ]
  before_action :set_resources, only: %i[ index destroy ]
  before_action :set_resources_stream

  include Resourceable
  include DefaultActions

  --8&lt;--
  
end
</code></pre>
<!--kg-card-end: markdown--><p>I know &#x2013; I could have put the <code>before_action</code> statements in the include but I like to have just a tad overview of what all the magic is about :wink:</p><p>The <strong>Resourceable</strong> is responsible for setting up required resource(s) for the actions (index, show, new, edit, create, update, delete).</p><p>The <strong>DefaultActions</strong> is responsible for handling a &quot;default&quot; action to any of these actions (and a few more like `lookup` which, BTW, to me is a specialization to the index action).</p><p>The result?</p><p>My standard &quot;post&quot; controller looks like this:</p><!--kg-card-begin: markdown--><pre><code class="language-ruby">class PostController &lt; MortimerController
  private
    # Only allow a list of trusted parameters through.
    def resource_params
      params.expect(post: [ :id, :title, :body ])
    end
end
</code></pre>
<!--kg-card-end: markdown--><p>The DefaultActions is a concern looking &#xA0;&#x2013; in part &#x2013; like this:</p><!--kg-card-begin: markdown--><pre><code class="language-ruby">module DefaultActions
  extend ActiveSupport::Concern

  included do
    def index
      @pagy, @records = pagy(@resources)

      respond_to do |format|
        format.html { }
        format.turbo_stream { }
        format.pdf { send_pdf }
        format.csv { send_csv }
      end

    rescue =&gt; e
      HandleError.new(request: request, params: params, error: e)
    end
    
    --8&lt;--
    
  end
end
</code></pre>
<!--kg-card-end: markdown--><p>Sweet, isn&apos;t it?</p>]]></content:encoded></item><item><title><![CDATA[How to launder money, part III]]></title><description><![CDATA[This limited series of posts ponders on the consequences for criminals, tax, vat, business profits and public spending if we added a scent to money - building a digital currency controlled by the National Bank. Part three is all about the fine print]]></description><link>https://blog.alco.dk/how-to-launder-money-part-iii/</link><guid isPermaLink="false">66597a074c1dad0007be221d</guid><category><![CDATA[blockchain]]></category><category><![CDATA[fiat]]></category><category><![CDATA[krypto]]></category><category><![CDATA[money laundering]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Mon, 03 Jun 2024 07:17:16 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1450101499163-c8848c66ca85?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDI1fHxjb250cmFjdCUyMGRldGFpbHN8ZW58MHx8fHwxNzE3MTUxOTY4fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1450101499163-c8848c66ca85?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDI1fHxjb250cmFjdCUyMGRldGFpbHN8ZW58MHx8fHwxNzE3MTUxOTY4fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="How to launder money, part III"><p>The <a href="https://blog.alco.dk/how-to-launder-money-part-ii/">previous part</a> ended on accounting for the choice of 15% transaction cost. Any number could, in fact, be selected - but the psychological factor is important, and &apos;15&apos; has an almost virgin-like aura, the 1 and the 5 are good together - nothing like all the drama of the 3, the 6, and the 9, the scary 7 or the dubious 2, nor the pompitious all consuming &apos;8&apos;. I forgot the 4 - &apos;cause, well, you just do &#x1F61F;</p><h2 id="the-fine-print">The fine print</h2><h3 id="barter-is-not-solvedis-it">Barter is not solved - is it!?</h3><p>The short answer to that question is: No! People will barter like they do today. If my neighbour is willing to do my lawn and in exchange have me do their dishes, nothing in this universe will be able to control that!</p><p>A somewhat longer at it: Barter is a deliberate decision based upon the perceived degree to which one feels <em>getting robbed</em>. A 25% VAT on top of a hourly price of perhaps 50$ will leave most feeling getting robbed pretty good. 15% is still not <em>free beer</em> but certainly a considerable less grivious experience &#x2013; and with hourly charges perhaps even sliding ever so little, hopefully even less so!</p><p>But bartering will never cease to exist &#x2013; the incentives are just too big. Reducing the risks and friction pertaining to the money transactions, however, will bring down the size of bartering measurable.</p><h3 id="gnp-will-suffer-and-make-us-all-a-lot-poorer">GNP will suffer and make us all a lot poorer!</h3><p>Well - this is where things start getting really complicated!</p><p>Gross National Product - Gross National Income as it&apos;s in fashion to label it now - is <em>the market value of all the goods and services produced in one year by labor and property supplied by the citizens of a country.</em> Quite a mouthful, right? But rest not - it get&apos;s a lot worse - &apos;cause GDP is favored by many in measuring the real economic habetus of a country; and then there is Gross Value Added. Interested, <a href="https://en.wikipedia.org/wiki/Gross_domestic_product">read on here</a>, or have a tast of the issues surrounding all the calculations and forecasts, like <a href="https://www.moneycontrol.com/news/opinion/the-macro-puzzle-what-explains-the-big-divergence-between-gdp-and-gva-12443901.html">this article</a> explaining divergences between GDP and GVA in the worlds largest population, India.</p><p>In Utopia lives only 2 people. One is a farmer growing potatoes and the other is a student learning to be - a farmer perhaps. The farmer hands the student 100$ every month for the student to be able to pay for the potatoes they need to survive. That&apos;s a GDP of 100$. Now the farmer increases the price to 110$ &#x2013; and has to hand the student 10$ more. GDP just rose by 10% ?!? No one grew any more potatoes and neither of the citizens got any richer nor more full!</p><p>So - like Utopia - reducing taxes will lower the GDP but this will possibly strengthen the country&apos;s ability to compete in markets internationally and leave no one any poorer nor less full (as long as transfer incomes - the 110$ for the student - are equal to the current spending, ie if the above &apos;story&apos; was reversed and the farmer lowering the price = less tax and thus handing the student 100$ instead of 110$ allowing the student to buy potatoes like before)! </p><p>Side effects may be less inflation but that might be offset by increased purchasing power by consumers and, yeah the list goes on!</p><h3 id="allowances-and-gifts">Allowances and gifts</h3><p>If 15% transaction costs are added to all money transactions &#x2013; what will happen to allowances and gifts?</p><p>That&apos;s perhaps the single most challenging issue, and one that I have no really good answer to! </p><p>If my daughter works her butt off scrubbing our kitchen floor and I agree to raise her &quot;pocket money&quot; from nil to 10$ a week, I need to accept that I am in fact paying 11.50 for the floor scrubbing. Furthermore she will have to come to terms with not getting her full measure of sweets at the candy store &#x2013; because she cannot afford the entire bag of sweets at 10$ but only 8.695$&apos;s worth of candy.</p><p>In the bigger picture (for the greater good) I do, however, consider this a minor snag in the design! Leaving <em>back-doors</em> open certainly will corrupt the system and render it useless in a very short time &#x2013; so it&apos;s either all or nothing, as I see it.</p><h3 id="foreign-trade-will-be-endlessly-more-difficult">Foreign trade will be endlessly more difficult!</h3><p>Not by any measure, no! </p><p>Let&apos;s start with <strong>sales</strong>. Company A wins a big tender for erecting playgrounds in 10 german cities. The german &quot;L&#xE4;nder Amt&quot; is provided with an IBAN number (the way most money is wired from buyer to seller, today) pointing to Company A&apos;s escrow account in the <em>Nationalbanken</em>, and when Company A wishes to transfer the payment to their digital company wallet, the 15% transaction cost will be added.</p><p><strong>Procurement</strong> works in exactly the same way. Company B buys sugar cane from Cuba and transfers an agreed upon money sum to their escrow account in the Nationalbanken. The Nationalbanken dutifully informs the cuban seller of the money sum being present and ready and now the seller can see to the cane getting shipped to Denmark with no worries about whether Company B has any intentions to fault the payment. </p><p>In fact foreign trade will benefit immensely from this scent-added-to-money disruption for one by making it ridiculously easy to enter into contracts with foreign buyers/sellers. Every transaction is now supervised and backed by the Kingdom of Denmark thus cutting out all the &apos;middle-men&apos; in the process!</p><h3 id="banks-will-not-like-it">Banks will not like it!</h3><p>No, no more than newspapers liked the advent of the Internet and social media! They are free to lend money but I understand that the consequences will be a &apos;harsher environment&apos; to operate in. <em>C&apos;est la vie</em></p><h3 id="this-will-get-bogged-in-bureaucrazy">This will get bogged in bureaucrazy!</h3><p>Bureaucracy is a german invention - or rather, <a href="https://en.wikipedia.org/wiki/Max_Weber">Max Weber</a> is considered to be one of the first to popularize the term! An efficient organization processing administrative tasks and the procedures they follow when decision-making &#x2013; an office analogy to the manufacturing assembly line.</p><p>Bureaucracy by itself is merely an efficient way of organizing the completion of work tasks, and with a proper mission and just set of rules to <em>run</em> this bureau there is absolutely no reason why <em>stinking money</em> should become bureaucrazy!</p><p>I acknowledge the dangers facing this <a href="https://en.wikipedia.org/wiki/Gordian_Knot">Gordian Knot</a> cutter, like politicians realizing how easy it will be to turn the transaction cost nob versus asking their public service spenders to revisit the budgets or telling their voters to lower their expectations as to what returns they can expect from the public sector.</p><hr><h3 id="what-is-next">What is next?</h3><p>I have a post in the making detailing the implementation - stick around for that</p><p>&#x1F60A;</p>]]></content:encoded></item><item><title><![CDATA[How to launder money, part II]]></title><description><![CDATA[This limited series of posts ponders on the consequences for criminals, tax, vat, business profits and public spending if we added a scent to money - building a digital currency controlled by the National Bank. Part two eyes the gains and costs]]></description><link>https://blog.alco.dk/how-to-launder-money-part-ii/</link><guid isPermaLink="false">66587e284c1dad0007be1fe0</guid><category><![CDATA[krypto]]></category><category><![CDATA[blockchain]]></category><category><![CDATA[fiat]]></category><category><![CDATA[money laundering]]></category><category><![CDATA[pigeons]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Mon, 03 Jun 2024 07:16:53 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1588159482216-4f711d7a78d4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE5fHxmaXNoJTIwaGFyYm91cnxlbnwwfHx8fDE3MTcxNTEzMzB8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1588159482216-4f711d7a78d4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE5fHxmaXNoJTIwaGFyYm91cnxlbnwwfHx8fDE3MTcxNTEzMzB8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="How to launder money, part II"><p>In <a href="https://blog.alco.dk/how-to-launder-money">part one</a> we learned the only right way to perform money transactions was to add a scent to money &#x2013; make it entirely digital!</p><p>We ended with me positing that the only way would be for the National Bank to do a different job...</p><h2 id="make-money-stink">Make money stink!</h2><p>I&apos;ve linked to <a href="https://blog.alco.dk/what-if-money-had-a-s-cent/">the solution</a> above in part I, but it really is the only way! If we have to do a better job at overseeing money transactions making sure that they are legit and executed properly, we need to bring the C-gun - &#xA0;C for crypto (inspired at least). There are not enough hands in the entire Kingdom of Denmark to manually supervise the transaction of money. Basta!</p><p>In a few short years Denmark is to have a fresh set of bank notes. Perhaps we should not -</p><p>- perhaps we should have only one &quot;note&quot; - a specially crafted bank note the size of a credit card more or less. Housing a key generator and a few other digital artifacts which working in concert will be able to offer the owner a ways to hold &quot;cash&quot; - in effect being a digital wallet. Before you even voice it: a pivotal task will be to provide this wallet with a host of failsafes, booby traps, and safety mechanisms to reducing the number of mis-uses.</p><p>Going full digital money-wise will be about as big a disruption as the first smart-phone. The gains are monumental and will easily cover the necessary increase in compensations paid to owners unlucky to be subjects to what ever small percentage of criminal activity even so.</p><blockquote>This is far to important to be handed on a silver plate to the private sector! We cannot make the mistakes of yesterday again! Cases like the telco&apos;s, the energy sector, postal service, the national credit card service (danKort), and selling the mortgage companies to a select few banks!<br><br>&apos;stinking money&apos; must be controlled and run by Nationalbanken &#x2013; and built by danish owned and employed personel. Too important.</blockquote><h2 id="tax-heaven">Tax Heaven</h2><p>One immediate gain would be a considerable tax cut! With all money transactions suddenly being transparent - an even 15% &quot;tax&quot; on all transactions would revolutionize all sectors! Consider this:</p><ul><li>buying foreign goods would automagically induce 15% &quot;import duty&quot; &#x2013; not really but the equivalence of; buying those same goods from your local supplier would cost you 15% vat &#x2013; not really but it would work just like. There would not be any reason for keeping a tab on incured vat costs. No refund - no reverse vat - no nothing; just a cost like gaz on the trucks or heating the offices!</li><li>paying workers hourly wages would automagically add income tax. Paying your workforce 10$ an hour would add a dollar fifty in &quot;transaction costs&quot; but then again: that&apos;ll be all there would be to it! No reporting, no statements, no controls! And - should any governmental agency pause to ask questions, it&apos;s all there in the money trail! Where every single cent came from and who benefited from receiving it.</li><li>no income tax statements - not for you and not for your business, no statements at all. Because the &quot;taxes&quot; will long have been collected - and probably spent too &#x1F602;</li><li>having your private home renovated by your neighbour and his handy son would add 15% to their asking price for the job (see barter below)</li></ul><p>What&apos;s the net &quot;cost&quot; to businesses? They&apos;d <em>loose</em> 15% on all purchases but save 25% VAT on all goods/services sold - that goes for the markup too! So buying fashion tee&apos;s in India on the cheap at 2 euros and 13 cents (and by the way: yes that is in fact the cost of a fashion designer brand T-shirt) and selling them at 100 euro would net them a substantial win! They&apos;d obviously have to pay 15% once they wanted to enrich the shareholders - but still a considerable win. They would pay considerably less to employees (15% in stead of the current 40-60% income tax) which would allow employees to ask a more modest hourly wage/monthly compensation due to a sizeable increase in their purchasing power (because businesses would be able to compete at a lower price point selling to consumers).</p><p>With no deductions, tax rebates, reversed vat schemes, and an incredible amount of laws and regulations being null and void, businesses would not be required to submit statements - each transaction would be settled at the moment of payment processing - and thus would save on accountants, book-keeping, consultants and controllers! The number of work hours spent on chores not making <em>the coffee taste better</em> is mind staggering. With just 1 hour spent on book-keeping, submitting statistics, controlling, more per business per week (and that&apos;s a very defensive guess) we end at 300,000+ hours a week! Allowing for digitization to swallow the better part (let&apos;s apply the Pareto for good measure) we&apos;re still left with 60,000 hours. That&apos;s well beyond 3M work hours/year - or 600M in saved costs for businesses (and that number is way off &#x2013; a better guess would be 10 fold, but I reckon it proves the point anyway). Just by &quot;adding a scent&quot; to money &#x1F609;</p><p>Public tax administration will be able to focus their attention (and resources) on training AI systems to follow the money trails (follow the stink to paint the picture in a more <em>odorious</em> way, so to speak) and solve issues where transactions have gone wrong for what ever reason (technology issues, mischief, <a href="https://en.wikipedia.org/wiki/User_error">ID10T</a> errors, more)</p><h2 id="wait-whats-with-the-15">Wait! What&apos;s with the 15%?</h2><p>Will 15% transaction costs really be able to cover all taxes?</p><p>Danish businesses have a total turnover of some 500,000,000,000 each month give and take - an average gross margin of 45 will be a huge approximation but let&apos;s keep it in broad terms &#x2013; which equals costs of some 275,000M; of which 15% is 41,250M and multiplied by 12 months leave us with roughly 495,000M. At present some 3,000,000 are employed and their average income is 370,000 pr year; 15% of which is a total of some 166,500M. That&apos;s a total of 661,500M a year in transaction costs.</p><p>Hey - hey - hey! You will never get away with asking corporate Denmark to cough up 30%! I wouldn&apos;t dream of it! In fact I&apos;m asking businesses to keep more of their money. Sure, they will pay 15% on their costs, no matter what the money is spent on - that&apos;s gonna piss off some. But they get to save big time on their reporting, controlling, and submission of statements; and they get to pay way less income tax on their employees, a heavy burden which is going down from 40-60% to a mere 15%.</p><p>We left 225,000M on the table every month (the gross margin of businesses, remember?) and it&apos;s highly likely that a fair share of that will be offered as dividend to owners and shareholders. Let&apos;s make a defensive guess at 50% - which will net us another 202,500M in transaction costs (tax) a year! We&apos;ll have a grand total of some 864,000M to &quot;redistribute&quot; &#x2013; whether that is enough is a totally different story.</p><p>Because: at present (2023) the public budget was some 1,313,384M of which 715,510M was used on consumption (wages, more) and 481,256M was transfer incomes (spent by households). 396,000M was spent on wages and at least 40% would be taxes - removing that and adding 15% transaction costs will reduce the overall figure to 273,240M, moving the overall needle from 1,313,384M to 1,190,624M. Like <a href="https://blog.alco.dk/how-to-launder-money-part-iii#utopia">our Utopian</a> example we can reduce the transfer income&#x201A; without reducing the purchasing power, by -20% + 15% =&gt; 442,755M, further lowering the grand total to 1,152,124M. A few similar changes could be made but we&apos;d still be at least 200,000M short.</p><p>A couple of issues are important to consider</p><ul><li>we reduced VAT from 25% to 15% - increasing transaction costs on a filtered set of transactions starts the journey down the rabbit hole of complexity and loss of transparency! Either prices will drop and consumers are likely to spend more - or businesses will add another ~10% margin; which anyway will come back with 15-20,000M.</li><li>reducing complexity in the entire control chain (in fact more or less all together) likely will reduce staff considerably.</li><li>sourcing &quot;taxes&quot; will cut substantially on arrears (tax payer debts) and largely remove non-taxed incomes all together.</li><li>disrupting money transactions could be a kickstart to disrupting a number of public sector customs</li><li>policy-makers will be wise to &apos;test&apos; the volatility of this transaction cost &#x2013; starting off slow to maximize success from the get-go</li></ul><p>Learn of the <em>fine print</em> in the <a href="https://blog.alco.dk/how-to-launder-money-part-iii/">next part</a></p><h2></h2>]]></content:encoded></item><item><title><![CDATA[How to launder money]]></title><description><![CDATA[This limited series of posts ponders on the consequences for criminals, tax, vat, business profits and public spending if we added a scent to money - building a digital currency controlled by the National Bank]]></description><link>https://blog.alco.dk/how-to-launder-money/</link><guid isPermaLink="false">6657698c4c1dad0007be1322</guid><category><![CDATA[blockchain]]></category><category><![CDATA[fiat]]></category><category><![CDATA[krypto]]></category><category><![CDATA[money laundering]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Mon, 03 Jun 2024 07:16:13 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1545173168-9f1947eebb7f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDJ8fGxhdW5kcnl8ZW58MHx8fHwxNzE3MDYxMzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1545173168-9f1947eebb7f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDJ8fGxhdW5kcnl8ZW58MHx8fHwxNzE3MDYxMzY5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="How to launder money"><p>The best way to launder money obliviously is to keep it clean in the first place! </p><p>&quot;But I&apos;m sitting on this huge pile of stinking money!&quot; &#x2013; you tell me. Well, then you have a job to do!</p><p>My first advice for you is to go find yourself someone else with that problem too. You could swap money so to speak! His money stinks and so does yours but the funny thing with money is that once they change owner all the dirt and sweat (and blood?) rubs off all at once! Lend the other guy your money and in return they could lend you theirs! Set up an i-owe-you in a single sentence: </p><blockquote>I, John Doe, owe you, Jane Doe, US$ 200,000 which I promise to repay you in exactly 1 year with US$ 200,000.</blockquote><p>No interest hence no tax - just the principal.</p><p>As long as you &quot;swap&quot; equal amounts of money it&apos;s like you didn&apos;t at all and it&apos;s like they did not exist in the first place. </p><p>You could allow friends to join and widen the scope so to speak. Eventually they would start referring to your &apos;band-of-brothers&apos; as a bank &#x2013; in fact that&apos;s what actually happened. Some guy would lend someone else their money and have it paid back later!</p><p><strong>Disclaimer!</strong> It&apos;s probably the worst idea in the history of money laundering schemes &#x2013; don&apos;t go that way; I shared it only to prove the point: money don&apos;t stink!</p><h2 id="nationalize-moneyor">Nationalize money -or?</h2><p>At the moment Danish TV2 is streaming <em>Den sorte svane</em> (The Black Swan) a <a href="https://play.tv2.dk/serie/den-sorte-svane-tv2">limited series</a> documenting how relatively easy it is for criminals to avoid tax, VAT, and laundering of money.</p><p>Meanwhile in Folketinget (the Danish Parliament) politicians are debating (I&apos;m joking - they are not! They are debating their own mishaps on Instagram! But they should...) what to do about the <a href="https://www.danskindustri.dk/arkiv/analyser/2023/8/mere-end-100.000-ansatte-i-offentlig-administration/">growing number</a> of &apos;cold hands&apos; in the public administration - some 100,000 with 13% being new hires since 2016 (the total number of employees in public service is a mind blowing 750,000+, mind you). With pricey new IT systems to support the tax and VAT administration it has been necessary, allegedly, to hire an extra 2,000 pair of hands in this department alone! Speaking of tax and VAT; fighting <a href="https://denstoredanske.lex.dk/Sanjay_Shah">crafty business men</a> exploiting the Danish Tax Code also takes a hefty toll on public finances.</p><p>In <a href="https://blog.alco.dk/what-if-money-had-a-s-cent/">a previous post</a> I mentioned the banks having their field day with off the charts returns due to surcharges and rising interest rates. Credit card companies hate to be left alone at the station so they try to keep up on the price hike offering small business owners no easy way out when wanting to provide easy ways for customers to pay for goods in their stores, with price increases on payment processing in the double digits.</p><p>Let&apos;s for a very brief moment pause on that last sentence! A payment processing when all curtains and mirrors are pulled back goes more or less like this:</p><pre><code>C1: hallo C2!
C2: hi there C1!
C1: can I have you put 20$ into account #1234?
C2: sure! Consider it done!
C1: great! I owe you 20 bucks!
C2: sure do! Noted!
C1: thx - have a nice day!
C2: U2!</code></pre><p>It&apos;s obviously the &quot;happy path&quot; and all sorts of mishap may clutter the process but that&apos;s worth another story! Bottom line is that the payment processing is nothing more than 2 computers agreeing on submitting vis-a-vis receiving a number (a currency amount) and &#x2013; for the receiving computer &#x2013; an account identification. Optimized it&apos;s less than 10 Internet <em>packets, </em>an infinitely small cost added to perhaps 50 CPU cycles, an even smaller cost. A total of less than 1 cent (even if we include depreciation on the hardware and software included, energy, and man-power to keep the darn things running. Just so that you know what we are in fact talking about!</p><p>One way out would be to ask the Nationalbanken (The Danish National Bank) to setup shop and start running a cheap payment processing service - and lending money at fair rates - but there is not much evidence to support the public sector being good at running businesses!</p><p>The only way Nationalbanken could do a better job would be if it were to do a different job!</p><p>Learn of what job that could be in the <a href="https://blog.alco.dk/how-to-launder-money-part-ii">next part</a>.</p><h2></h2><h2></h2>]]></content:encoded></item><item><title><![CDATA[What if Money had a (s)cent?]]></title><description><![CDATA[Just imagine what a world it would be if money did in fact ‘stink’! I touch on some of the gains and vains]]></description><link>https://blog.alco.dk/what-if-money-had-a-s-cent/</link><guid isPermaLink="false">6625713d4c1dad0007be1051</guid><category><![CDATA[blockchain]]></category><category><![CDATA[krypto]]></category><category><![CDATA[pigeons]]></category><category><![CDATA[trust]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Mon, 22 Apr 2024 22:04:26 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1538513428543-e8b1880f8033?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDU1fHxNb25leXxlbnwwfHx8fDE3MTM4MjMyNTR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1538513428543-e8b1880f8033?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDU1fHxNb25leXxlbnwwfHx8fDE3MTM4MjMyNTR8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="What if Money had a (s)cent?"><p>Sorry for the pun &#x1F60E; - but in all fairness it isn&apos;t like I just dreamed it up (or picked up the saying back home where I was born - close to fishermen and farmers known to be rather adept to bartering); the Roman emperor Vespasian in fact is attributed the quote <em>pecunia non olet </em>(money do not stink - meaning it does not matter how you came about the green bags, their value is the same)!</p><p>But just stop of a second and consider what would be, if money did in fact &#x2018;stink&#x2019;!</p><p>What would this &#x2018;stink&#x2019; be? You wouldn&#x2019;t actually suggest bank notes to be dipped in some sort of fragrance now, would you? Certainly not! But let&apos;s leave the implementation for now - no matter how much I&apos;d like to focus on the technical side of things.</p><p>First of all, tax evasions would be a thing of the past! Every single euro, dollar, renminbi created will carry a ledger and when you receive 5 cents, each cent will have your name attached to the ledger.Should you later that same day hand two of those cents on to someone else, their name will be added to the ledger of each of those two cents. With me so far?</p><p>Secondly, stealing money will be next to impossible! With your name <em>imprinted</em> on every cent it will be impossible for anyone to forward &apos;your&apos; money to a third body acting &#x2013; at least doing so &apos;in good faith&apos;.</p><p>Finally money can be &quot;programmed&quot; for particular spenditure. The traditional helicopter money being spent by governments in crisis situations will not be needed anymore. Governments will be able to assign money for very particular purposes. Rent, energy, food. It&apos;s a revival of the tried and tested &quot;food stamps&quot; albeit with one very essential difference: you cannot build black markets with this kind of food stamps. 5 euros assigned to you for buying meat. Of cause you can buy the meat and then trade/barter that - but that&apos;s a different story.</p><p>I reckon you&apos;re left with questions - a lot of questions.</p><p><strong>Who will create the money?</strong> Anyone could issue money (and probably should) and they would add their own name to the top of the ledger - for anyone later receiving the money to see whom to turn to in order to exchange the money for some other value asset. Most will, however, probably be <em>created</em> by national banks.</p><p><strong>How will money be exchanged?</strong> Attaching a physical <em>ledger</em> to every cent obviously will not fly! Money will (go on) being exchanged electronically using digital wallets. Consumers are so used to it by now that anything else will certainly not meet with a happy ending. </p><p><strong>Will we still use VISA, Mastercard, more?</strong> Well, that&apos;s a tricky question! The basic service is providing the buyer with an easy way of paying while avoiding to carry around cash money, and at the same time afford the seller an easy way to accept payment without getting their teller stuffed with cash money (both parties are happy to being less prone to thieves). This basic service is easy replicated by a single computer handling millions of transactions easy minute.</p><p>That&apos;s not what makes VISA bag 30B US and change in 2023. They operate as money lenders too &#x2013; and that business will stay; but the &apos;card business&apos; will change!</p><p><strong>Who will profit from this &apos;stinking money&apos;?</strong> Well, people who did come by their wealth in dubious ways (stealing, drugs, trafficking, more) probably will not, as well as banks, debit card services, (cash) money lenders, and a whole industry of scammers. Once consumers get used to pay with &quot;stinking money&quot; you will always be able to follow the money trail. Buying a second hand sofa will not require you to ask for the original receipt - just ask to see the ledger!</p><p><strong>Will it be the end of the &quot;snake oil business&quot;?</strong> Probably not, but websites selling 10 dollar gadgets that they source in China at 50 cents will likely be in for some hardship!</p><p><strong>Is that not going to disrupt trade altogether?</strong> In some ways, sure! Businesses that provide value will always prevail! If you package a product or service with added value through customer service, on-site support, installation, more &#x2013; customers will favour your business; if your pricing is right! In fact trade will flourish because sellers and buyers will be able to do transactions cheaper and faster, and safer!</p><p>What are the downsides? Let me be honest: there are a few!</p><ol><li>unemployment: Tax officers, bank clerks, ATM repair men, commercial lawyers setting up trade contracts </li><li>governments watching you: to many if not most having the government keeping too close a tab on your activities is less preferable</li><li>something new: the biggest downside (apart from denying, those accustomed to enjoying the power of being in control of other peoples money, that luxury) probably will be a mental/psychological one; new ideas and new ways of doing things usually takes a very long time to get a foothold</li></ol><p>Is this at all possible? Read about <a href="https://blog.alco.dk/ripples-in-the-fabric/">Ripples In The Fabric </a>and a few previous posts on this blog, about the subject and then decide for your self.</p>]]></content:encoded></item><item><title><![CDATA[Ripples in The Fabric]]></title><description><![CDATA[With the demise of market economy everybody is questioning what comes next - I'm hinting at this]]></description><link>https://blog.alco.dk/ripples-in-the-fabric/</link><guid isPermaLink="false">65e78aa2d8a2b400070fd842</guid><category><![CDATA[AI]]></category><category><![CDATA[blockchain]]></category><category><![CDATA[krypto]]></category><category><![CDATA[trust]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Fri, 22 Mar 2024 08:46:42 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1617238749996-ab4c0f9fba57?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDQzfHxmYWJyaWN8ZW58MHx8fHwxNzExMDk3MTU5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1617238749996-ab4c0f9fba57?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDQzfHxmYWJyaWN8ZW58MHx8fHwxNzExMDk3MTU5fDA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Ripples in The Fabric"><p>What in Heavens is this post about? Ripples, Fabric? Have I gone mad? No! This post is about what we can use the previous posts for; with trust what can we achieve? First I&apos;ll touch on The Fabric, how the generic market economy is a spiders web of depending and interconnected <em>services</em>, and then I point to what disruptions may lie ahead. Finally I will introduce a train of thought -</p><h2 id="demise-of-the-market-economy">Demise of The Market Economy </h2><p>The global economy is majorically interconnected market economies &#x2013; and some that aren&apos;t but might as well be (China for all, but even places like North Korea is deeply dependant upon the rest of the world) based on <em>money</em> and the supply / demand mantra.</p><p>This <em>interconnectedness</em> starts in your living room more or less! It starts with you being interconnected with your partner (perhaps not but then with the guy you&apos;ve rented the flat of, or the company where you&apos;ve bought your shiny new 50&quot; LED TV &#xA0;with only a few euros up front and the rest in 36 easy installments), and it keeps going all the way to the TV factory in South Korea, the cement factory that produced the cement for the concrete poured into the foundation in the basement of the high-rise where you live, the truck drivers that moved your furniture from the old apartment, the baker around the corner, and by now I think you get the picture. What keeps all these tiny <em>wheels</em> in place? Money.</p><p>Like the song - <em>money makes the world go around</em> - and it&apos;s actually true! Goods change hands and cash the other way. It used to be barter - you&apos;d bring eggs to the market and end up with 2-3 knitted woolen sweaters, that you&apos;d exchange for a goat, and so on. Later you&apos;d carry gold pieces, then silver coins. Not that many years ago most kept a fair pile of bank notes in a secret place. Now you will have a digital wallet with some bizarre labeled crypto currencies. Each money moniker transformation did leave you just a tad more convenient. Barter could be such a hassle when no one would take your latest exchange of your hands (no demand). Gold pieces could be heavy to carry when you would be on a shopping spree perhaps buying a big plot of land or paying off that army of yours. Green backs always presents a threat if you take them to the wrong side of town (a lot of demand and not any consideration for your well-being). </p><p>Expansion of The Fabric (the interconnectedness) had two drivers. Money being more and more easy to move - in more technical terms you could say that the cost of transactions has fallen since like forever. Particularly since italian scientists &apos;invented&apos; <a href="https://lirias.kuleuven.be/bitstream/handle/123456789/119065/TEM1994-3_289-304p.pdf;jsessionid=A212A6765AE4068B63511F68C5EAA216?sequence=1">modern book-keeping</a> in the era of <a href="https://en.wikipedia.org/wiki/Italian_Renaissance">The Rinascimento</a> the cost has dropped increasingly fast. Why? Because now you did not have to bring &quot;cash&quot; but would just settle <em>in the books</em> and then someone who owed you money in that place or near by would go and settle your &quot;conto&quot; in your place and you&apos;d then tear his IOU to pieces and toss it in the open fireplace (saving you from risking being robbed on the way as one of the costs disappearing). The other driver happened a few hundred years down the road, in Scotland - when <a href="https://en.wikipedia.org/wiki/Adam_Smith">Adam Smith described</a> the division of labour / specialisation. Whether industrialisation precursored specialisation or it went vice versa is perhaps of less relevance - increasing wealth gave way to new ideas and methods were tested and they again provided even bigger returns. </p><p>I will not pretend to be able to squeeze 4-600 hundred years of economical, sociological, theological, basically human history into a 3 sentence explanation/characterisation, suffice to say we&apos;ve landed at a level of interconnectedness that obviously is dangerous! <a href="https://www.bbc.com/news/business-56559073">One ship</a> making a bad turn hit the global economy by $6 - 10bn a week, and that was just to top off a global market entrenched while spending estimates of $12tn costs fighting a pandemic putting on clear display how fragile and helpless most economies, nations and indeed individuals have become, eg. <a href="https://www.worldbank.org/en/publication/wdr2022/brief/chapter-1-introduction-the-economic-impacts-of-the-covid-19-crisis">50% of households not being able </a>to sustain basic consumption for more than 3 months of unemployment.</p><h2 id="road-bumps-ahead">Road Bumps Ahead</h2><p>Everything revolves around money - and that is increasingly less a blessing as automation, digitalisation, and de-globalisation progresses. Pressure on money-markets and currencies, the core building blocks of &#xA0;market economies. Battling the climate changes, money-laundering and other tax evasions, national strategies to de-globalise with huge implications for the regional specialisations of markets and industries, and the list goes on. This is The Fabric and the many <em>ripples</em> that we can observe here in the middle of the 20&apos;s. </p><p>Globalisation never was and never will be the answer - as foreseen by the likes of Kenneth Galbraith. <a href="https://en.wikipedia.org/wiki/Comparative_advantage">https://en.wikipedia.org/wiki/Comparative_advantage</a></p><p>Specialization is not the way forward - <a href="https://www.theaustralian.com.au/business/business-spectator/news-story/why-industrial-strength-is-born-from-diversity/68b45318e3d9dcbff41a8d7a8ad4e65a">https://www.theaustralian.com.au/business/business-spectator/news-story/why-industrial-strength-is-born-from-diversity/68b45318e3d9dcbff41a8d7a8ad4e65a</a></p><h2 id="the-puzzle-solved">The Puzzle Solved</h2><p>It&apos;s no coincidence that I focused on trust in the first post of this series! Would you trade with someone you did not trust? Would you pay them? Take their money?</p><h3 id="voting">Voting</h3><p>Like we established, trust is the corner stone to solving the puzzle! Once that one is in the books we can take on bigger bites. The first and equally important stone is direct democracy like they are used to in Schweiz. Current polarisations and rigging of elections with losers trying to overturn results has to end or we all risk being sent back to the stone age, literally (most experts concur that a nuclear war will end modern civilisation as we know it &#x2013; not because of radiation necesssarily but famine and no clean drinking water). Direct democracy is not a viable solution bar the smallest local communities, because of the costs of setting up polls. It so happens that our Pigeon tokens trust model will allow us voting every minute of the day almost for free!</p><h3 id="insurance">Insurance</h3><p>I&apos;ll wage a decent sized cold beer you didn&apos;t see this heading coming &#x1F605;</p><p>Paying for someone elses ill fortune is labeled insurance in some markets (like USA) and socialism elsewhere (Scandinavia).</p><p>If we could all vote on every claim - and all be granted access to considering the circumstances to the claim - would we vote fair? I am 100% undecided, maybe maybe not. It&apos;s a fair argument that those of limited means will have a hard time convincing those well off. On the other hand - insurance industry is doing <a href="https://www.oecd.org/daf/fin/insurance/Global-Insurance-Market-Trends-2022.pdf#page20">pretty darn good</a>, with returns on equity ranging from 12 to 50%, and mind you, in an industry with a global equity mass of US$ 35+ trillion. Big capital gains - in Denmark alone insurance companies raking in some US$ 2bn in fiscal 2021. Adding the substantial costs running insurance companies (some of the most digitalized and efficient companies operate at 14%) - again in Denmark, will add in excess of US$ 5bn.</p><h3 id="savings-loan">Savings &amp; Loan</h3><p>Like the next section on payments it is a walled garden guarded heavily by a select few organisations desperately trying to fend off any disruptions, and with good reason! Banks are a US$ 6bn profit business &#x2013; in Denmark.</p><p>If we add the previous 7bn we are at 13bn - which arguably is a fair bit more than change</p><h3 id="payments">Payments</h3><p>An entire industry (banking) is doing tremendously well handling something so mundane and, with the current technological advance, simple as - payments. One shop owner described it like this: </p><blockquote>Banks used to handle (and pay for out of their profits) money and we [shops] could focus on trading goods. Now we pay for everything!</blockquote><p>This remark was made pertaining to the (increase in) surcharges payable by merchants accepting credit card payments. The costs of spending/accepting money are - contrary to what one might expect with economies of scale and the advances in technology &#x2013; going up and shops now face a surcharge in the range from 1 - 6% depending upon the credit card in question, and choice of payment processor.</p><p>Could <em>we</em> do better? Heck yeah!</p><p>With the obiquitous smartphone and it&apos;s NFC (<em>near-field-communication</em>) a modestly complicated app could provide the <em>interface</em> and a simple request could shovel funds from your account to that of the shop keeper. Important to notice &#x2013; this is how it is done today, for all in Denmark, but with the &quot;added help&quot; of several parties sucking that tit! The basic transaction is </p><ol><li>verify that buyer&apos;s account is valid and has funds</li><li>verify that seller&apos;s account is valid and may accept funds</li><li>move funds from the buyer to the seller</li></ol><p>Whatever is wrapped around this simple 1 computer operation is <em>value adding</em> &#x2013; at the expense of the users!</p><p>Peering down the nuclear catastophe abyss I posit this is indeed national critical infrastructure not far from energy distribution, and miles ahead of current national hallmarks like museums, (rail)roads, schools, hospitals, more.</p><p>You may ask: but 1-6% isn&apos;t going to rock any boat now is it? Well, that depends upon your definition of boat, and rock! The EU reported on <a href="https://www.ecb.europa.eu/press/stats/paysec/html/ecb.pis2023~b28d791ed8.en.html">non-cash payments in 2023</a> being at EUR 111+ trillion - even 1% would slice a decent trillion (that is a million millions) euro off of consumers and businesses budgets! The basic &quot;service&quot; &#x2013; moving money from one account into another - could be handled easily by 1 computer/million users which translates into some 600 in the entire EU and keeping them afoot would not set back the ECB more than 1/100* of <a href="https://www.ecb.europa.eu/press/annual-reports-financial-statements/annual/annual-accounts/html/ecb.annualaccounts2023~f5a98cb02b.en.html">its 2023 operational costs</a> which were EUR 1,200+ million.</p><h3 id="real-estate">Real estate</h3><p>The final brick - pun intended - to the puzzle comes with a disruption of real estate, and not just real estate as in land, brick and mortar but consumer durables like cars, boats, houses, dish-washers, more. </p><p>With the current <em>consumption scheme</em> that does not compute at all provided the climate issues facing all of us, we have to build better/longer lasting durables and develop a more fine-grained logistics system for redeployment of <em>used goods. </em></p><p>Connecting every durable to the aforementioned pigeon tokens network will allow any buyer to perusing the event logs of any durable and - perhaps with the help of professionals - gauge a fair price. Event logs could be attached to subscription models and provide governments with models for taxing less performing durables. The possibilities are endless &#x2013; &#xA0;</p><hr><p>To sum it up a <a href="https://www.kfst.dk/media/vbunuwzv/20220809-konkurrencen-p&#xE5;-bankmarkedet-for-privatkunder.pdf">recent study</a> shows that the finance sector sits uncontested in the top when considering 128 industries/sectors when comparing the wage premium/rent sharing which is an indicator of less than optimal competition and market inequalities.</p><p>*) establishing and programming this pigeon token network would require some funds but sidestepping the urge to complicate and - cut to the chase - so to speak building a v1.0 of the pigeon token network would ask for less than EUR 5 million. Propagating it across the EU zone would be effortless with the primary &quot;sellers&quot; being shop keepers promoting this &apos;cheap&apos; system to consumers and perhaps offering rebates when utilised. </p><p>At 10-15 locations across EU with compute costs ranging from 3 - 50 EUR/month a 600 computers strong system (4-6 in each location &#x2013; with perhaps 3-5 main locations and 5-10 secondaries for spikes and failover) would accrue less than EUR 50,000/month whereas &#xA0;operational staff and engineers when out-sourced might cost EUR 100,000/month &#x2013; a total of some EUR 2 million/year. Add another EUR 2 million/year for separation of trafic, and allow management and further &quot;complications&quot; vis-a-vis standard EU bureaucracy and other leeches meddling with a resulting 3x factor will bring the costs to some EUR 12 million/year.</p><h2></h2>]]></content:encoded></item><item><title><![CDATA[Hvem skal vide hvem jeg er?]]></title><description><![CDATA[Brugen af blockchain kan ændre det danske samfund mange gange mere end tilfældet var, da vi indførte danKortet]]></description><link>https://blog.alco.dk/hvem-skal-vide-hvem-jeg-er/</link><guid isPermaLink="false">65f33d96d8a2b400070fdece</guid><category><![CDATA[AI]]></category><category><![CDATA[blockchain]]></category><category><![CDATA[pigeons]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Mon, 18 Mar 2024 23:37:25 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1533022586528-2e09bde0959b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDczfHxtYXNrfGVufDB8fHx8MTcxMDQ1NzE3Mnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1533022586528-2e09bde0959b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDczfHxtYXNrfGVufDB8fHx8MTcxMDQ1NzE3Mnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Hvem skal vide hvem jeg er?"><p>Den seneste tid har budt p&#xE5; en veritabel bredside i medierne, med dem selv som afsendere, oftest den (p&#xE5;tagede) indignerede, kr&#xE6;nkede, part eller i det mindste som den m&#xE5;bende voyeur. Politikerne har ikke v&#xE6;ret sene til at stable deres holdninger op p&#xE5; de traditionelle kasser af velmenende l&#xF8;fter og (mestendels tomme) trusler mod <em>tech-giganterne</em> &#x2013; </p><h3 id="s%C3%A5-hvad-er-op-og-ned-i-det">S&#xE5; hvad er op og ned i det?</h3><p>N&#xE5;r medierne og politikerne, og resten af os for den sags skyld, skriger p&#xE5; at nogen b&#xF8;r g&#xF8;r noget, er det s&#xE5;dan set ikke forkert! Det kan n&#xE6;ppe v&#xE6;re sundt for unge, mange langt fra k&#xF8;nsmodne, at se porno i timevis; det er uvist om det overhovedet er &quot;sundt&quot; for voksne, s&#xE5; her t&#xE6;nker jeg, at jeg er d&#xE6;kket rimeligt ind!</p><p>Det er l&#xF8;sningen, der er helt l&#xF8;srevet fra virkeligheden! Jeg skal pr&#xF8;ve at forenkle det efter bedste evne:</p><blockquote>Hovedparten af indholdet p&#xE5; Internettet leveres af web-servere, der m&#xE5;ske kan sammenlignes med bibliotekarer. Du g&#xE5;r til skranken og sp&#xF8;rger efter en bog titel. En yderst tjenestevillig bibliotekar springer fluks ud bagved og dukker 2-300ms senere op igen, b&#xE6;rende p&#xE5; den &#xF8;nskede bog, som du derefter sl&#xE6;nger dig i en af de dertil opstillede s&#xE6;kkestole. Du har ikke l&#xE5;nt bogen endnu - kigger bare i den - og bibliotekaren kan m&#xE5;ske i bedste fald huske bagefter, at du da vist havde mellemblondt &#xE5;r.</blockquote><p>Nu kommer &quot;bog politiet&quot; s&#xE5; og forkynder for alle l&#xE6;sehestene, at b&#xF8;ger om heste for fremtiden kun kan l&#xE5;nes af r&#xF8;dh&#xE5;rede. 1-0 til kontrollanterne.</p><blockquote><em>&quot;Jeg kan ikke lade dig se i den bog&quot;, siger bibliotekaren strengt, og peger p&#xE5; dine umiskendeligt mellemblonde h&#xE5;rtotter, der titter frem under huen. Du foretager et planm&#xE6;ssigt tilbagetog og regrupperer i ly af SjovHat butikken, der p&#xE5; det seneste har f&#xE5;et v&#xE6;ldigt gang i salget af r&#xF8;de parykker.</em></blockquote><p>1-1</p><p>Nu skal alle bogl&#xE5;nere herefter kunne fremvise gyldigt ID. 2-1 til kontrollanterne.</p><blockquote>&quot;Jeg skal bede om ID f&#xF8;r du kan komme ind p&#xE5; biblioteket&quot; konstaterer vagten ved d&#xF8;ren bryskt, da du tager trappen i 2 spring. K&#xF8;rekortet fra Legoland k&#xF8;ber hun ikke, men din stores&#xF8;sters sundhedskort virker straks meget bedre.</blockquote><p>2-2</p><p>Nu skal jeg ikke tr&#xE6;tte med et utal af t&#xE6;nkte scenarier fra det lokale bibliotek, blot konstatere at hvis det eksempelvis ikke er lykkedes (endnu) at komme salget af alkohol til mindre&#xE5;rige til livs, er chancerne for at de elektroniske &#xE6;kvivalenter bliver l&#xF8;st, nok mildt sagt til at overskue! </p><p>- fordi flere forhold spiller ind, som ingen har den fulde kontrol over &#x2013; end ikke et s&#xE5; gennemkontrolleret land som Kina! </p><ol><li>Afsenderen af en foresp&#xF8;rgsel - p&#xE5; for eksempel at f&#xE5; vist forsiden til en hjemmeside, der har samlet d&#xF8;dsvold videoer fra hele verden - har ingen forbindelse til udstyret, og afsenderens brug af udstyret har ingen konsekvens for afsenderen. Afsenderen kunne for den sags skyld st&#xE5; og pege p&#xE5; en helt uskyldig tredjemand med en pistol, og forlange at vedkommende kommanderer udstyret.</li><li>Udstyret/maskinen sender foresp&#xF8;rgslen i sm&#xE5; bidder der hver is&#xE6;r kan sammenlignes med vanddr&#xE5;ber, der l&#xF8;ber ned over en rude. De kan tage forskellige retninger under vejs, men ender alle p&#xE5; drypn&#xE6;sen under vinduet. &#xC9;n af grundene, til at Internettet er blevet s&#xE5; popul&#xE6;rt, er at denne &apos;rude&apos; er s&#xE5; fleksibel, at hvis der s&#xE6;tter sig noget skidt midt p&#xE5; ruden, glider vand dr&#xE5;berne blot udenom - de skal nok komme frem. P&#xE5; samme vis n&#xE5;r foresp&#xF8;rgslen bliver besvaret; her er det blot endnu mere udtalt fordi der er tale om mange flere sm&#xE5; bidder (typisk). I dag er det muligt at koble sig til Internet p&#xE5; rigtig mange m&#xE5;der (radio, fiber, mobil, m&#xE5;ske endda stadig gammeldags telefonlinjer).</li><li>De sm&#xE5; vand dr&#xE5;ber - den enkelte &quot;pakke&quot; af data - kan gemme sig i andre dr&#xE5;ber, s&#xE5; det bliver meget sv&#xE6;rt at &quot;filtrere&quot; en bestemt slags dr&#xE5;ber ud (omend jeg for fuldst&#xE6;ndighedens skyld skal indr&#xF8;mme at Kina har haft en vis succes med at g&#xF8;re det).</li></ol><h3 id="s%C3%A5er-svaret-s%C3%A5-at-vi-ikke-kan-g%C3%B8re-noget">S&#xE5; - er svaret s&#xE5;, at vi ikke kan g&#xF8;re noget?</h3><p>Nej - langt fra - men som i eksemplet fra biblioteket, vil det kr&#xE6;ve en fundamental &#xE6;ndring af synet p&#xE5; Internet, og p&#xE5; begrebet kontrol, n&#xE5;r vi kommer ud i den anden ende. &#xC6;ndringer som de fleste nok ikke vil bryde sig om. </p><p>F&#xF8;r vi kan &#xE6;ndre noget b&#xF8;r vi imidlertid f&#xF8;rst betragte &apos;systemet&apos; og identificere dets vigtigste karakteristika:</p><ul><li>kontrol</li><li>den frie aftaleret</li><li>bytteforhold</li><li>tillid</li></ul><p><strong>Kontrol</strong>: Vi efterlader masser af &quot;spor&quot; n&#xE5;r vi som forbrugere <em>surfer</em> Internettet i vores jagt p&#xE5; oplysning, underholdning, tilbud, k&#xE6;rester, osv. S&#xE5; mange spor at man i EU er blevet enige om at rejse en pegefinger. Det er s&#xE5;dan set ogs&#xE5; fornuftigt, og m&#xE5;ske kan det give lidt mere plads i reklamebudgetterne til den trykte presse, radio, TV, og andre medier, som har hensl&#xE6;bt sig gennem en Sahara lignende tilstand siden is&#xE6;r Google og Facebook satte opsamlingen af spor i system. </p><p>Nu vil vi s&#xE5; gerne rulle noget af denne &quot;anonymisering&quot; tilbage, s&#xE5; tech branchen kan sikre os mod - os selv - og naturligvis overr&#xE6;kke n&#xF8;glerne til denne kontrol, til politikerne, som jo ved, hvad der er bedst for os; eller i hvertfald for &quot;<em>the greater good&quot;</em>!</p><p>Men, som vi gennemgik i eksemplet fra biblioteket ovenfor, er kontrol p&#xE5; Internettet en monumental og samtidig uregerlig og diffus st&#xF8;rrelse, der stiller flere sp&#xF8;rgsm&#xE5;l, end den giver svar: flertallets diktatur? bonus pater in familias? Laveste f&#xE6;llesn&#xE6;vner? Pareto? </p><div class="kg-card kg-callout-card kg-callout-card-yellow"><div class="kg-callout-emoji">&#x1F9D0;</div><div class="kg-callout-text">Hvilken m&#xE5;lestok skal kontrollen udm&#xE5;les med og hvad skal konsekvenserne v&#xE6;re?</div></div><p><strong>Den frie aftaleret</strong> er hj&#xF8;rnestenen i interaktionen mellem mennesker. Den s&#xE6;tter os i stand til at k&#xF8;be en grill i Bygma, ogs&#xE5; selv om den samme grill i et andet byggemarked koster 500 kr mindre! Tidligere gav det plads til langt flere led i <em>varek&#xE6;den</em> - fra grill&apos;ens f&#xF8;dested til forbrugerens terrasse. Her har Internettet kollapset varek&#xE6;den i s&#xE5;dan en grad at det &quot;n&#xE6;sten&quot; er muligt at k&#xF8;be en bil p&#xE5; nettet - fra fabrikken, hvor de bliver fremstillet! </p><p>Det har ogs&#xE5; givet plads til en ny slags &quot;kr&#xE6;mmere&quot; som fik frataget deres levebr&#xF8;d p&#xE5; <em>markedet</em>, hvor de k&#xF8;bte billigt i den ene ende, og spurtede ned i den anden ende, og solgte med gevinst. Nu lever de af at s&#xE6;tte webshops op, hvor de s&#xE6;lger varer &quot;i den ene ende af markedet&quot; (fx i Danmark), som de s&#xE5; bagefter spurter &quot;over i den anden ende af markedet&quot; (fx i Kina) og k&#xF8;ber med gevinst. Bortset fra r&#xE6;kkef&#xF8;lgen, er metoden pr&#xE6;cis den samme. </p><div class="kg-card kg-callout-card kg-callout-card-yellow"><div class="kg-callout-emoji">&#x1F9D0;</div><div class="kg-callout-text">Er vi parate til at give slip p&#xE5; begrebet &quot;penge lugter ikke&quot; (som i sin inderste kerne ligger bag eksemplet)?&#xA0;</div></div><p><strong>Bytteforhold</strong> er en (anden) vigtig brik i billedet. For at forst&#xE5; mekanikken, som regerer Internettet, kr&#xE6;ver det at vi ser p&#xE5; det stik modsatte! </p><p>Fort&#xE6;ring af en fl&#xF8;deskumskage og medf&#xF8;lgende nedsv&#xE6;lgning af den obligatoriske kop skoldhed chokolade - RIGTIG chokolade. Du betaler (egnsbestemt ganske vidst) en mindre herreg&#xE5;rd for arrangementet, og retten til at sidde og blomstre i dekorative omgivelser indtil der gror h&#xE5;rd hud p&#xE5; -</p><p>Konditoriet har den udfordring, at det ikke kan s&#xE6;lge flere kage/chokolade combo&apos;er end de 1) kan n&#xE5; at fremstille, 2) har stole og borde til, 3) kan mase kunder igennem butikken til, hvis de kan overbevise &apos;t&#xE5;berne&apos; om at sl&#xE6;be kolesterol giften med sig hjem, men selv hvis de l&#xF8;ser alle de udfordringer, med et hav af bagere, udvidelser af konditoriet til Field&apos;sk dimensioner, og ja, hvem ved hvordan de f&#xE5;r nogen til at tage varm kakao med sig hjem i et papkrus &#x2013; selv da er der en fysisk begr&#xE6;nsning p&#xE5; hvorlangt fra, kunderne vil k&#xF8;re for at sidde og spise - eller tage med hjem - fl&#xF8;deskumskager; trods alt!</p><p>Internettets kundeunderlag er principielt alle mennesker p&#xE5; hele jorden - selv dem uden Internet forbindelse, for de kunne jo s&#xE5;dan set godt f&#xE5; lyst til et eller andet, og kortvarigt benytte en vens forbindelse.</p><p>Konditoriet skal betale alle og deres f&#xE6;tter, hvis det vil udvide forretningen. Kommer der mere trafik til en hjemmeside kan det i nogen tilf&#xE6;lde betyde at indehaverne kan forhandle sig til en billigere pris pr trafik enhed.</p><p>S&#xE5; meget p&#xE5; hovedet vender alt! Hvad der i &quot;den virkelige verden&quot; ville kr&#xE6;ve megen forberedelse, lang tid til implementering og realisering, og betydelige &#xF8;konomiske risici, kan i &quot;den elektroniske verden&quot; ofte l&#xF8;ses n&#xE6;sten &#xF8;jeblikket, og med betydelige omkostningsfordele som resultat. Forretningsmodeller skalerer bare bedre p&#xE5; Internettet.</p><div class="kg-card kg-callout-card kg-callout-card-grey"><div class="kg-callout-emoji">&#x1F9D0;</div><div class="kg-callout-text">Kan en l&#xF8;sning v&#xE6;re at l&#xE6;gge afgift p&#xE5; konsumenternes brug af Internettet &#x2013; eller p&#xE5; udbydernes levering af indhold?</div></div><p><strong>Tillid</strong> har v&#xE6;ret en effektiv filter mekanisme i m&#xE5;ske &#xE5;rtusinder. L&#xE6;nge f&#xF8;r Gutenberg udvekslede mennesker information, men b&#xE5;ndbredden var horibel ringe og fastholdelsen liges&#xE5;. Natur/menneskeskabte katastrofer kunne bort erodere stort set al viden p&#xE5; kort tid - som fx da <a href="https://en.wikipedia.org/wiki/Library_of_Alexandria">biblioteket i Alexandria br&#xE6;ndte</a> (uanset at der er tvivl om hvormeget viden der reelt gik tabt). Information var - ogs&#xE5; dengang - flygtig og bundet meget h&#xE5;rdt op p&#xE5; <a href="https://en.wikipedia.org/wiki/Shooting_the_messenger">tillid til afsenderen</a>. Den har aldrig v&#xE6;ret perfekt, men tidligere var det trods alt nemmere at kunne se en person i &#xF8;jnene og, i det omfang modtageren besad menneskekendskab (og dermed i et vist omfang kunne filtrere afsenderens <em>l&#xF8;gne</em>), validere kvaliteten af den leverede information.</p><p>Internettet har p&#xE5; den ene side frar&#xF8;vet den enkelte modtager dette v&#xE6;rkt&#xF8;j omend samtidig leveret et andet: muligheden for at s&#xF8;ge alternative kilder hurtigt, enkelt og billigt (egenskaber som tidligere ikke var for h&#xE5;nden). Problemet med mennesker er imidlertid at de er dovne, og s&#xE5; vil de i grunden gerne tro godt om deres medmennesker, til det punkt, hvor de direkte bliver l&#xF8;jet til. S&#xE5; i stedet for at forholde sig kritisk til en information, v&#xE6;lger mange at acceptere kvaliteten af denne information, og udsagnet som sandhed. Fejlen ligger hos denne, den f&#xF8;rste modtager, men vokser eksponentielt, ja mere logaritmisk, n&#xE5;r informationen b&#xE6;res videre til modtagerens inderste tillidskreds! Historien om <a href="http://visitandersen.dk/det-er-ganske-vist/">fjeren og de fem h&#xF8;ns</a> som anskuelsesundervisning p&#xE5; daglig basis.</p><p>N&#xE5;r forskere og studerende ved de h&#xF8;jere l&#xE6;reanstalter fremstiller rapporter og samler deres undren, indsigt, og erkendelse, forventes/skal de vedl&#xE6;gge kildehenvisninger, der dybest set er der, for at kunne skabe den n&#xF8;dvendige tillid hos en l&#xE6;ser. </p><div class="kg-card kg-callout-card kg-callout-card-purple"><div class="kg-callout-emoji">&#x1F914;</div><div class="kg-callout-text">Tillid kan meget vel v&#xE6;re <strong>den</strong> afg&#xF8;rende faktor, som kan &#xE6;ndre alt i vores tilgang til Internet!</div></div><h3 id="hvad-kan-vi-s%C3%A5-g%C3%B8re">Hvad kan vi s&#xE5; g&#xF8;re?</h3><p>Vi starter bagfra i listen &#x2013; fordi det, m&#xE5;ske, l&#xF8;ser flere af de andre udfordringer! Vi starter med at genetablere tilliden; tilliden mellem afsender og modtager. Det beh&#xF8;ver ikke n&#xF8;dvendigvis v&#xE6;re en fordel, i det mindste ikke for afsenderen, der med den her model risikerer at st&#xE5; uden et produkt, uden en fordel, et <em>spiel</em> &#x2013; og dermed uden en interesse i at deltage (og ja - det vil s&#xE5; v&#xE6;re et problem i sig selv, som vi m&#xE5; arbejde med).</p><p>Kan vi ikke &quot;bare&quot; forlange at alle afsendere skal bruge MitID? Teoretisk set jo - hvis MitID var et fantastisk produkt - men det er det ikke, og der er s&#xE5; mange <em>use cases</em> hvor MitID ikke virker i dag, blot i Danmark, at det vil v&#xE6;re en meget lang og meget sej kamp op ad bakke, at l&#xF8;se det. Lad mig n&#xE6;vne 3: unge/b&#xF8;rn under 13, &#xE6;ldre/fysisk udfordrede/hospitaliserede immobile, maskiner. Dern&#xE6;st kr&#xE6;ver MitID en infrastruktur, som vi har i Danmark, men som langt fra vil v&#xE6;re tilstede i resten af verden. Endelig er transaktionshastigheden h&#xE5;bl&#xF8;s; forestil dig at skulle bruge MitID i supermarkedet eller p&#xE5; togstationen.</p><!--kg-card-begin: markdown--><h3 id="hvad-er-kravene-da">Hvad er kravene da?</h3>
<h4 id="hastighed">Hastighed</h4>
<p>For at begynde bagfra (igen) er m&#xE5;let at den samlede transaktionsvarighed ikke m&#xE5; v&#xE6;re over 7-800ms, alts&#xE5; lige under et sekund. Det er vigtigt, fordi vi mennesker har en &quot;pause&quot; oplevelse, der ligger omkring et sekund. Alt under 1 sekund sker &quot;med det samme&quot; &#x2013; alt over 1 sekund &quot;h&#xE6;nger&quot;.</p>
<h4 id="infrastruktur">Infrastruktur</h4>
<p>Dern&#xE6;st er kravet til infrastrukturen at mindst &#xE9;n af brugerne &#x2013; enten afsender eller modtager &#x2013; har Internet forbindelse i transaktions&#xF8;jeblikket, og at begge parter enten har haft eller f&#xE5;r forbindelse indenfor et kort(ere) tidsrum. Der vil v&#xE6;re (mange) situationer, hvor dette krav vil v&#xE6;re sv&#xE6;rt at opfylde - det er jeg klar over - men mange af de situationer mener jeg b&#xF8;r kunne l&#xF8;ses ved at &#xE6;ndre spillereglerne for informationsudveksling i transaktions&#xF8;jeblikket.</p>
<h4 id="minimum-af-interaktion">Minimum af interaktion</h4>
<p>For at l&#xF8;se den v&#xE6;rste foruds&#xE6;tning skal vi selv medbringe tillid; tillid til maskinen! I det mindste i et afm&#xE5;lt omfang. Vi skal reducere den menneskelige interaktion med maskinerne, og lade maskinerne selv tr&#xE6;ffe afg&#xF8;relserne &#x2013; og s&#xE5; naturligvis giver brugerne en veto-ret. Retten til at sige maskinerne imod, til at afvise en transaktion, som maskinerne ellers er blevet enige om er ok.</p>
<!--kg-card-end: markdown--><h3 id="hvordans%C3%A5dan-mere-i-praksis">Hvordan - s&#xE5;dan mere i praksis?</h3><p>Overlader vi etableringen af tillid til maskiner, kr&#xE6;ver det f&#xF8;rst og fremmest at maskinerne er gennemskuelige - s&#xE5; vi forst&#xE5;r dem - og dern&#xE6;st at mennesker eller organisationer, som vi, som individder, har tillid til, er i stand til at verificere at maskinerne virker, og til stadighed har mulighed for at gentage denne verificering. Det vil sige: vi har brug for et uafh&#xE6;ngigt organ, valgt af forbrugerne selv, tillagt den forn&#xF8;dne kompetance, og ansvar, for at efterpr&#xF8;ve og til rutinem&#xE6;ssigt/periodisk tilse maskinernes korrekte virke.</p><p>Maskinerne er, ladt alene, ikke-korrumperbare, og derfor b&#xF8;r der ikke v&#xE6;re nogen mulighed for at &quot;komme til dem&quot; &#x2013; ud over alts&#xE5; i forbindelse med det uafh&#xE6;ngige organs <em>revision</em> og kontrol af maskinernes funktionsdygtighed. Det er ikke umiddelbart nogen uoverstigelig hindring. Vi har titusindvis af automatiske maskiner i drift over hele kloden, som d&#xF8;gnet rundt dirigerer telefon trafikken, Internet trafikken, energi og andre kritiske systemer. Vort teknologiske niveau er ogs&#xE5; s&#xE5;dan at de er overskuelige at bygge - det er ikke raketvidenskab, og derfor ikke nogen voldsom investering.</p><p>Det var s&#xE5;dan i store tr&#xE6;k alt det positive! For i det f&#xF8;lgende kommer s&#xE5; en r&#xE6;kke af de praktiske tiltag, og deres &quot;negative&quot; konsekvenser. Negative har jeg sat i anf&#xF8;rselstegn, fordi det negative afh&#xE6;nger af &#xF8;jnene, der ser. Der findes mig bekendt ikke mange beslutninger i livet, som ikke har konsekvenser - store eller sm&#xE5;. Nogle konsekvenser kommer du selv til at d&#xF8;je med, andre bliver det op til dine b&#xF8;rn at overkomme eller forlige sig med. Andre igen p&#xE5;f&#xF8;rer dine omgivelser konsekvenser, m&#xE5;ske i form af &#xE6;ndrede/forringede/tabte forretningsmuligheder. </p><p>Det afg&#xF8;rende her er ikke konsekvensernes st&#xF8;rrelse eller omfang, men om vi som mennesker/samfund/civilisation vurderer dem som acceptable &apos;omkostninger&apos; for at opn&#xE5; en r&#xE6;kke fordele. Jeg ville &#xF8;nske at det var beslutninger, vi kunne overlade til politikerne (og s&#xE5; i bedste mandagstr&#xE6;ner stil hade og nedg&#xF8;re bagefter) men det kan vi ikke, fordi politikerne aldrig ville turde tr&#xE6;ffe beslutninger, der potentielt ville g&#xF8;re dem selv overfl&#xF8;dige, samtidig med at betydelige industrier ville visne v&#xE6;k; industrier der traditionelt har levet et symbiotisk liv med statsmagten. Hvem og i hvilket omfang kommer vi til!</p><p><strong>Revisionssporet</strong> er et kendt <em>kunstgreb</em> fra &#xF8;konomiens verden. Man kan kalde det en sladrehank, men det er upr&#xE6;cist, for revisionssporet angiver ikke nogen, og sladrer ikke om nogen. Her er for eksempel Skat&apos;s definition af begrebet:</p><blockquote>Bogf&#xF8;ringsloven kr&#xE6;ver, at der skal v&#xE6;re et fyldestg&#xF8;rende revisionsspor s&#xE5; alle indberetninger kan spores tilbage til den n&#xF8;dvendige dokumentation (grundbilag), fx l&#xE5;neaftale og til den indberetningspligtiges regnskab.</blockquote><p>Det er med andre ord en identifikation/en registrering af en h&#xE6;ndelse. Det er en kilde til mange omkostninger, meget arbejde, og megen interesse i alle typer virksomhed, offentlige s&#xE5;vel som private, fordi: der skal v&#xE6;re styr p&#xE5; &#xF8;konomien.</p><p>Inddrager vi dette revisionsspor i hele vort liv, f&#xE5;r det selvsagt en kolossal betydning og uoverskuelige konsekvenser. F&#xF8;r du forkaster id&#xE9;en vil jeg bede dig g&#xF8;re et lille tanke eksperiment: hvis alle de mennesker, du har v&#xE6;ret i ber&#xF8;ring med igennem hele dit liv, enten direkte eller igennem dit arbejde, som kunde eller leverand&#xF8;r, igennem din rolle som barn eller for&#xE6;lder - hvis de alle kunne samles i et rum, og f&#xE5; lov at tale sammen indbyrdes? Hvordan ville det p&#xE5;virke din opf&#xF8;rsel, dine beslutninger, din moral/etik? Stadig et nej - ikke? S&#xE5; sp&#xF8;rg dig selv, hvordan alle dem, der i tankeeksperimentet er samlet i rummet, ville svare!</p><p>Hvordan skal vi i praksis kunne koble et revisionsspor p&#xE5; vort liv? Det kan vi g&#xF8;re ved at anvende en teknologi, som benyttes i en helt anden sammenh&#xE6;ng: blockchain teknologien, ben&#xE6;vnes den. For krypto valutaer er den altafg&#xF8;rende, og for krypto valutaernes ukronede konge, bitcoin, hele fundamentet. Langt den overvejende del af krypto valutaer eksisterer i et slags ureguleret parallel univers, hvor den enkelte valutas v&#xE6;rdi (for de flestes vedkommende) er bundet p&#xE5; v&#xE6;rdien af bitcoin eller afh&#xE6;nger af brugernes tillid. Blockchain er meget kort resumeret, en elektronisk <em>analog</em> til en perlekrans med en knude bundet om en perle for hver registreret transaktion (hvor transaktion kan v&#xE6;re alt fra et k&#xE6;restebrev til en embedsmands randbem&#xE6;rkning under sagsbehandlingen i Finansministeriet). Fordelen ved denne <em>perlekrans</em> er at hver transaktion kan f&#xF8;lges &#x2013; og benytter vi den overalt, ogs&#xE5; i virksomhederne og deres bogf&#xF8;ring, f&#xE5;r begrebet <em>dobbeltbogf&#xF8;ring</em> pludselig en helt anden og endnu mere genial betydning.</p><p>Virksomheder bruger, som alerede n&#xE6;vnt, en del energi p&#xE5; at sikre et korrekt revisionsspor, men problemet er at s&#xE6;lger og k&#xF8;ber virksomheder (n&#xE5;r de handler med hinanden) har hver deres revissionsspor. Isoleret set kan det naturligvis v&#xE6;re en fordel (for en konkret virksomhed), fordi den kan <em>tilpasse</em> sit revisionsspor til sit aktuelle behov (det er meget ofte en omg&#xE5;else af reglerne, men desv&#xE6;rre ikke nogen p&#xE5;stand - Enron, WireCard, Nordisk Fjer og IT Factory er blot nogle af de mere prominente eksempler), men med en <em>perlekrans</em>, hvor transaktionerne med en k&#xF8;ber eller en s&#xE6;lger skal <em>passe sammen</em>, forsvinder denne type fuks med et slag. Det samme g&#xF8;r sig naturligvis g&#xE6;ldende, n&#xE5;r k&#xF8;ber eller s&#xE6;lger er en privat person.</p><p>Det fjerner ogs&#xE5; bankernes behov for at grave efter hvidvaskningsfors&#xF8;g &#x2013; fors&#xF8;gene vil sikkert ikke forsvinde, men de vil meget enklere at efterpr&#xF8;ve.</p><p>Vi kan ogs&#xE5; benytte perlekransen i en anden sammenh&#xE6;ng. N&#xE5;r for&#xE6;ldre giver deres b&#xF8;rn <strong>elektronisk udstyr </strong>som computere, smartphones, og smartwatches, b&#xF8;r de tilbydes en mulighed for at installere programmer, der anvender denne perlekrans teknologi. Det g&#xE6;lder s&#xE5;dan set ogs&#xE5; de <em>devices</em> voksne selv anvender.</p><p>Frav&#xE6;lger for&#xE6;ldrene det, for det b&#xF8;r naturligvis v&#xE6;re et valg, fraskriver de sig muligheden for at placere skylden p&#xE5; <em>tech-giganterne</em>, s&#xE5;dan som det sker i dag. </p><p>Hvorfor? Fordi det med perlekransen (eller rettere, med de programmer som benytter denne teknologi) vil v&#xE6;re muligt at benytte en positiv liste af tjenester, ligesom det ogs&#xE5; vil v&#xE6;re muligt at spore brugen af den enkelte tjeneste, hvilke data der er blevet udvekslet, og med hvem. </p><p>Der er endnu et anvendelsesomr&#xE5;de &#x2013; penge. Benytter vi perlekransen p&#xE5; <strong>udvekslingen af penge</strong>, fjerner vi begrebet <em>penge lugter ikke</em>, fordi det herefter vil v&#xE6;re muligt at f&#xF8;lge enhver transaktion - f&#xF8;lge brugen af hver enkelt 25 &#xF8;re. Det vil have en r&#xE6;kke afledte effekter, som jeg vil behandle i en s&#xE6;rskilt post. Det vil v&#xE6;re m&#xE5;ske den mest samfunds- og system omkalfatrende &#xE6;ndring, mange gange st&#xF8;rre end da Danmark indf&#xF8;rte danKortet.</p><p>Det sidste omr&#xE5;de jeg vil n&#xE6;vne, hvor vi kan bruge perlekrans teknologien, er valg. N&#xE5;r enhver transaktion kan spores og valideres, vil det v&#xE6;re n&#xE6;rliggende at benytte teknologien til at <strong>afvikle elektroniske valg</strong>. Valg kan afvikles flere gange om dagen om n&#xF8;dvendigt, og prisen vil v&#xE6;re negligerbar. Det kan v&#xE6;re valg til bestyrelser, foreninger, kommunale, regionale, statslige. Valg i grundejerforeningen og valg til Folketinget. Ja - det kan over tid blive n&#xF8;dvendigt at skrive Grundloven om, for hvis alle kan stemme altid, bliver Folketinget mere en administrativ funktion, der forbereder borgernes valg (ud fra forslag de selv har stillet) og debatterer dem (p&#xE5; borgernes vegne) i transmitterede sessioner, med det form&#xE5;l at kl&#xE6;de den enkelte borger p&#xE5;, til at kunne tr&#xE6;ffe sit eget valg, p&#xE5; et veloplyst grundlag.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Trustworthy Messages]]></title><description><![CDATA[Keeping messages safe traveling from the sender to the receiver using existing standards albeit in new configurations and some amendments.]]></description><link>https://blog.alco.dk/a-trustable-message/</link><guid isPermaLink="false">65e25520a684ad000767e52f</guid><category><![CDATA[AI]]></category><category><![CDATA[blockchain]]></category><category><![CDATA[DNS]]></category><category><![CDATA[message]]></category><category><![CDATA[trust]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Sun, 03 Mar 2024 11:51:05 GMT</pubDate><media:content url="https://blog.alco.dk/content/images/2024/03/pigeon_2.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.alco.dk/content/images/2024/03/pigeon_2.png" alt="Trustworthy Messages"><p>This is the third post evolving around the trust issues facing most facets of using the services offered by <em>the cloud</em>. I&apos;ve questioned the <a href="https://blog.alco.dk/aint-an-issue/">need for trusting content</a> and I&apos;ve <a href="https://blog.alco.dk/trust-me-im-real/">sketched a decentralized authentication protocol</a>. Now we must turn our attention to the real reason for jumping through all these hoops: the content &#x2013; the message.</p><p>I guess most of you have played the game that goes a little like this: get lined up in a row with 4-7 people in each row, and have the first person in each row have a pen and a piece of paper, and let each of the rest of the people in each row stand close enough to their peer in front of them to reach their back. Now draw a simple figure on the back of the person at the back of each row, and have each person draw this figure on the back of the person in front of them, until the figure reaches the person in the front of each row. Finally have the first-in-row people draw the figure on paper. Chances are that 1 in every 10 rows get it fairly right.</p><p>Quite an introduction to signal/noise in messages, right? That&apos;s even without introducing any external sources like lack of light, high volume playing of music, more. </p><p>Keeping messages safe traveling from the sender to the receiver is quite a feat, hence any message should be verified against a hash calculated just as it leaves the sender. </p><p>So in order to allow for secure transmission of trustworthy messages what do we have?</p><ol><li>We must allow for full transparency pertaining to the compilation of the message in effect allowing the receiver to reach at the same &quot;conclusion&quot; as the sender did once finished compiling the message.</li><li>We must allow the receiver to question whether the message is exactly as intended by the sender.</li><li>Finally we must cater for the paranoia of the receiver &#x2013; allow for them to ascertain themselves of the authenticity of the sender.</li></ol><p>We&apos;ve dealt with Number 3 <a href="https://blog.alco.dk/trust-me-im-real/">in a previous post</a>.</p><p>Number two could be dealt with rather mundanely using a simple hash. The sender will have to keep this hash readily available at all time (they will probably &apos;outsource&apos; the job to some machine for receivers (machines) to question on a allways-on-schedule).</p><p>Number 1 is a totally different animal! Current levels of technology offer many facets of this transparency but in order to be practical in operations these technologies will have to be bundled in novel ways. I&apos;m not able to detail this toolset in proper details but I will disclose a few glimpses as best I can:</p><p>Written content may prove the easy one. When starting on a new message (whether a <a href="https://www.google.dk/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;ved=2ahUKEwiRkeKhk9SEAxVHPhAIHV5fCDkQFnoECEAQAQ&amp;url=https%3A%2F%2Fwww.t-mobile.com%2Fresources%2Fwhat-is-an-sms&amp;usg=AOvVaw0htZVG4NE0NSR4Jn2TRGm6&amp;opi=89978449">SMS</a> or the next <a href="https://www.google.dk/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;ved=2ahUKEwjNw7LXk9SEAxXYFBAIHX4NC1gQFnoECB8QAQ&amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWar_and_Peace&amp;usg=AOvVaw2Robi7mTxSKrBf-RAhiag2&amp;opi=89978449">War &amp; Peace</a>) the author will initialize a repository for persisting every small change, and then every few hundred milli seconds the workbench/editor will autosave the deltas (changes) to the document(s) together with occasional biometrics from the author and other environmental variables like what the time in the current time zone is, current air pressure, temperature, more.</p><p>I see your next question forming as you read! <em>Is the really necessary?</em> Not for persisting a groceries list certainly not but I guess neither you nor I will be the best judges of that - the receiver will.</p><p>I like to think that any sender will lean towards placing as many pieces of verifiable facts as possible in the hands of the receiver when they face that terrible situation: Is this in fact a trustworthy message. </p><p>All of this obviously builds on a presumption that the sender/author does indeed compile their message in good will, fact founded, and as a <a href="https://en.wikipedia.org/wiki/Bonus_pater_familias">bonus pater familias</a>. I am well aware that such a precondition is not by a long shot the standard operated by many <em>authors</em> &#x2013; recent years have witnessed political movements like trumpism trumpet (pun intended) its alternate reality <em>facts</em> without remorse and demonstrating a rather dinged morale at best. The model I&apos;m pedaling will none the less operate just at well in any reality. It only takes receivers to acknowledge and trust the sender; and if they get verification that the sender is indeed who they claim to be then by their standards the message will be trustworthy (in their reality).</p><p>Any content, any message, clearly will grow in size depending on the number of variables allowed by the sender/author. Battling this issue will add to the exchange protocol between sender and receiver. Receivers may instruct machines to initially ask only of the sender machine the content and then only when instructed they will start asking for meta data.</p><p>So far I&apos;ve applied only the <a href="https://www.firewall.cx/networking/network-protocols/dns-protocol/protocols-dns-query.html">DNS protocol</a> and the <a href="https://www.techtarget.com/searchsoftwarequality/definition/HTTPS">HTTPS protocol</a> and retrieving the message/content could easily utilise the HTTPS protocol as well with one caveat: HTTPS is a stateless protocol and in a fully decentralized state where each sender keeps all machines on their own device it may prove a more convoluted endeavour to facilitate the workflow contrary to one where most of the machines are operated out of &apos;fixed locations&apos;. Allow me to elaborate.</p><p>Senders operating out of their device while <a href="https://www.collinsdictionary.com/dictionary/english/roving">roving</a> will change network address frequently. That does not prove a problem by itself as dynamic DNS may update the conversion from <code>ATHLETE69</code> to some IP address in a few milli seconds &#x2013; but moving between various networks with a host of different firewalls could trouble the questioning, and requests for transmission depending upon the ports allowed inbound to a network; and port 80/443 which are used by HTTP/S are seldomly open <strong>from the outside</strong> inwards, only inside outwards, or they are directed at specific local area network addresses in a <a href="https://en.wikipedia.org/wiki/DMZ_(computing)">DMZ</a>, because the network has web servers placed here. It&apos;s not like undoable only it will require some careful consideration. Optimally all senders would decide for hosting-provider services to complete tasks commanded by the sender&apos;s machines but such luxury will severely narrow the total addressable market! One prominent way of overcoming ports not being available, also categorized as networks not being traverseable, is adding something called <a href="https://webrtc.org/getting-started/turn-server">TURN servers</a> (short for Traversal Using Relays around NAT). This, however, adds considerable system complexity to the overall design. Another design choice would be <em>store/forward</em> where messages are kept in escrow until users&apos; machines are able to collect - much like email operates. Not a flexible choice either. Then there is the appliance model. </p><p>From a privacy policy point the appliance model is perfect. From a system design point of view even so. Considering the user experience most certainly too. You could say: <em>it just works</em> - to quote Steve Jobs back in 2011 when introducing iCloud.</p><!--kg-card-begin: markdown--><p>When signing up for a pigeon token the user will receive a small appliance perhaps the size of a packet of <s>cigarettes</s> chewing gum that they will attach to their home network.</p>
<!--kg-card-end: markdown--><p>This obviously will only work if you actually have got an Internet connection at home (some 70% in EU, about 97% in the US, and 60+% globally as of 2023). The appliance will host the data store and other machines like the certificate authority perhaps even if the user may prefer and buy third-party service providers for other reasons. Now the store/forward design suddenly sits a lot more comfortable with me. </p><p>Senders may leave notices with the &apos;user&apos; / receiver with out them even have their device turned on, without any privacy issues coming into play. The user may choose to let machines do the verification and message transmission fully detached from their own device and in timeslots (eg when the user is sleeping) not disturbing the user. Roving with their device the user will &apos;call home&apos; at intervals or choose to stay connected and operate a TURN server themselves. Options will be available. And, importantly, the aforementioned alternatives still are viable &#x2013; it&apos;s entirely up to the consumer/user and their desire for privacy, security, comfort, ease of application.</p>]]></content:encoded></item><item><title><![CDATA[Trust me - I'm real!]]></title><description><![CDATA[we can manage the trust issues currently wreaking havoc amongst "cloud" based services, using DNS and certification bodies supporting novel 10 character tokens]]></description><link>https://blog.alco.dk/trust-me-im-real/</link><guid isPermaLink="false">65e1eac3a684ad000767e237</guid><category><![CDATA[AI]]></category><category><![CDATA[trust]]></category><category><![CDATA[DNS]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Sat, 02 Mar 2024 13:25:38 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1525545840020-a9a77a939f80?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDV8fGFsaXZlfGVufDB8fHx8MTcwOTM5NTUwNnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1525545840020-a9a77a939f80?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDV8fGFsaXZlfGVufDB8fHx8MTcwOTM5NTUwNnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Trust me - I&apos;m real!"><p>In <a href="https://blog.alco.dk/aint-an-issue/">a post the other day</a> I posited that by <em>&quot;..add[ing] a distillation of DNS with scents of SSL and Certification Authorities..&quot;</em> we can manage the trust issues currently wreaking havoc amongst &quot;cloud&quot; based services. With this post my intention is to clarify WTF I was rambling about &#x1F605;</p><p>But first &#x2013; a fair warning &apos;cause this post gets pretty detailed about the tech. In more layman&apos;s terms you could describe it something like this: In order to call Ms. Someone I&apos;ll go get a phonebook (or more recently, an online listing site like <a href="https://www.yellowpages.ca">YellowPages</a>) and start searching for Ms. Someone. I&apos;ll end up with a set of digits (because that was how the <a href="https://en.wikipedia.org/wiki/Telephone_number">signaling of the callee&apos;s handset/phone</a> is converted from man-readable to machine-understandable) and dialing the sequence will - hopefully - connect me with Ms. Someone. Unless I <a href="https://www.verizon.com/support/caller-id-block-faqs/">block the Caller ID</a> (hide my phone number) Ms. Someone will at least learn my phone number. If we are not acquainted all she will have to go by is looking up my number in the inverted listing (ie instead of a name, she will be looking for a name by the number displayed on her handset. Provided the listing service is to be trusted and I&apos;m listed she will learn my name and possibly a postal address. </p><p>Quite a number of Internet services rely on DNS which is short for Domain Naming System. It&apos;s a fairly simple protocol not too far from the above example. Got a name - get a number. Got a number - get a name. We can utilise this to allow machines looking up the identification of senders merely by providing a sequence of digits. Entertain me on this: in order to allow at least 1 specific number to all humans on Earth we&apos;ll need at least 11 digits (99,999,999,999 possible &apos;addresses&apos;) &#xA0;at the moment &#x2013; we might get away with 10 digits for a while but.. Now let&apos;s add some machines and like devices of various sorts and we are looking at perhaps 12 or 13 digits. Throw into that mix the commercialization of this &apos;tag&apos; &#x2013; and we end up with something like </p><!--kg-card-begin: markdown--><p><code>WD13CHM4NN</code></p>
<!--kg-card-end: markdown--><p>It&apos;s short enough for you to remember and not too complex to share. At least it&apos;s quite an improvement over <code>john.doe1234@someone.somewhere</code> even if you should end up at the short end of the stick so to say, with something like <code>W3KJ98DF1</code>. Businesses might fight over <code>C0C4C0L4</code> and <code>N1K3</code> &#xA0;&#x2013; &#xA0;I like to think that they absolutely should! Offering the token on a first come first served term will allow for trade and drive adaptation.</p><p>10 characters is no coincidence - with 25 letters and 10 digits there will be 36 (if we allow for &apos;space&apos;, ie not filling in every position) to the 10th power affording an incredible 3,656,158,440,062,976 &quot;addresses&quot; leaving well above a staggering 350,000 addresses for each of the first 10 billion people on Earth.</p><p><a href="https://www.cloudflare.com/learning/dns/what-is-dns/">DNS operates on a particular tree</a> like structure of <em>name servers</em> scattered all over the globe with a fairly small number of root servers each holding references to a very large number of domain regional name servers that in turn are responsible for referencing authoritative nameservers each being able to do the name to address conversition for a particular domain like say <a href="https://jp.dk">https://jp.dk</a>. This design affords any machine to having an answer to a simple question in as little as 1 request (if the resolver have the answer cached) or more often, 4 requests, usually in a time range of 50ms - 150ms. The question goes somewhat like this: where should I turn to talk to www.adidas.de? In exactly the same way DNS could be operated to answer another kind of question: Who can tell me where to ask questions regarding <code>B3ATL35</code> </p><p>I posit that the DNS protocol be amended allowing machines to receive two pieces of information: an IP address and a public key, and with that information they may request an authentication package using the HTTPS protocol like this </p><p><code>GET https://192.168.1.100/authp</code></p><p>The authentication package would come in two layers of encryption; the protocol based TLS/SSL encryption and inside that, the private/public key encryption which the machine putting forward the question in the first place would use the aforementioned public key to decrypt.</p><p>In a totally decentralized state every &apos;user&apos; would carry their own authentication package on their own device but catering for fault tolerance most likely will require persisting the packages in alternate places <em>in the cloud</em> too, albeit still under the command of the owner of the authentication package.</p><p>It might all look something like this (keeping in mind that all &apos;swim lanes&apos; might be physically <em>running</em> on one device &#x2013; if the receiver merely is another process; this obviously is what might be considered an edge case though):</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.alco.dk/content/images/2024/03/pigeon_1.png" class="kg-image" alt="Trust me - I&apos;m real!" loading="lazy" width="2000" height="1029" srcset="https://blog.alco.dk/content/images/size/w600/2024/03/pigeon_1.png 600w, https://blog.alco.dk/content/images/size/w1000/2024/03/pigeon_1.png 1000w, https://blog.alco.dk/content/images/size/w1600/2024/03/pigeon_1.png 1600w, https://blog.alco.dk/content/images/size/w2400/2024/03/pigeon_1.png 2400w" sizes="(min-width: 720px) 720px"><figcaption>using pigeons to send content to some receiver&#xA0;</figcaption></figure><p>As a person with a desire to send messages to others I would go to a certification authority (in person) and submit my biometrics (photo, spit, iris scan, gait, more) to a machine operated by this authority. My device would share a public key for the authority to use in the proces of compiling my authenticatin package.</p><p> The chain of command of these certification authorities (CA) is very important as receivers would have to rely on the CA&apos;s not being compromised &#x2013; ie corrupted to collecting false biometrics. It will most probably require a separate protocol to be operated in the open source community and disseminated amongst users (senders and receivers) collecting and verifying biometrics from their peers regularly, thus reporting <em>what they see</em>. Any discrepancies would demote CA&apos;s and ultimately close them down if no one trust them to collect and compile biometrics in an orderly manner. One could theorize on the application of &quot;phonebooth&quot; certification authorities operated entirely by machines and completely detached from any networks given the <a href="https://en.wikipedia.org/wiki/Pure_function">pure functional nature</a> of their operation: provided the same input they will elicit the same output every single time.</p><p>Now with my encrypted biometric authentication package compiled for me and handed to me as the service provided to me by the CA, I will persist it on my device/machine and for safe keeping even place it in multiple alternate places in the cloud. I would not know, my self, what the package concists of - neither would the CA as they do not for privacy policy concerns persist any actual datasets pertaining to the transaction with me - except for a hash of the package handed to me along with a copy of the public key, for them to prove when questioned whether they did in fact compile my authentication package at all - no CCTV, facial recognition or any other recordings of me being there.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://images.unsplash.com/photo-1610692507254-3bc16d2527ea?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE0fHxjbG91ZHxlbnwwfHx8fDE3MDkzOTU1OTh8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" class="kg-image" alt="Trust me - I&apos;m real!" loading="lazy" width="3840" height="2161" srcset="https://images.unsplash.com/photo-1610692507254-3bc16d2527ea?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE0fHxjbG91ZHxlbnwwfHx8fDE3MDkzOTU1OTh8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=600 600w, https://images.unsplash.com/photo-1610692507254-3bc16d2527ea?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE0fHxjbG91ZHxlbnwwfHx8fDE3MDkzOTU1OTh8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1000 1000w, https://images.unsplash.com/photo-1610692507254-3bc16d2527ea?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE0fHxjbG91ZHxlbnwwfHx8fDE3MDkzOTU1OTh8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1600 1600w, https://images.unsplash.com/photo-1610692507254-3bc16d2527ea?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDE0fHxjbG91ZHxlbnwwfHx8fDE3MDkzOTU1OTh8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2400 2400w" sizes="(min-width: 720px) 720px"><figcaption>Photo by <a href="https://unsplash.com/@joser0337?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Jos&#xE9; Ramos</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Depending on my temper and paranoia I will either add my device as the destination for questions regarding authentication or pick one of the alternate places in the cloud as the source of the truth. In any case I am now ready to start exchanging messages with receivers using this decentralized and yet highly centralized authentication system.</p><p>Regarding the DNS we are facing a few obsticles with the most important one being that the naming system is divided into something called TLD&apos;s (short for top level domains - like .com, .de, .es, and so on) and subsequent second level domains like exxon, maersk, and so on, effectively combining it to names like exxon.com, maersk.dk, etc. </p><p>Fitting the tokens/pigeons into this system can be done in a number of ways, one being attaching a bespoke TLD on to the tokens like <code>WD13CHM4NN.tt</code>, another being to add TXT records to a bespoke domain, fx pigeons.tt.</p><p>Catering for performance issues this particular &apos;domain&apos; will receive a tremendous amount of trafic and as such probably be elevated to a particular root service - much like the f-root, but that&apos;s another story.</p>]]></content:encoded></item><item><title><![CDATA[AIn’t an issue!]]></title><description><![CDATA[a way for the receiver to consider the message true and in fact offered by the sender and for the sender to actually having "put their best effort" into construing the message!]]></description><link>https://blog.alco.dk/aint-an-issue/</link><guid isPermaLink="false">65e0c179a684ad000767dd62</guid><category><![CDATA[AI]]></category><category><![CDATA[trust]]></category><category><![CDATA[DNS]]></category><category><![CDATA[pigeons]]></category><category><![CDATA[blockchain]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Thu, 29 Feb 2024 22:55:13 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1666597107756-ef489e9f1f09?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM4fHxBaXxlbnwwfHx8fDE3MDkyNDU2MTV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1666597107756-ef489e9f1f09?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM4fHxBaXxlbnwwfHx8fDE3MDkyNDU2MTV8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="AIn&#x2019;t an issue!"><p>Content, generated by bots utilizing services provided by a seemingly endless list of LLM&apos;s (large language models) known by most as AI systems, most famous amongst them probably <a href="Https://openai.com">OpenAI / ChatGPT</a>, ain&apos;t an issue &#x2013; </p><p>What is, is whether the reader/listener/viewer is affected by the content or led to believe in an alternate reality! I&apos;m careful here because reality is <em>in the eye of the beholder</em>! You could argue that not all realities are equal and be right but whether they are real is a much more questionable statement.</p><p>What separates content generated by living beings from content <em>cooked up</em> <em>in slices of silicium</em> is quickly becoming next to impossible to point to and that predicament may give rise to issues going forward &#x2013; issues of a magnatude and consequence that mankind has not faced perhaps ever. This is &quot;inventing fire&quot; grade stuff!</p><p>Consider LLMs trained to voice your parents beliefs and teachings, and to be able to question them, discuss them, reason with them, and perhaps even make them reevaluate - decades after their passing! Or &quot;machines&quot; teaching you as an undergraduate!? How about &quot;news servers&quot; compiling ample &quot;news&quot; to keep you watching news reels for the better part of your life!? Systems providing you with &apos;guides&apos; on what politician to vote for based on what you &quot;like&quot; and &quot;believe&quot; in.</p><p>Most of what I just listed are in fact not even science fiction - or at least it&apos;s quite doable if not in existence yet!</p><p>So the question begs: How do mankind somehow make a distinction between content generated by their peers and content generated by what ultimately are machines?</p><p>First we&apos;ll have to consider whether it is at all necessary for humans to be able to make such distinctions. Provided these &apos;machines&apos; are driven by altruistic motivations you might argue that their outpourings will only help us survive on a planet increasingly <em>worn out</em>. But altruistic to whom? All of humanity or perhaps more narrowly - a small elite? Altruistic in the &quot;for the greater good&quot; kind of way? Machines with very discrete ends - like generating profits - most likely will not waive at the thought of decimating populations as some kind of collateral damage as long as they (the machines) are not actively killing people but merely consulting them on what to and what not to do - perhaps.</p><p>One of mankinds finest qualities, albeit one becoming rarer as of late, is the ability to weight for and against some decision, using their gathered experience, trained and acquired knowledge, ethical and moral codices, and &apos;gut feelings&apos; &#x2013; like when my grand dad would posit: N&#xE5;&apos; skit k&#xE5;me te &#xE6;r&apos; s&#xE5; wed&apos;e et hw&#xE5;dden det wel w&#xE6;&apos; (a danish dialect, I know, but basically &apos;rags to riches&apos; meet &apos;old versus new money&apos;) meaning that you extrapolate trajectories of events and actions based upon paper thin samples from the past but because you carefully pick samples within context your gut-feeling will serve you right more often than not. </p><p>If every data bit is with out context and presented as fact! How are we to use our experience on that? Worse - if data bits are pedaled by centuries old honourable bodies firmly situated in the epicenter of humanity, like global newspaper brands and national television networks - then what? Do we question them - especially if what they offer seems to align with our beliefs and common sense?</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://images.unsplash.com/photo-1599739291127-15c456e459ee?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM3fHxTdGFnZXxlbnwwfHx8fDE3MDkyNDU3OTF8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" class="kg-image" alt="AIn&#x2019;t an issue!" loading="lazy" width="5760" height="3840" srcset="https://images.unsplash.com/photo-1599739291127-15c456e459ee?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM3fHxTdGFnZXxlbnwwfHx8fDE3MDkyNDU3OTF8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=600 600w, https://images.unsplash.com/photo-1599739291127-15c456e459ee?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM3fHxTdGFnZXxlbnwwfHx8fDE3MDkyNDU3OTF8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1000 1000w, https://images.unsplash.com/photo-1599739291127-15c456e459ee?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM3fHxTdGFnZXxlbnwwfHx8fDE3MDkyNDU3OTF8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1600 1600w, https://images.unsplash.com/photo-1599739291127-15c456e459ee?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM3fHxTdGFnZXxlbnwwfHx8fDE3MDkyNDU3OTF8MA&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2400 2400w" sizes="(min-width: 720px) 720px"><figcaption>Photo by <a href="https://unsplash.com/@davidvondiemar?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">David von Diemar</a> / <a href="https://unsplash.com/?utm_source=ghost&amp;utm_medium=referral&amp;utm_campaign=api-credit">Unsplash</a></figcaption></figure><p>Still with me? Okay, so next up is a brief setting of the stage: We have the <em>Sender</em> and the <em>Message</em> and finally the <em>Receiver</em>. What we are looking for is a way for the receiver to consider the message true and in fact offered by the sender and for the sender to actually having &quot;put their best effort&quot; into construing the message! That&apos;s the task like cut to the chase.</p><p>First, let&apos;s consider the Sender. Building trust usually meant delivering on your promises again and again. Skilled shoe-makers would come in demand when they time after time delivered wooden cloggs in pristine quality every time. By word of mouth people would agree: If you need the best quality in wooden cloggs - go to SomeNamedGuy. So we need some way of identifying the sender - like Yelp or TrustPilot.</p><p>Second, consider the Message. Lets go back to the wooden cloggs. Say one customer brings back their pair of cloggs only the next day after ordering them, and pass another customer doing exactly the same only to find that every single man and woman in town got a pair of cloggs in the span of 12 hours! You&apos;d be right to wonder: is there something fishy about this? Can this shoe-maker really build that many pair of cloggs in one night? Compiling a trustworthy message will take time just as much as <a href="https://www.google.dk/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=&amp;ved=2ahUKEwip59-Hv9GEAxWQAxAIHWP_DDcQFnoECCsQAQ&amp;url=https%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt0499549%2F&amp;usg=AOvVaw0V2qmxIPtmENClcbzlAT8u&amp;opi=89978449">Avatar</a> was not shot during lunch-break. But - I hear your question! Can big companies not produce more than perhaps a few pages of &apos;news&apos; in a day? Certainly - but they consist of hundreds, perhaps thousands of employees each producing perhaps 1-2 pages every week. And people trust people/individuals - they do not trust companies. Why should they? You deal with Mr Anderson - not the entire Sales Department. So we need some way of verifying the build process of the message. A cross between versioning software systems like <a href="Https://github.com">Git</a> and the blockchain making every change immutable and set in stone for all eternity.</p><p>Finally, the Receiver. Our hitherto example lends not too well in this case. You see, the receiver may not even be human! Had they been we could ask of them to call the Sender and ask whether this or that piece of information was in fact of their doing or something compiled in a split second by some machine. The Sender could lie, of cause - and run the risk of being exposed and possibly never sell another piece of information. Now here we are in the mid 2020&apos;s and surrounded by machines - now what do we do?</p><p>We start by <strong>tying the build proces to a blockchain</strong> of sorts. It does not have to be <em>the</em> Blockchain running the entire crypto markets, any odd blockchain will do - as long as it is trustable. Being decentralized - practically in the eye of the beholder - should do! Providing content providers with a toolset that not only ties their product build process to a verifiable blockchain but allows them to commit work every minute/second/milli-second will be of paramount importance. Tying the build process to a blockchain that at the same time could offer a means to manage the consumption of this content holds some obvious promises by itself - but that is not really of interest in the scope of this post!</p><p>Now we are able to offer a ways for the receiver to verify the build process (and possibly the sources being used to compile the content). Now we need for the receiver to be able to verify the authenticity of the sender/creator. Is it indeed that well thought-off journalist freelancing for <em>Le Monde</em> or does it prove in the end that the content was compiled in more like micro seconds by utter transistors?</p><p>We add a <strong>distillation of DNS with scents of SSL and Certification Authorities</strong> effectively providing a body (with possible globally assigned assessor bodies constantly securing identities of creators) to persist and disseminate authenticities of senders, perusable by machines operated by receivers (which again could be other machines or <em>real</em> humans). Senders would have to travel to public offices or branch offices of this body to have their authenticity stored after offering samples of biometrics - fingerprints, sweat, iris scans, more. (See footnote for another angle on this body)</p><p>When the creator operates their workbench/editor/toolset - talking, typing, acting, whatever - they (could) allow the toolset to collect biometric data every so often, and hash these data into the same blockchain! In this way the product becomes an extension of the sender. Biometrics may of cause be falsified - and most certainly will be - but such cases will (like the lying Sender before) risk expose and condemnation. Allowing receivers close to senders collecting individual biometric samples will strengthen the entire workflow and system. With only a small sample of &quot;true&quot; biometrics collected by 1-2 fans close to their most-beloved actor, they could chip in to the entire system and build on the trust necessary for senders&apos; authenticity to be verified.</p><p>I&apos;ll close this post by daring an example of this &quot;tech&quot;:</p><p>&#x2003;Melissa &amp; Mustafa skipped their last class that day - word in the streams was that Hallifax had released a new <strong>ario</strong> that was crazy and they loved everything Hallifax &#xA0;made; so much that a 1 hour lecture on DNA markers was a no-contest!</p><p>&#x2003;<em>Ready, Mel?</em> Mustafa looked at her through the AR lense strapped to his head. She nooded. He pressed PLAY and they both lost their footing even though they were safely tucked in pillows and blankets on the floor - they knew what was in store for them! <em>Wait! </em> Melissa yelled and Mustafa pushed PAUSE.</p><p>&#x2003;<em>That&apos;s unreal! He couldn&apos;t possibly! </em> Melissa nearly shouted still somewhat deafened from the first few second of the ario. She made a gesture and commanded: <em>Show tracking from zero through 10</em> and the ario started again now stepping forward almost frame by frame meanwhile running verifications in a second window to the right of them and below the scene a line of check marks indicated that every frame was in fact not only genuine but had not received any after production editing except one frame. Melissa was not entirely convinced and continued: <em>Show actors bio</em>, she demanded. The scene froze and all 5 actors in the scene had small annotations labeled to their heads. One was a bot - the wolf - but the rest checked out. Cast credits below and another window above and to the left started listing time spent on set and commits ordered by the cameramen.</p><p>&#x2003;<em>I&apos;ll be da&#x2013; </em> Melissa studdered in disbelief. It was that good!</p><p>FOOTNOTE:</p><p>I mentioned a &apos;body&apos; above &#x2013; one to manage authenticities. This body could give way to a new dawn on the much hated &quot;email&quot; of yesterday. We could finally ditch the &apos;postbox&apos; analogy. The analogy that has done so much harm for decades now!</p><p>&#x2003;In stead of a completely anonymous slot, through which you as the sender is able to push whatever culpritous digital compilations for the poor receiver to have machines lingering anxiously over, spending millions if not billions of CPU cycles and endless watts of precious electricity trying to undo and rectify, you will now have a bullitin board for senders to pin their desire to forward messages (of any construct) to you, and in a few CPU cycles your assigned machine is able to verify the true identity of any sender and if deemed necessary by you go over the commits to the message easily discarding any suspicious looking fragments.</p>]]></content:encoded></item><item><title><![CDATA[Phlex'ing in View]]></title><description><![CDATA[<p><a href="https://phlex.fun">Phlex</a> <em>by</em> <a href="https://github.com/joeldrapper">Joel Drapper</a> is some very clever Ruby code to componentizing your views, for all in Rails via the <a href="https://github.com/phlex-ruby/phlex-rails">phlex-rails</a> gem!</p><p>For what seems only like yesterday but probably is way more than a year I&apos;ve kept adding components (what Rails labels <em>partials</em> I believe) to &apos;</p>]]></description><link>https://blog.alco.dk/phlexing-in-view/</link><guid isPermaLink="false">64fac0abfd589c000761fc04</guid><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Fri, 08 Sep 2023 07:45:09 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1519502527066-26f4a82c57bb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM0fHxmbGV4fGVufDB8fHx8MTY5NDE1NDk5Mnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1519502527066-26f4a82c57bb?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDM0fHxmbGV4fGVufDB8fHx8MTY5NDE1NDk5Mnww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Phlex&apos;ing in View"><p><a href="https://phlex.fun">Phlex</a> <em>by</em> <a href="https://github.com/joeldrapper">Joel Drapper</a> is some very clever Ruby code to componentizing your views, for all in Rails via the <a href="https://github.com/phlex-ruby/phlex-rails">phlex-rails</a> gem!</p><p>For what seems only like yesterday but probably is way more than a year I&apos;ve kept adding components (what Rails labels <em>partials</em> I believe) to &apos;my tool-belt&apos; building from this <em>gem</em>.</p><p>My goal was to be able to do</p><!--kg-card-begin: markdown--><pre><code>&lt;%= render_form( resource: resource, 
    assoc: :participantable, 
    clipboard_prefix: (resource.new_record? ? 
      nil : 
      equipment_url(resource.assetable))) do |form| %&gt; 

    &lt;!-- 8&lt; -- &gt;
    &lt;%= form.text_field( :name, 
      required: true, 
      focus: true, 
      placeholder: t(:name),
      input_css: &quot;block w-full ...-300 rounded-md&quot;) %&gt;

  &lt;%= render_form_action_buttons 
    resource: resource, 
    delete_url: resource_url(), 
    deleteable: !resource.new_record? %&gt;
    
&lt;% end %&gt;

</code></pre>
<!--kg-card-end: markdown--><p>To that end I started by handing the task to a helper</p><!--kg-card-begin: markdown--><pre><code>
  def render_form(**attribs, &amp;block)
    attribs[:action] ||= params[:action]
    render Views::Components::Form::Form.new **attribs, &amp;block
  end

</code></pre>
<!--kg-card-end: markdown--><p>That prompted the erection of a module</p><!--kg-card-begin: markdown--><pre><code>module Views
  #
  # the form component is a wrapper for the form_with form helper
  # and it handles nested forms by adding an argument - assoc - to the initializer
  # another argument supports the clipboard prefix - copy/pasting of form field values
  #
  # Caveats: the form will not support deep nested forms - ie only one level of nesting!
  #
  class Components::Form::Form &lt; Phlex::HTML
    include Phlex::Rails::Helpers::FormWith
    # include Phlex::Rails::Helpers::FieldsFor

    def initialize( **attribs, &amp;block )
      @resource = attribs[:resource]
      @assoc = attribs[:assoc]
      @action = attribs[:action]
      @url = attribs[:url] || nil
      @clipboard_prefix = attribs[:clipboard_prefix]
      @classes = attribs[:css] || &quot;scrollbar-hide h-full flex flex-col bg-white shadow-xl overflow-y-scroll &quot;
      @screen_height = attribs[:screen_height] || &quot;h-screen max-h-screen&quot;
      @screen_width = attribs[:screen_width] || &quot;w-screen max-w-md&quot;
      @fields_css = attribs[:fields_css] || &quot;border-b border-gray-900/10 pb-12 mb-14&quot;
      @form_id = &quot;form_#{Current.user.id rescue 0}&quot;
    end

    def template(&amp;)
      div( id: &quot;#{@form_id}&quot;, class: &quot;pointer-events-auto #{@screen_height} #{@screen_width}&quot;) do
        form_with( model: @resource, 
          url: set_url( helpers.resource_url()), 
          data: { form_sleeve_target: &apos;form&apos; }, 
          html: { id: &quot;#{@form_id}_innerform&quot;, enctype: &quot;multipart/form-data&quot;, class: @classes }) do |form|
            hidden_field( :account_id, value: (Current.account.id rescue nil) ) unless %(account service).include? @resource.class.to_s.underscore
            unless @assoc.nil?
              hidden_field( &quot;#{@assoc}_type&quot;, value: @resource.send(@assoc).class.to_s) 
              hidden_field( :id, assoc: @assoc, value: set_id ) 
            end
            div( 
              class:&quot;flex-1 relative space-y-12&quot;,
              data_controller: &quot;form&quot;,
              data_form_form_sleeve_outlet: &quot;#form-sleeve&quot;,
              data_form_list_outlet: &quot;#list&quot;,
              data_form_clipboard_prefix_value: @clipboard_prefix,
              data_action: &quot;keydown-&gt;form#keydownHandler speicherMessage@window-&gt;form#handleMessages&quot;
              ) do
                div( class: @fields_css) do
                  yield
                end
            end
          end
      end
    end

    def set_url helper_url
      u = if @url.nil?
        helper_url
      else
        @url
      end
      re = /(\/[0-9]*\/clonez)$/
      if u =~ re 
        u = u.gsub(re, &quot;&quot;)
      end
      u
    end

    def set_id 
      return &apos;&apos; unless @action == &apos;edit&apos;
      return @assoc.nil? ? @resource.id : @resource.send(@assoc).id
    end

    def boolean_slider_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::BooleanSliderField.new field, **attribs, &amp;block
    end

    def checkbox_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::CheckboxField.new field, **attribs, &amp;block
    end

    def combo_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      attribs[:elem_css] = attribs[:elem_css] || &quot;space-y-1 z-10 px-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:py-5&quot;
      render Views::Components::Form::ComboField.new field, **attribs, &amp;block
    end

    def datetime_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::DateTimeField.new field, **attribs, &amp;block
    end

    def email_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::EmailField.new field, **attribs, &amp;block
    end
    
    def file_upload_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::FileUploadField.new field, **attribs, &amp;block
    end

    def hidden_field( field, **attribs)
      attribs[:resource] ||= @resource
      render Views::Components::Form::HiddenField.new field, **attribs
    end

    def number_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::NumberField.new field, **attribs, &amp;block
    end

    def password_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::PasswordField.new field, **attribs, &amp;block
    end

    def radio_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::RadioField.new field, **attribs, &amp;block
    end

    def text_area(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      attribs[:elem_css] = attribs[:elem_css] || &quot;space-y-1 px-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:py-5&quot;
      render Views::Components::Form::TextArea.new field, **attribs, &amp;block
    end

    def text_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      attribs[:elem_css] = attribs[:elem_css] || &quot;space-y-1 px-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:py-5&quot;
      render Views::Components::Form::TextField.new field, **attribs, &amp;block
    end

    def token_field(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      render Views::Components::Form::TokenField.new field, **attribs, &amp;block
    end

    def uris(field, **attribs, &amp;block)
      attribs[:resource] ||= @resource
      attribs[:assoc] ||= @assoc
      render Views::Components::Form::Uris.new field, **attribs, &amp;block
    end

  end
end

</code></pre>
<!--kg-card-end: markdown--><p>All of this really could&apos;ve been unnecessary, had it not been for my unability to lure Phlex into accepting my nested forms in the `form_with`. As it turned out, though, I gained more than I probably lost in that battle.</p><p>In the form I render fields of all sorts. To that end I&apos;ve constructed a rather monstrous generic_field.rb which most of my form elements inherits from. It looks somewhat like this [Disclaimer: there is most certainly no &apos;fiber rich meal&apos; hidden here - only spaghetti I&apos;m afraid]</p><!--kg-card-begin: markdown--><pre><code>
module Views
  class Components::Form::GenericField &lt; Phlex::HTML
    include Phlex::Rails::Helpers::Label

    # TODO: serious sanitization required!
    def initialize(field, **attribs, &amp;block)
      @resource = attribs[:resource] || nil
      @assoc = attribs[:assoc] || nil
      @assoc_cls = @assoc.nil? ? 
        nil :
        @resource.send(@assoc).class.to_s.underscore
      @lookupClass = attribs[:lookup_class] || 
        (field.to_s.classify.constantize rescue false) || 
        @resource.class.to_s.underscore || 
        nil
        
      ---8&lt;--- AHOALO &apos;stage setting&apos; aka variables 
 
      type_s = @combo_type.to_s
      @is_single  = !(type_s =~ /single/).nil?
      @is_multi   = !@is_single
      @is_drop   = !(type_s =~ /drop/).nil?
      @is_list   = !(type_s =~ /list/).nil?
      @is_tags   = !(type_s =~ /tag/).nil?
      @is_search = !(type_s =~ /search/).nil?
      @is_add    = !(type_s =~ /add/).nil?
      @is_modal  = attribs[:modal] || false
      @showIcon  = attribs[:show_icon] || false
      @is_key_value = attribs[:key_value] || false

      @field_placeholder = attribs[:placeholder] || &apos;&apos;
      @elem_css = attribs[:elem_css] || 
        &quot;space-y-1 px-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:py-5&quot;
      @label_css = attribs[:label_css] || 
        &quot;block text-sm font-medium text-gray-900 sm:mt-px sm:pt-2&quot;
      @input_css = attribs[:input_css] || 
        &quot;block w-full shadow-sm sm:text-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 rounded-md&quot;

    end

    def template(&amp;)
      yield
    end

    def set_field_value **attribs
      values = (attribs[:value] || @obj.send(@field_name)) rescue nil
      return nil if values.nil? || 
        values == &apos;&apos; || 
        values == []
      @value_filter.nil? ? 
        values : 
        @value_filter.call( values, @items )
    end
    
    def set_display_value **attribs
      values = @values
      return &apos;&apos; if values.nil? || 
        values == &apos;&apos; || 
        values == []
      return @display_filter.call( values, @items) if !@display_filter.nil?     
      return values if (values.class.ancestors.include?( String) || 
        values.class.ancestors.include?( Numeric) || 
        values.class.ancestors.include?( TrueClass) ||
        values.class.ancestors.include?( FalseClass) )
      return values if values.class.ancestors.include?( ActiveSupport::TimeWithZone)
      [values].flatten.map{ |v| v[@item_label.to_sym] }.join(&quot;, &quot;)
    end

    def label_for **attribs, &amp;block 
      return unless @label_visible
      containercls = attribs[:container_class] || &quot;&quot;
      lblcls = attribs[:label_class] || @label_css
      fld = attribs[:field] || @field
      title = attribs[:title] || @title
      div( class: containercls ) do
        if block_given?
          label( @obj, fld, title, name: @field_input_name, class: lblcls, data: { action: &quot;click-&gt;form#fieldFaq&quot; }) do
            div( class: &quot;text-sm text-gray-500&quot; ) { @description } if @description.present?
            yield
          end
        else
          if( title =~ /translation missing/i)
            (title =~/&lt;span/i) ? text( title ) : span( class: &quot;translation_missing&quot;, title: title ) {fld.to_s}
            div( class: &quot;text-sm text-gray-500&quot; ) { @description } if @description.present?
          else
            label( @obj, fld, title, name: @field_input_name, class: lblcls, data: { action: &quot;click-&gt;form#fieldFaq&quot; })
            div( class: &quot;text-sm text-gray-500&quot; ) { @description } if @description.present?
          end
        end
      end
    end

    def values_for **attribs 
      values = nil
      return parent_values if @parent 
      return params_values( attribs[:values] ) if !attribs[:values].nil?
      return model_values if !@obj.nil? and @obj.respond_to? @field_name

      (@obj&amp;.send(&quot;values_for_#{@field}&quot;) if @obj&amp;.respond_to? &quot;values_for_#{@field}&quot;) || []
    end    

    def parent_values
      begin
        return [{ id: @parent.id, cls: @parent.class.to_s, label: @parent.send(@lookup_label)}] if @parent
      rescue
        raise &quot;Parent not found - or lookup_label wrong&quot;
      end
    end

    def params_values values
      begin      
        case true
        when @field==:role &amp;&amp; @resource.class==Role;                    set_role_values(values)
        when values.class.ancestors.include?( Integer);                 [{ id: values, cls: &quot;&quot;, @item_label =&gt; &quot;key&quot; }]
        ---8&lt;--- more cases
        else
          values
        end
      rescue
        raise &quot;Parent not found - or lookup_label wrong&quot;
      end
    end

    def set_role_values values
      values = &quot;&quot; if values.nil? || values.empty?
      values.chars.collect{ |v| set_item(v) }
    end

    def model_values
      begin
        return params_values @obj.send(@field) if @field != @field_name
        params_values @obj.send(@field_name)
      rescue
        raise &quot;(generic_field) Model lookup failed - or lookup_label wrong&quot;
        return nil
      end
    end

    def items_for **attribs
      items = attribs[:items] || []
      items.collect{|i| set_item(i)}
    end

    def set_item item 
      case true
      when item.class.ancestors.include?( String);                  i= (item.split(&quot;;&quot;).size &lt; 2) ? ({ id: item, cls: item, @item_label =&gt; item }) : ({ id: item.split(&quot;;&quot;)[0], cls: item.split(&quot;;&quot;)[2], @item_label =&gt; item.split(&quot;;&quot;)[1] })
      ---8&lt;--- more cases
      else
        i={ id: item[:id], cls: item[:cls], @item_label =&gt; item[@item_label] }
      end
      OpenStruct.new(i)
    end
        
  end
end
</code></pre>
<!--kg-card-end: markdown--><p>That leaves me with a fairly easy task when fx adding a component to display a password field:</p><!--kg-card-begin: markdown--><pre><code>module Views
  #
  # the password_field component is a wrapper for the password_field form input field helper
  #
  class Components::Form::PasswordField &lt; Views::Components::Form::GenericField
    include Phlex::Rails::Helpers::PasswordField

    # arguments: field, assoc: nil, title: nil, data: {}, required: false, focus: false, disabled: false, 
    # text_css: &quot;&quot;, label_css: &quot;&quot;, input_css: &quot;&quot;
    def initialize( field, **attribs, &amp;block )
      @url = attribs[:url] || &quot;&quot;
      super( field, **attribs, &amp;block )

      @elem_css = &quot;space-y-1 px-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 sm:py-5 #{attribs[:elem_css]}&quot;
      @label_css = &quot;block text-sm font-medium text-gray-900 sm:mt-px sm:pt-2 #{attribs[:label_css]}&quot;
      @input_css = &quot;block w-full shadow-sm sm:text-sm focus:ring-indigo-500 focus:border-indigo-500 border-gray-300 rounded-md #{attribs[:input_css]}}&quot;
    end

    def template(&amp;)
      div class: @elem_css do
        label_for
        div( class: &quot;sm:col-span-2&quot;) do
          password_field( @obj, @field, 
            id: @field_input_id,
            name: @field_input_name,
            value: @field_value,
            disabled: @disabled,
            placeholder: @field_placeholder,
            autocomplete: @autocomplete,
            tabindex: @tabindex,
            required: @required, 
            data: @data,
            class: @input_css) do |f|
              yield
            end
          div( class:&quot;text-sm text-red-800&quot; ) { @obj.errors.where(@field).map( &amp;:full_message).join( &quot;og &quot;) }
        end
      end
    end
  end
end

</code></pre>
<!--kg-card-end: markdown--><p>&#x2013; and it brings back memories of `simple_form` when I get to do </p><pre><code>&lt;%= form.password_field :password, 
  autocomplete: &quot;current-password&quot;, 
  required: true, 
  placeholder: t(&apos;password&apos;),
  class: &quot;appearance-none block w-full px-3 ...&quot; %&gt;</code></pre><p>in my forms (knowning that it is all testable w/o any headless chrome, being &apos;just&apos; PORO&apos;s, and promising to greedily suck out every last cycle the &quot;cloud&quot; may provide.</p><p>Life is sweat! Thank you Joel!</p>]]></content:encoded></item><item><title><![CDATA[Ghost'in with Dokku]]></title><description><![CDATA[It's real easy to 'mv' your blog somewhere else - with a little help ;)]]></description><link>https://blog.alco.dk/ghostin-with-dokku/</link><guid isPermaLink="false">630f2f4e27def00007547857</guid><category><![CDATA[ghost]]></category><category><![CDATA[web]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Wed, 31 Aug 2022 10:03:23 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1573166717911-d3625658b6f7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDIwNnx8Z2hvc3QlMjB3ZWJ8ZW58MHx8fHwxNjYxOTQwMTAy&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1573166717911-d3625658b6f7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDIwNnx8Z2hvc3QlMjB3ZWJ8ZW58MHx8fHwxNjYxOTQwMTAy&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Ghost&apos;in with Dokku"><p>So - you&apos;ve got this blog/website thing going, and you set it up using <a href="https://ghost.org/">Ghost</a>! And now you need to find yourself a new provider &#x2013; and you cannot stop thinking whether you could do it all by yourself!?</p><p>Export all your content</p><p>Make a tarball of all your images - from content/images - in my case the path was /var/www/blog/content/images</p><p>Now follow this <a href="https://okhlopkov.com/deploy-ghost-blog-with-dokku/">recipe</a></p><p>Import your content</p><p>&apos;cd&apos; into the proper &apos;content&apos; folder and <code>tar xf images.tar</code></p><p>That&apos;s how easy it is to move a Ghost based blog/website/thing</p>]]></content:encoded></item><item><title><![CDATA[Hotwiring Modals]]></title><description><![CDATA[<p>In my previous post I ended on kind of an &quot;up key&quot; with <em>job done</em> &#x2013; which with hindsight probably was a bit exaggerated. I never got to mention Caleb Porzio who created <a href="https://github.com/alpinejs/alpine">AlpineJS</a>.</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png" class="kg-image" alt loading="lazy" width="1299" height="323" srcset="https://blog.alco.dk/content/images/size/w600/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png 600w, https://blog.alco.dk/content/images/size/w1000/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png 1000w, https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png 1299w" sizes="(min-width: 1200px) 1200px"></figure><p><code>app/views/accounts/_modal.html.haml</code> is not ripe for generalization yet but this</p>]]></description><link>https://blog.alco.dk/hotwiring-modals/</link><guid isPermaLink="false">630f17fd27def0000754771e</guid><category><![CDATA[code]]></category><category><![CDATA[hotwire]]></category><category><![CDATA[turbo_stream]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Sun, 21 Mar 2021 10:12:10 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1490806208073-54a50f09a0d7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDIxfHx3cmVja3xlbnwwfHx8fDE2MTYzMjE1NzY&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1490806208073-54a50f09a0d7?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDIxfHx3cmVja3xlbnwwfHx8fDE2MTYzMjE1NzY&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Hotwiring Modals"><p>In my previous post I ended on kind of an &quot;up key&quot; with <em>job done</em> &#x2013; which with hindsight probably was a bit exaggerated. I never got to mention Caleb Porzio who created <a href="https://github.com/alpinejs/alpine">AlpineJS</a>.</p><figure class="kg-card kg-image-card kg-width-wide"><img src="https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png" class="kg-image" alt="Hotwiring Modals" loading="lazy" width="1299" height="323" srcset="https://blog.alco.dk/content/images/size/w600/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png 600w, https://blog.alco.dk/content/images/size/w1000/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png 1000w, https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-21-kl.-09.03.42.png 1299w" sizes="(min-width: 1200px) 1200px"></figure><p><code>app/views/accounts/_modal.html.haml</code> is not ripe for generalization yet but this is what it looks like:</p><pre><code class="language-ruby">
:coffeescript

  window.modalData = () -&gt;
    {
      modalOpen: false,
      dispatcher: null,
      toggleModal: () -&gt;
        @modalOpen = ! @modalOpen 
      initModal: (w,d) -&gt;
        @dispatcher = d
        document.body.classList.add &apos;overflow-hidden&apos;
        w &apos;modalOpen&apos;, (value) =&gt;
          if (value == true)
            document.body.classList.add &apos;overflow-hidden&apos;
          else
            document.body.classList.remove &apos;overflow-hidden&apos;
      sendModal: () -&gt;
        @modalOpen = ! @modalOpen
      openModal: (e) -&gt;
        @dispatcher &apos;opened-event-modal&apos;,&apos;&apos;
        @toggleModal()
        if e.detail!=&apos;&apos;
          el = document.getElementById(&apos;account_modal_form&apos;)
          el.innerHTML = e.detail
          el.style.zIndex = &apos;99&apos;
      closeModal: () -&gt;
        @dispatcher &apos;closed-event-modal&apos;,&apos;&apos;
        @modalOpen = ! @modalOpen
    }

.fixed.inset-0.z-10.grid.place-content-center.justify-items-center{ :&quot;x-data&quot;=&gt;&quot;modalData()&quot;, :&quot;x-init&quot;=&gt;&quot;initModal($watch,$dispatch)&quot;, :&quot;x-show&quot;=&gt;&quot;modalOpen&quot;, :&quot;@open-event-modal.window&quot;=&gt;&quot;openModal&quot;, :&quot;@close-event-modal.window&quot;=&gt;&quot;closeModal()&quot; }
  .absolute.inset-0.bg-black.opacity-10
  / %span.hidden.sm:inline-block.sm:align-middle.sm:h-screen( aria-hidden=&quot;true&quot;) &amp;#8203;
  #account_modal_form
    = render partial: &quot;form&quot;, locals: { account: @account, header: t(&apos;.konto&apos;) }
</code></pre><p>The first (real) line of HTML beginning with <code>.fixed.inset-0</code> holds these constructs:</p><p><code>:&quot;x-data&quot;=&gt;&quot;modalData()&quot;</code> &#x2013; which scopes the reach of variables and methods to this DOM element and children</p><p><code>:&quot;x-init&quot;=&gt;&quot;initModal($watch,$dispatch)&quot;</code> &#x2013; initializes scoped variables and if you need access to stuff like a dispatcher from your JS this is the proper place to announce it &#xA0; </p><p><code>:&quot;x-show&quot;=&gt;&quot;modalOpen&quot;</code> &#x2013; will show/hide this DOM element depending upon the truthiness of modalOpen</p><p> <code>:&quot;@open-event-modal.window&quot;=&gt;&quot;openModal&quot;</code> &#x2013; this is how eventListeners look like using AlpineJS. </p><p><code>:&quot;@close-event-modal.window&quot;=&gt;&quot;closeModal()&quot;</code> &#x2013; label the event and attach <code>.window</code> and define what should happen.</p><hr><p>With the modal sitting duck we just need a ways to call it up. I believe to have left off just about setting the rows right in my previous post, but I had to refactor that part (more will come, I anticipate):</p><pre><code class="language-ruby">.table-row.bg-white{&quot;x-description&quot; =&gt; &quot;Odd row&quot;, id:  dom_id(account) }
  .table-cell.px-6.py-4.whitespace-nowrap.text-sm.cursor-pointer.font-medium.text-gray-900{ :&quot;@click&quot; =&gt; &quot;openModal(&apos;#{edit_account_path(account)}&apos;)&quot;}
    = account.name
  .hidden.lg:table-cell.px-6.py-4.whitespace-nowrap.text-sm.text-gray-500
    /= #link_to account.participant.name, 
  .hidden.md:table-cell.px-6.py-4.whitespace-nowrap.text-sm.text-gray-500
    = account.service_plan
  .hidden.sm:table-cell.px-6.py-4.whitespace-nowrap.text-sm.text-gray-500
    \-
  .table-cell.px-6.py-4.whitespace-nowrap.text-right.text-sm.font-medium
    = link_to &apos;Destroy&apos;, account, method: :delete, data: { confirm: &apos;Are you sure?&apos; }</code></pre><p>There&apos;s at least one more post after this one &#x2013; this pattern begs a kind of componentization and my first target will be <a href="https://viewcomponent.org/">ViewComponents</a> possibly married to <a href="https://stimulus.hotwire.dev/">Stimulus</a>.</p><p>First, however, we will continue finishing the <em>naive</em> implementation with alpineJS, Turbo, and Hotwire. Check out the previous post if you&apos;d like to see how I managed to get the &apos;new account&apos; &#xA0;working with a modal.</p><p>In the above code-block <code>.table-cell.px-6.py-4.whitespace-nowrap.text-sm.cursor-pointer.font-medium.text-gray-900{ :&quot;@click&quot; =&gt; &quot;openModal(&apos;#{edit_account_path(account)}&apos;)&quot;}</code> is about the only really interesting thing. It tells AlpineJs to go look for a method called <code>openModal</code> when the user clicks somewhere on the row.</p><p>I&apos;ve put that &#x2013; and a couple others &#x2013; in the top of the view:</p><pre><code class="language-javascript">
  :coffeescript 

    window.indexState = () -&gt;
      {
        dispatcher: null,
        initModal: (d) -&gt;
          @dispatcher = d
        openModal: (url) -&gt;
          d = @dispatcher
          if url!=&apos;&apos;
            fetch url
              .then (response) -&gt;
                response.text()
              .then (response) -&gt;
                d &apos;open-event-modal&apos;, response
        editModal: (id) -&gt; 
          @dispatcher &apos;open-event-modal&apos;, id
        closeModal: () -&gt;
          @dispatcher &apos;close-event-modal&apos;,&apos;&apos;
      }

</code></pre><p>I woun&apos;t hold it against you if this is confusing! I&apos;ll admit to not labelling the methods to afford easy access but once you understand the scoping of AlpineJS I at least find it quite sensible to label methods alike &#x2013; they will work in unison to get the job done after all.</p><p>There&apos;s one more &apos;openModal&apos; in the section header affording the &apos;Ny konto&apos; (new account)</p><pre><code class="language-ruby">
:coffeescript

  window.sectionData = () -&gt;
    {
      dispatcher: null,
      init: (d) -&gt;
        @dispatcher = d
      openModal: () -&gt;
        d = @dispatcher
        fetch &apos;/accounts/new&apos;
          .then (response) -&gt;
            response.text()
          .then (response) -&gt;
            d &apos;open-event-modal&apos;, response
      closeModal: () -&gt;
        @dispatcher &apos;closed-event-modal&apos;,&apos;&apos;
    }


.bg-white{ :&quot;x-data&quot; =&gt; &quot;sectionData()&quot;, :&quot;x-init&quot; =&gt; &quot;init($dispatch)&quot;}
  .px-4.py-12.max-w-7xl.mx-auto.sm:px-6.lg:px-8
    .pb-5.border-b.border-gray-200.sm:flex.sm:items-center.sm:justify-between
      %h1.text-2xl.font-semibold.font-display.text-gray-900.sm:text-3xl.ml-5
        = section_title
      .mt-3.sm:mt-0.sm:ml-4
        %label.sr-only{:for =&gt; &quot;search_candidate&quot;}= section_search
        .flex.rounded-md.shadow-sm
          .relative.flex-grow.focus-within:z-10
            .absolute.inset-y-0.left-0.pl-3.flex.items-center.pointer-events-none
              %svg.h-5.w-5.text-gray-400{&quot;aria-hidden&quot; =&gt; &quot;true&quot;, :fill =&gt; &quot;currentColor&quot;, :viewbox =&gt; &quot;0 0 20 20&quot;, &quot;x-description&quot; =&gt; &quot;Heroicon name: solid/search&quot;, :xmlns =&gt; &quot;http://www.w3.org/2000/svg&quot;}
                %path{&quot;clip-rule&quot; =&gt; &quot;evenodd&quot;, :d =&gt; &quot;M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z&quot;, &quot;fill-rule&quot; =&gt; &quot;evenodd&quot;}
            %input#search_candidate.focus:ring-indigo-500.focus:border-indigo-500.w-full.rounded-none.rounded-l-md.pl-10.sm:block.sm:text-sm.border-gray-300{:name =&gt; &quot;search_candidate&quot;, :placeholder =&gt; section_search, :type =&gt; &quot;text&quot;}/
          %button.-ml-px.relative.inline-flex.items-center.px-4.py-2.border.border-green-300.text-sm.font-medium.rounded-r-md.text-green-800.bg-green-400.hover:bg-green-200.focus:outline-none.focus:ring-1.focus:ring-green-500.focus:border-green-500{ type: &quot;button&quot;, :&quot;@click&quot; =&gt; add_new_logic }
            = add_new_btn_title
</code></pre><p>You may notice how I&apos;ve started &quot;componentizing&quot; the section_header using variables to labels and methods like <code>section_title</code> and <code>add_new_logic</code> &#x2013; we&apos;ll revisit this in another post most certainly.</p><p>This partial gets called from the `/app/views/accounts/index.html.haml` like</p><pre><code class="language-ruby">= render partial: &quot;shared/section_heading&quot;, locals: { section_title: t(&apos;.title&apos;), section_search: t(&apos;.search&apos;), add_new_logic: &quot;openModal()&quot;, add_new_btn_title: t(&apos;.new&apos;) }</code></pre><p>All there is left is to adjust the controller. I&apos;ve moved the renders into templates</p><pre><code class="language-ruby">  # POST /accounts or /accounts.json
  def create
    @participant_type = params[:account].delete :participant_type
    @account = Account.new(account_params)
    respond_to do |format|
      if @account.save
        @account.set_participant @participant_type 
        format.turbo_stream 
        format.html { redirect_to accounts_url, notice: &quot;Account was successfully created.&quot; }
        format.json { render :show, status: :created, location: @account }
      else
        format.turbo_stream 
        format.html { render :new, status: :unprocessable_entity }
        format.json { render json: @account.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /accounts/1 or /accounts/1.json
  def update
    respond_to do |format|
      if @account.update(account_params)
        format.turbo_stream
        format.html { redirect_to accounts_url, notice: &quot;Account was successfully updated.&quot; }
        format.json { render :show, status: :ok, location: @account }
      else
        format.turbo_stream
        format.html { render :edit, status: :unprocessable_entity }
        format.json { render json: @account.errors, status: :unprocessable_entity }
      end
    end
  end
</code></pre><p>The <code>/app/views/accounts/create.turbo_stream.haml</code> will act on the result of the save</p><pre><code class="language-ruby">- if @account.errors.any?
  = turbo_stream.replace &quot;new_account&quot;, partial: &quot;accounts/form&quot;, locals: { account: @account, header: t(&apos;.konto&apos;) }
- else
  = turbo_stream.replace &quot;new_account&quot;, partial: &quot;accounts/form&quot;, locals: { account: Account.new, header: t(&apos;.konto&apos;) }
</code></pre><p>whereas the <code>/app/views/accounts/update.turbo_stream.haml</code> will do - well almost verbatim the same?!?</p><pre><code class="language-ruby">- if @account.errors.any?
  = turbo_stream.replace &quot;new_account&quot;, partial: &quot;accounts/form&quot;, locals: { account: @account, header: t(&apos;.konto&apos;) }
- else
  = turbo_stream.replace &quot;new_account&quot;, partial: &quot;accounts/form&quot;, locals: { account: Account.new, header: t(&apos;.konto&apos;) }
  = turbo_stream.replace( @account )</code></pre><p>I&apos;m positively sure this does not even make it to the first beta &#x2013; for one because it does not really take advantage of the Turbo(stream); it&apos;s little more than a bunch of JavaScript incantations not qualifying for much &apos;turbo&apos; :)</p><p>We&apos;ll see &#x2013; </p>]]></content:encoded></item><item><title><![CDATA[Tailwind, Hotwire, more]]></title><description><![CDATA[Tailwind CSS and Hotwire does wonders for Rails and in this series of posts I'm testing the waters, with these additions to my workbench.]]></description><link>https://blog.alco.dk/tailwind-hotwire-more/</link><guid isPermaLink="false">630f17fd27def0000754771d</guid><category><![CDATA[code]]></category><category><![CDATA[web]]></category><category><![CDATA[tailwind]]></category><category><![CDATA[hotwire]]></category><dc:creator><![CDATA[Walther H Diechmann]]></dc:creator><pubDate>Thu, 18 Mar 2021 22:31:59 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1537884944318-390069bb8665?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDEyfHxjb2RlfGVufDB8fHx8MTYxNjEwNzEzMw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1537884944318-390069bb8665?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDEyfHxjb2RlfGVufDB8fHx8MTYxNjEwNzEzMw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Tailwind, Hotwire, more"><p>Adam Wathan of <a href="https://tailwindcss.com">TailwindCSS</a> fame is doing a tremendous job rewriting CSS history and David Heinemeier Hansson, <a href="https://rubyonrails.org">Mr Rails</a>, just recently shared <a href="https://hotwire.dev">Hotwire</a>. That begged a test!</p><p>By test I mean building a resource like say <code>/accounts</code> to utilise both TailwindCSS goodness and Hotwire hotness.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-18-kl.-22.14.10.png" class="kg-image" alt="Tailwind, Hotwire, more" loading="lazy" width="1182" height="256" srcset="https://blog.alco.dk/content/images/size/w600/2021/03/Sk-rmbillede-2021-03-18-kl.-22.14.10.png 600w, https://blog.alco.dk/content/images/size/w1000/2021/03/Sk-rmbillede-2021-03-18-kl.-22.14.10.png 1000w, https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-18-kl.-22.14.10.png 1182w" sizes="(min-width: 720px) 720px"><figcaption>Well - not really like this though!</figcaption></figure><p>Hotwir-ing an index looks something like this:</p><pre><code class="language-ruby"> / index.html.haml
    = turbo_stream_from &quot;accounts&quot;
    .table.min-w-full.divide-y.divide-gray-200
      .table-row-group.table-fixed.bg-gray-50
        .table-row
          .table-cell.px-6.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider{:scope =&gt; &quot;col&quot;}
            Account
          .table-cell.px-6.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider{:scope =&gt; &quot;col&quot;}
            Participant
          .table-cell.px-6.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider{:scope =&gt; &quot;col&quot;}
            Service plan
          .table-cell.px-6.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider{:scope =&gt; &quot;col&quot;}
            N/A
          .table-cell.relative.px-6.py-3{:scope =&gt; &quot;col&quot;}
            %span.sr-only Edit
      .table-row-group{&quot;x-max&quot; =&gt; &quot;2&quot;}
        = turbo_frame_tag &quot;accounts&quot; do
          = render partial: &quot;account&quot;, collection: @accounts

    / _account.html.haml
    
    
  = turbo_frame_tag dom_id(account) do
    .table-row.bg-white{&quot;x-description&quot; =&gt; &quot;Odd row&quot;, id:  dom_id(account) }
      .table-cell.px-6.py-4.whitespace-nowrap.text-sm.font-medium.text-gray-900
        = link_to account.name, edit_account_path(account)
      .table-cell.px-6.py-4.whitespace-nowrap.text-sm.text-gray-500
        /= #link_to account.participant.name, 
      .table-cell.px-6.py-4.whitespace-nowrap.text-sm.text-gray-500
        = account.service_plan
      .table-cell.px-6.py-4.whitespace-nowrap.text-sm.text-gray-500
        \-
      .table-cell.px-6.py-4.whitespace-nowrap.text-right.text-sm.font-medium
        / %a.text-indigo-600.hover:text-indigo-900{:href =&gt; &quot;#&quot;} Edit
        = link_to &apos;Destroy&apos;, account, method: :delete, data: { confirm: &apos;Are you sure?&apos; }

</code></pre><p><code>= turbo_stream_from &quot;accounts&quot;</code> tells Rails to add a pint of HTML for the client to ponder on (or really the Javascript resource which Rails throws into the mix) and start &apos;subscribing&apos; to a stream which Rails sets up, and keeps publishing to once someone/something Create | Update | Delete &#xA0;accounts.</p><p><code>= turbo_frame_tag &quot;accounts&quot; do</code> instructs Rails to wrapping the entire set of &apos;details&apos; in a custom tag <code>&lt;turbo-frame id=&quot;accounts&quot;&gt;&lt;/turbo-frame&gt;</code> </p><p><code>= turbo_frame_tag dom_id(account) do</code> on every detail line does even so &#x2013; wrapping every row in another <code>&lt;turbo-frame id=&quot;accounts&quot;&gt;&lt;/turbo-frame&gt;</code> </p><p>This, however, kills any correct table cell width calculations (probably because the <code>turbo_frame_tag</code> gets in the way of the cells?)</p><p>Here&apos;s a hack! [ Disclaimer: I&apos;m sure there is a perfectly natural explanation and that I&apos;m just not RTFM carefully ] Meanwhile:</p><pre><code class="language-ruby">  / index.html.haml
      .table-row-group{&quot;x-max&quot; =&gt; &quot;2&quot;, id: &quot;accounts&quot;}
        / = turbo_frame_tag &quot;accounts&quot; do
        = render partial: &quot;account&quot;, collection: @accounts

    / _account.html.haml
    / = turbo_frame_tag dom_id(account) do
    .table-row.bg-white{&quot;x-description&quot; =&gt; &quot;Odd row&quot;, id:  dom_id(account) }</code></pre><p>Yep - I&apos;m waiting in anticipation for someone with all the &apos;brass&apos; to come ridiculing me of forgetting something but I&apos;ve not been able to google the correct way to get this to work!</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-18-kl.-22.12.32.png" class="kg-image" alt="Tailwind, Hotwire, more" loading="lazy" width="1186" height="425" srcset="https://blog.alco.dk/content/images/size/w600/2021/03/Sk-rmbillede-2021-03-18-kl.-22.12.32.png 600w, https://blog.alco.dk/content/images/size/w1000/2021/03/Sk-rmbillede-2021-03-18-kl.-22.12.32.png 1000w, https://blog.alco.dk/content/images/2021/03/Sk-rmbillede-2021-03-18-kl.-22.12.32.png 1186w" sizes="(min-width: 720px) 720px"><figcaption>This is how I&apos;d like my table to look like!</figcaption></figure><p>Now my Hotwire will realtime update my table &#x2013; and render my index with auto-calculated table cells; and I&apos;m happy!</p><p>If you&apos;d like to have your cake and eat it &#x2013; like reaping all the fruits from this &quot;hotwiring&quot; thing, you&apos;ll enhance your controller actions somewhat too:</p><pre><code class="language-ruby">
  def create
    @account = Account.new(account_params)
    respond_to do |format|
      if @account.save
        format.turbo_stream { head 200 }
        format.html { redirect_to accounts_url, notice: &quot;Account was successfully created.&quot; }
        format.json { render :show, status: :created, location: @account }
      else
        format.turbo_stream { render turbo_stream: turbo_stream.replace( @account, partial: &quot;accounts/form&quot;, locals: { account: @account } ) }
        format.html { render :new, status: :unprocessable_entity }
        format.json { render json: @account.errors, status: :unprocessable_entity }
      end
    end
  end


  # PATCH/PUT /accounts/1 or /accounts/1.json
  def update
    respond_to do |format|
      if @account.update(account_params)
        format.turbo_stream { render turbo_stream: turbo_stream.replace( @account ) }
        format.html { redirect_to accounts_url, notice: &quot;Account was successfully updated.&quot; }
        format.json { render :show, status: :ok, location: @account }
      else
        format.html { render :edit, status: :unprocessable_entity }
        format.json { render json: @account.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /accounts/1 or /accounts/1.json
  def destroy
    @account.destroy
    respond_to do |format|
      format.turbo_stream { render turbo_stream: turbo_stream.remove( @account ) }
      format.html { redirect_to accounts_url, notice: &quot;Account was successfully destroyed.&quot; }
      format.json { head :no_content }
    end
  end
</code></pre><p>The important parts being to add <code>format.turbo_stream</code> to each action in order to not reloading the entire &apos;page&apos;.</p><p>Job done.</p>]]></content:encoded></item></channel></rss>