{"id":3969,"date":"2020-09-16T12:19:01","date_gmt":"2020-09-16T12:19:01","guid":{"rendered":"https:\/\/bitcoinsv.io\/?p=3969"},"modified":"2020-09-28T10:34:33","modified_gmt":"2020-09-28T10:34:33","slug":"beyond-micropayments-the-rise-of-nano-services","status":"publish","type":"post","link":"https:\/\/bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/","title":{"rendered":"Beyond micropayments: The rise of nano-services"},"content":{"rendered":"\n

The Rails release of Bitcoin SV (v1.0.5) introduces several game changing features that have long been in the making.<\/span><\/p>\n\n\n\n

  1. Activation of the Journalling Block Assembler by default<\/span><\/li>
  2. Batch transaction submission<\/span><\/li>
  3. Free consolidation transactions<\/span><\/li><\/ol>\n\n\n\n

    This release is code-named RAILS because its major features are aimed to open new and innovative payment cases using the Bitcoin SV protocol and ledger, and empower Bitcoin SV companies to build more infrastructure for payments \u2013 \u201cpayment rails.\u201d<\/p>\n\n\n\n

    It is the last of these that we will focus on in the post.<\/span><\/p>\n\n\n\n

    The dust limit<\/span><\/h2>\n\n\n\n

    Once upon a time some BTC developers, mindful of their parental responsibilities to all participants in the Bitcoin network, introduced a protective mechanism called the Dust limit. Leaving aside the debate about the rightness or wrongness of paternalistic developer attitudes, this limit persists today as a policy enforced by default by miners. It was put in place as an attempt to prevent people from falling into a particular trap.<\/span><\/p>\n\n\n\n

    A typical Bitcoin transaction looks something like this:<\/span><\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    <\/span><\/p>\n\n\n\n

    The notable part of this example transaction is that values paid (in satoshis) are very large in comparison to the fee. The payment is about $11 USD in today\u2019s money whilst the fee is a tiny fraction of a cent. This tiny fee is what makes micropayments possible. No one wants to pay a significant chunk of their transactions as fees but when they are so low payments of even 1c are very feasible.  But there is a lower limit to what makes sense economically. And if you cross that limit far enough you get into territory where you can effectively render some satoshis unusable.<\/span><\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    <\/span><\/p>\n\n\n\n

    In the above example, we are trying to go beyond micro-payments and into what we will call \u201cnano-payments\u201d by attaching a tiny 10 satoshi output to an existing transaction.  This is where the dust limit would normally kick in to prevent the transaction going through, because under the standard fee policies that we are all accustomed to in Bitcoin, this output would require a higher fee to spend than the value of the output itself. It\u2019s economically cheaper to just write that 10 satoshis off than it is to ever spend it.  Unless perhaps we wait and hope that Bitcoin SV rises many orders of magnitude and fees in satoshis fall equally.<\/span><\/p>\n\n\n\n

    Payment channels are a well-known mechanism enabling exchanges of value incrementally in units so small that they wouldn\u2019t be economical in a Bitcoin transaction on their own.  But there are other ways. <\/span><\/p>\n\n\n\n

    Consolidation transactions<\/span><\/h2>\n\n\n\n

    A Bitcoin transaction has a variable number of inputs and a variable number of outputs.  When a transaction is accepted the previous outputs (which are referenced by the inputs) are removed from the UTXO database and the outputs are added. So the net effect on the size of the UTXO database (in terms of discrete items not bytes) after accepting a transaction can be expressed as:<\/span><\/p>\n\n\n\n

    utxo_delta = nOutputs - nInputs<\/span>. <\/span><\/pre>\n\n\n\n

    From a miner\u2019s point of view the size of the UTXO database matters because the larger it is the higher the cost of maintaining it. This is offset by the increased value of transaction fees that results but it is still in all miner\u2019s economic interests to trim the UTXO where possible. Enter the concept of a consolidation transaction which has many inputs and few outputs such that the utxo_delta is substantially negative resulting in a shrinking of the UTXO database.  Since this is already an economic net positive for a miner it is feasible for a miner to allow such a transaction with zero fee.<\/span><\/p>\n\n\n\n

    In doing so not only do we enable a lot of existing dust UTXOs to become useful again, but we also open up some powerful new use cases that are not possible with the current dust limit.<\/span><\/p>\n\n\n\n

    \"\"<\/figure><\/div>\n\n\n\n

    In the above example we see a normal transaction with additional 10 satoshi outputs attached. The recipient of these outputs simply collects enough of them to meet the criteria for a free consolidation transaction then converts the collective value of 1000 inputs into a single, higher-value output. The size of the UTXO database is reduced by 999 entries. One might argue that these are UTXOs that wouldn\u2019t have been created without this model being feasible, which may well be true, however, even ignoring existing dust cleanup benefits we end with essentially a net cost in UTXO size of zero whilst enabling highly flexible new use cases.<\/span><\/p>\n\n\n\n

    Nano service use cases<\/span><\/h2>\n\n\n\n

    So how might you make use of the ability to pay as low as 1 satoshi for a service?  Well that\u2019s for other creative minds to explore but in terms of normal operations of the Bitcoin network here\u2019s a few examples:<\/span><\/p>\n\n\n\n

    • Paying a specific miner a few satoshis to return you a Merkle proof when a transaction is mined (regardless of whether they mine it).<\/span><\/li>
    • Paying a specific miner to watch for double spends and notify you.<\/span><\/li>
    • Payments to a paymail host.<\/span><\/li>
    • Paying a channels server to store and forward your messages while you\u2019re offline (more on that later).<\/span><\/li>
    • Paying for insurance or countersigning by a specialist multisig custodian.<\/span><\/li><\/ul>\n\n\n\n

      Basically any service that is related to an economic transaction could be paid for in this way. The main caveat is there needs to be an existing transaction moving value in excess of a typical transaction fee for the nano-payment to piggy back off of.<\/span><\/p>\n\n\n\n

      What about payment channels?<\/span><\/h2>\n\n\n\n

      Payment channels are a perfectly valid way to achieve nano-payments which are useful in many scenarios. A payment channel only becomes useful when the likely settled amount is in excess of a transaction fee, but it allows incremental shifts of value in similarly small amounts to a consolidation transaction. This is useful where you might want to repeatedly use the same nano-service. There are trade-offs around implementation complexity to consider.  Where a consolidation transaction differs is that it can be used as a one-off for a particular service without establishing a payment channel-like relationship with the counterparty. Which of the two makes the most sense will come down to a use-by-use evaluation.<\/span><\/p>\n\n\n\n

      So how do we use them?<\/span><\/h2>\n\n\n\n

      Much like the early days of raising of the OP_RETURN limit, there will be a few initial barriers to getting such transactions accepted. Many will recall the efforts required to find nodes that supported it and to build connection pathways between enabled nodes so that OP_RETURN transactions could propagate.  It took some time and became more reliable over time until blanket adoption was achieved.  This will be similar but with a key accelerator provided by the Merchant API (henceforth known as mAPI).<\/p>\n\n\n\n

      Firstly the creation of dust outputs themselves are still limited to some degree by the dust limit. This limit will be removed entirely by the end of the year allowing even 0 value outputs. In the meantime the 1.0.5 release of bitcoin has at least fixed the hard limit and made it a function of the relay fee set by the Miner. This means that Miners who have upgraded to 1.0.5 should accept outputs greater than 140 satoshis. <\/p>\n\n\n\n

      Until widespread deployment by Miners is achieved the dust limit will remain a barrier to getting these transactions relayed which means you shouldn\u2019t assume the same level of zero-conf assurance as a transaction with only non-dust outputs. But for use cases where zero-conf doesn\u2019t matter this is safe to use right now.<\/p>\n\n\n\n

      Secondly for non-zero conf scenarios the p2p propagation can be bypassed entirely once mAPI supports these transactions. This is a feature of the mAPI 1.2 which is targeted for release in October. Once you couple a 1.2 mAPI with a 1.0.5 Bitcoin SV you\u2019ll be able to submit both dust output transactions and consolidation transactions directly to a Miner.<\/p>\n\n\n\n

      Definition of a Consolidation transaction<\/span><\/h2>\n\n\n\n

      In order for a transaction to be classified as consolidation by the Bitcoin SV software, some strict conditions must be met. nChain and the SV team have done some exhaustive analysis to choose these criteria in order to ensure the mechanism isn\u2019t gameable. We have erred very much on the side of caution and so there is plenty of room for the criteria to be relaxed in the future, but the current criteria enable a consolidation transaction to be constructed fairly simply.<\/span><\/p>\n\n\n\n

      A consolidation transaction is a transaction that reduces the number of UTXO’s by a margin that is more valuable for the network than the implied fee. Hence we allow consolidation transactions free from any fees.<\/span><\/p>\n\n\n\n

      The conditions for a consolidation transaction are as follows:<\/span><\/p>\n\n\n\n

      • The <\/span>scriptPubKey<\/span> sizes from the transaction outputs spent are compared to the <\/span>scriptPubKey<\/span> sizes of the consolidation transaction. The sum of the former must be greater than the sum of the latter multiplied by the consolidation factor (configuration parameter: <\/span>minconsolidationfactor<\/span>)<\/span><\/li>
      • The transaction input count must be greater than the transaction outputs count multiplied by <\/span>minconsolidationfactor<\/span><\/li>
      • All inputs must have a confirmation count of at least <\/span>minconsolidationinputmaturity<\/span>.<\/span><\/li>
      • scriptSig<\/span> sizes of the consolidation transaction have an upper limit of  <\/span>maxconsolidationinputscriptsize<\/span> bytes long to prevent gaming.<\/span><\/li>
      • Inputs spent in consolidation transactions must meet the old test of isStandard() if <\/span>acceptnonstdconsolidationinput<\/span> equals 0<\/span><\/li>
      • The default value for <\/span>maxconsolidationinputscriptsize<\/span> is 150 bytes.<\/span><\/li>
      • The default value for <\/span>minconsolidationfactor<\/span> is 20<\/span><\/li>
      • The default value for <\/span>minconsolidationinputmaturity<\/span> is 6 (equivalent to one hour)<\/span><\/li>
      • The default value for <\/span>acceptnonstdconsolidationinput<\/span> is 0 meaning only standard inputs allowed<\/span><\/li>
      • Setting <\/span>minconsolidationfactor<\/span> to 0 disables the free consolidation transactions feature<\/span><\/li><\/ul>\n\n\n\n

        The condition as the formula is:<\/span><\/p>\n\n\n\n

        c = minconsolidationfactor
        <\/span>m = minconsolidationinputmaturity
        s = maxconsolidationinputscriptsize
        a = acceptnonstdconsolidationinput
        isFree =  nInputs >= c * nOutputs
               && confirmationCount(input) >= m for all inputs 
        <\/span>       && sum(inputTxScriptPubKeyBytesLen[]) >= c * sum(outputTxScripPubKeytBytesLen[])
        <\/span>       && inputTxScriptSig <= s for all inputTxScriptSig
        <\/span>       && isStandardInput(input) for all inputs unless a == 1<\/span><\/pre>\n\n\n\n

        As a general rule of thumb:<\/p>\n\n\n\n

        • Consolidate at least 100 inputs to one output.<\/li>
        • Only use standard p2pkh inputs or bare multisig with no more than 2 signatures.<\/span><\/li>
        • Only use inputs confirmed for at least 6 blocks.<\/span>\n
            \n
          • This rule can be gotten around simply by constructing the transaction using all available inputs but not broadcasting it until 6 blocks after you made it.<\/span><\/li>\n<\/ul>\n<\/li><\/ul>\n\n\n\n

            By following these guidelines you should fall well within the strict criteria. The worst that can happen if you don\u2019t is that the transaction will get rejected with a \u2018too low fee\u2019 message in which case you can adjust it and try again.<\/span><\/p>\n\n\n\n

            The available set of transaction pricing models will ultimately be determined by miners and tested by market forces. This particular model is intended as a demonstration of what\u2019s possible when restrictions are lifted.  The SV team looks forward to seeing in what innovative ways nano-payments can be used.<\/span><\/p>\n\n\n\n

             <\/p>\n","protected":false},"excerpt":{"rendered":"

            The Rails release of Bitcoin SV (v1.0.5) introduces several game changing features that have long been in the making. Activation of the Journalling Block Assembler by default Batch transaction submission Free consolidation transactions This release is code-named RAILS because its major features are aimed to open new and innovative payment cases using the Bitcoin SV […]<\/p>\n","protected":false},"author":4,"featured_media":4384,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[73],"tags":[],"lang":"en","translations":{"zh":3976,"en":3969},"yoast_head":"\nBeyond micropayments: The rise of nano-services - Bitcoin SV<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Beyond micropayments: The rise of nano-services - Bitcoin SV\" \/>\n<meta property=\"og:description\" content=\"The Rails release of Bitcoin SV (v1.0.5) introduces several game changing features that have long been in the making. Activation of the Journalling Block Assembler by default Batch transaction submission Free consolidation transactions This release is code-named RAILS because its major features are aimed to open new and innovative payment cases using the Bitcoin SV […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/\" \/>\n<meta property=\"og:site_name\" content=\"Bitcoin SV\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-16T12:19:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-28T10:34:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bitcoinsv.io\/wp-content\/uploads\/2020\/09\/Nano_Payments_ENG.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"840\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BitcoinSVNode\" \/>\n<meta name=\"twitter:site\" content=\"@BitcoinSVNode\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/bitcoinsv.io\/#organization\",\"name\":\"Bitcoin SV\",\"url\":\"https:\/\/bitcoinsv.io\/\",\"sameAs\":[\"https:\/\/twitter.com\/BitcoinSVNode\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/bitcoinsv.io\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/bitcoinsv.io\/wp-content\/uploads\/2020\/10\/bsv-logo-wh-medium.png\",\"width\":800,\"height\":144,\"caption\":\"Bitcoin SV\"},\"image\":{\"@id\":\"https:\/\/bitcoinsv.io\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bitcoinsv.io\/#website\",\"url\":\"https:\/\/bitcoinsv.io\/\",\"name\":\"Bitcoin SV\",\"description\":\"Just another WordPress site\",\"publisher\":{\"@id\":\"https:\/\/bitcoinsv.io\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/bitcoinsv.io\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/bitcoinsv.io\/wp-content\/uploads\/2020\/09\/Nano_Payments_ENG.png\",\"width\":1280,\"height\":840},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/#webpage\",\"url\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/\",\"name\":\"Beyond micropayments: The rise of nano-services - Bitcoin SV\",\"isPartOf\":{\"@id\":\"https:\/\/bitcoinsv.io\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/#primaryimage\"},\"datePublished\":\"2020-09-16T12:19:01+00:00\",\"dateModified\":\"2020-09-28T10:34:33+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/\"]}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/#webpage\"},\"author\":{\"@id\":\"https:\/\/bitcoinsv.io\/#\/schema\/person\/d1b90c2f0b7b27b52e59ef856a57ab4e\"},\"headline\":\"Beyond micropayments: The rise of nano-services\",\"datePublished\":\"2020-09-16T12:19:01+00:00\",\"dateModified\":\"2020-09-28T10:34:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/#webpage\"},\"publisher\":{\"@id\":\"https:\/\/bitcoinsv.io\/#organization\"},\"image\":{\"@id\":\"https:\/\/stag.bitcoinsv.io\/2020\/09\/16\/beyond-micropayments-the-rise-of-nano-services\/#primaryimage\"},\"articleSection\":\"Articles\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/bitcoinsv.io\/#\/schema\/person\/d1b90c2f0b7b27b52e59ef856a57ab4e\",\"name\":\"Steve Shadders\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/bitcoinsv.io\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d08dfcc7367f9cdd71cedbd77082b84f?s=96&d=mm&r=g\",\"caption\":\"Steve Shadders\"},\"description\":\"Steve has been involved in Bitcoin infrastructure since early 2011. In his role, he contributes his ecosystem-wide perspective, to support building the mining and UX infrastructure, needed to enable Satoshi\\u2019s Vision.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/posts\/3969"}],"collection":[{"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/comments?post=3969"}],"version-history":[{"count":3,"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/posts\/3969\/revisions"}],"predecessor-version":[{"id":4375,"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/posts\/3969\/revisions\/4375"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/media\/4384"}],"wp:attachment":[{"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/media?parent=3969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/categories?post=3969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinsv.io\/wp-json\/wp\/v2\/tags?post=3969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}