<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Roshan Khandelwal on Medium]]></title>
        <description><![CDATA[Stories by Roshan Khandelwal on Medium]]></description>
        <link>https://medium.com/@roshan-khandelwal?source=rss-293c6e0bdca4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Pz7mGDvvKIZ_MANt.</url>
            <title>Stories by Roshan Khandelwal on Medium</title>
            <link>https://medium.com/@roshan-khandelwal?source=rss-293c6e0bdca4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 23:13:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@roshan-khandelwal/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Python and JavaScript — Differences]]></title>
            <link>https://roshan-khandelwal.medium.com/python-and-javascript-differences-2a4b10599d75?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a4b10599d75</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 11:41:16 GMT</pubDate>
            <atom:updated>2026-11-21T11:41:16.534Z</atom:updated>
            <content:encoded><![CDATA[<p>I have recently started learning Python, having been a JavaScript / Typescript developer for too long.</p><p>This post would be a expanding list of the caveats and pitfalls that I am finding in Python as compared to JS.</p><p>Will keep updating!!</p><h4>Default Argument Values</h4><p><strong>Python</strong> — evaluates L=[] <strong>once, when the function is defined</strong>, not each time it is called. That list is stored as the function’s default argument. Each call that omits L uses that <strong>same list</strong>, and append() mutates it</p><pre>def f(a, L=[]):<br>    L.append(a)<br>    return L<br><br>print(f(1)) // [1]<br>print(f(2)) // [1,2]<br>print(f(3)) // [1,2,3]</pre><p><strong>JavaScript</strong> — evaluates L=[] each time the function is called with that argument omitted or undefined</p><pre>function f(a, L = []) {<br>  L.push(a);<br>  return L;<br>}<br><br>console.log(f(1)); // [1]<br>console.log(f(2)); // [2]<br>console.log(f(3)); // [3]</pre><p>I also read about how to write the Python function in a different way setting L as None, but this is definitely something that might trip me later.</p><p>So I should keep it as a Best Practice, to always define arrays as None, if setting it up for updates.</p><h4>Annotations on function parameters</h4><p>Python does not enforce these annotations when the function is called.</p><pre>def normalized_filename(filename: str, lowercase: bool = False) -&gt; str:</pre><p>With <strong>Typescript</strong> — calling normalizedFilename(&quot; GUIDE.pdf &quot;, &quot;yes&quot;) <em>would fail to compile</em>, so that bug never reaches production.<br>But by default with <strong>Python</strong> — normalized_filename(&quot; GUIDE.pdf &quot;, lowercase=&quot;no&quot;) runs and still returns the lowercased version.</p><p>I mean the same thing would happen with Javascript as well. But to counter it, Typescript was created. <br>For Python, well need extension like mypy.</p><pre>uv add --dev mypy<br>uv run mypy --version<br>uv run mypy . # runs it on the entire workspace</pre><p>and setting it up in settings.json for an IDE, but that throws it in the <em>Output tab</em>.</p><pre>&quot;runOnSave.commands&quot;: [<br>        {<br>            // Match py files except names start with `_`.<br>            &quot;match&quot;: &quot;\\.py$&quot;,<br>            &quot;notMatch&quot;: &quot;[\\\\\\/]_[^\\\\\\/]*\\.py$&quot;,<br>            &quot;command&quot;: &quot;uv run mypy ${file}&quot;,<br>            &quot;runIn&quot;: &quot;backend&quot;,<br>            &quot;runningStatusMessage&quot;: &quot;Compiling ${fileBasename}&quot;,<br>            &quot;finishStatusMessage&quot;: &quot;${fileBasename} compiled&quot;<br>        }<br>    ]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a4b10599d75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who Pays for UPI?]]></title>
            <link>https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/94a825666e46</guid>
            <category><![CDATA[digital-payment]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[upi]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 13:46:04 GMT</pubDate>
            <atom:updated>2026-10-25T13:59:31.802Z</atom:updated>
            <content:encoded><![CDATA[<h4>The ₹21,000 crore question — Sabka Saath, Sabka Prayas</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBo3EtHE7i0zFqm2NlXdtQ.png" /><figcaption>The ₹21,000 crore question — Sabka Saath, Sabka Prayas</figcaption></figure><blockquote><em>UPI was built for everyone. Its sustainability should be a shared responsibility.</em></blockquote><p><em>We scan a QR code, enter a PIN, and move on with our lives. But behind that little green tick is an entire network of banks, applications, switches and security operations.</em></p><p>It is a convenient experience.</p><ol><li>No account number to remember.</li><li>No IFSC code to look up.</li><li>No cash to count.</li><li>No need to ask whether the other person uses the same payment app as you.</li></ol><p>But here is a question worth asking: <strong>What actually happens during those two seconds?</strong></p><p>Several organisations exchange messages. Accounts and identities are checked. Cryptographic operations protect sensitive information. Banks debit and credit ledgers. A central payment switch coordinates the process.</p><p>So, is UPI really free? Or have we simply become so accustomed to the experience that we no longer think about what it takes to deliver it?</p><p>That question became the starting point for <a href="http://transactionlab.in/">Transaction Lab</a></p><p>This is a <strong>4</strong> Part series</p><ol><li><strong>PART 1</strong> — <a href="https://roshan-khandelwal.medium.com/part-1-upi-in-action-263dd7cfa9a8">UPI in action — parties involved, Work Units &amp; Comparison with IMPS</a></li><li><strong>PART 2</strong> — <a href="https://roshan-khandelwal.medium.com/mdr-and-its-distribution-5fa334662f52">MDR &amp; It’s distribution</a></li><li><strong>PART 3</strong> — <a href="https://roshan-khandelwal.medium.com/merchants-users-the-actors-06bc948b5971">Merchants &amp; Users — The actors</a></li><li><strong>PART 4 — </strong><a href="https://roshan-khandelwal.medium.com/part-4-who-should-pay-to-keep-upi-free-three-alternatives-worth-exploring-ff42a8a034d4">Alternatives — Three other ways to fund ₹21,000 crore a year, each built on a different principle.</a></li></ol><h3>About Transaction Lab</h3><p>Throughout this series, Transaction Lab has tried to do more than point out a problem. The aim is to make the underlying mechanics visible, put numbers around the debate, and give people a way to explore the choices for themselves.</p><p>That is why we built an interactive space where you can try these simulations, alternatives, adjust assumptions and see how the outcomes change.</p><p>It’s free and works on mobile. Link: <a href="https://www.transactionlab.in/">https://www.transactionlab.in/</a></p><h4>1. Try the In-built Simulations or build one yourself</h4><p>Visit <a href="https://www.transactionlab.in/simulator"><strong>Transaction Lab — SIMULATOR</strong>.</a></p><p>Set up your bill-size distribution (what share of your bills fall in each range), split it across payment methods, and see the resulting MDR cost and effective rate.</p><p>You can set a baseline, rework with updated payment split, and examine what different payment mixes and MDR assumptions could mean for a merchant.</p><h4>2. Try the alternatives yourself</h4><p>Visit <a href="https://www.transactionlab.in/fund-upi"><strong>Transaction Lab — Fund UPI</strong></a>.</p><p>Explore the models, test the scenarios and see what happens when you change the assumptions. What if participation in voluntary contributions is lower? What if more users cross the threshold? What if the average excess spending is different?</p><p>The numbers in this article are starting points for a discussion — not the final word.</p><h4>3. Try the alternatives yourself</h4><p>Visit <a href="https://www.transactionlab.in/your-say?from=medium"><strong>Transaction Lab — Your Say</strong>.</a></p><p>We also want to hear from you.</p><p>Which alternative seems fairest? Do you have a different idea for funding UPI? Is there an assumption we have overlooked? Would you support a voluntary contribution, a broad-based funding model, a threshold-based contribution, or something entirely different?</p><p>Visit <a href="https://www.transactionlab.in/your-say?from=medium"><strong>Transaction Lab — Your Say</strong></a> to vote, share your own idea and stay in the loop as the discussion develops.</p><p>The aim is not just to collect votes. It is to build a more informed public conversation around the future of digital payments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94a825666e46" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 4 — Who Should Pay to Keep UPI Free? Three Alternatives Worth Exploring]]></title>
            <link>https://roshan-khandelwal.medium.com/part-4-who-should-pay-to-keep-upi-free-three-alternatives-worth-exploring-ff42a8a034d4?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff42a8a034d4</guid>
            <category><![CDATA[digital-payment]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[upi]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 13:44:54 GMT</pubDate>
            <atom:updated>2026-10-25T13:57:50.257Z</atom:updated>
            <content:encoded><![CDATA[<h4>The final part of the Transaction Lab series on the cost of India’s digital payments infrastructure</h4><ol><li><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46">Main Article</a></li><li><strong>PART 1</strong> — <a href="https://roshan-khandelwal.medium.com/part-1-upi-in-action-263dd7cfa9a8">UPI in action — parties involved, Work Units &amp; Comparison with IMPS</a></li><li><strong>PART 2</strong> — <a href="https://roshan-khandelwal.medium.com/mdr-and-its-distribution-5fa334662f52">MDR &amp; It’s distribution</a></li><li><strong>PART 3</strong> — <a href="https://roshan-khandelwal.medium.com/merchants-users-the-actors-06bc948b5971">Merchants &amp; Users — The actors</a></li></ol><p>In the <a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46?sharedUserId=roshan-khandelwal">earlier parts of this series</a>, we explored how a UPI transaction works, examined the proposed Merchant Discount Rate (MDR), and looked at the people on either side of the transaction: merchants and users.</p><p>We arrived at a difficult question.</p><p><strong>If UPI benefits everyone, should the cost of maintaining it be borne by only a section of the people who use it?</strong></p><p>The estimated annual cost of running UPI has been put at around ₹20,000–21,000 crore. MDR is one proposed way to recover part of that cost, but it is not the only conceivable approach.</p><blockquote>What if users could contribute voluntarily? <br>What if a temporary, broad-based tax adjustment could help fund the infrastructure? <br>What if the contribution depended on how much an individual spends or a merchant receives through UPI?</blockquote><p>These are not necessarily easy answers. Each comes with trade-offs, implementation challenges and questions of fairness.</p><p>But they are worth exploring.</p><p>Here are three alternatives we modelled at Transaction Lab.</p><h3>Alternative 1: UPI Jan Sahyog — Let people contribute voluntarily</h3><p>Imagine opening your UPI app and seeing a message:</p><p><em>“UPI keeps India moving. Help keep it running.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*euD0KapCz-JH7ruyuOpc_Q.png" /><figcaption>Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><p>You tap the message, learn how the system is funded, and choose whether to contribute.</p><p>That is the basic idea behind <strong>UPI Jan Sahyog</strong>: a voluntary contribution campaign that invites users to help sustain the infrastructure they depend on.</p><p>The proposed model could run as a 30-day campaign within participating UPI apps, supported by a public dashboard showing how much has been raised, how many people have contributed and how the funds are being used.</p><p>Contributors could receive a digital certificate or a shareable thank-you badge. The point would not be to make a payment mandatory, but to give people a transparent way to support a public digital utility.</p><h4>What could voluntary participation raise?</h4><p>The figures in the slide assume every targeted contributor participates and contributes the stated amount. They are illustrations of the scale of the challenge, not a prediction of actual donations.</p><p>Would 10 crore people contribute ₹2,100 a year? Would 20 crore contribute ₹1,050? We cannot assume they would.</p><p>A more modest campaign might ask people to contribute a preset amount, such as ₹201 or ₹501.</p><p><em>If 10% of the assumed 40 crore active users contributed, that would mean 4 crore contributors:</em></p><ul><li>At ₹201 each, the total would be approximately ₹804 crore.</li><li>At ₹501 each, the total would be approximately ₹2,004 crore.</li></ul><p>That would not cover the full annual cost, but it could make a meaningful contribution.</p><blockquote>India has previously experimented with incentives to encourage digital payments. In 2016, NITI Aayog announced the Lucky Grahak Yojana and Digi-Dhan Vyapar Yojana, which offered cash awards to consumers and merchants using digital payment instruments.</blockquote><h4>The trade-off</h4><p><em>Voluntary contributions preserve choice</em>. Nobody is forced to pay, and the campaign could build awareness of the infrastructure behind everyday payments.</p><p><strong>But participation is uncertain</strong>. People may appreciate UPI without feeling responsible for funding it. Others may be willing to contribute but only small amounts.</p><blockquote>A voluntary campaign would therefore be better viewed <strong>as one potential funding stream</strong>, rather than a guaranteed replacement for MDR.</blockquote><h3>Alternative 2: A temporary GST adjustment — Spread the burden across consumption</h3><p>The second alternative takes a different approach.</p><p>Instead of asking UPI users to make a voluntary contribution, what if a small, temporary tax adjustment helped fund the infrastructure?</p><blockquote>Our model explores a hypothetical increase in the GST rate on the 18% slab from 18% to 18.5%, for a limited 90-day period.</blockquote><p>This is a <strong>thought experiment — not a proposal currently in force</strong>, and not a claim that the government could introduce such a change without considering its wider economic and legal implications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJam4puf2XlGh5kcS-rOOA.png" /><figcaption>Our model explores a hypothetical increase in the GST rate on the 18% slab from 18% to 18.5%, for a limited 90-day period.</figcaption></figure><h4>How does the calculation work?</h4><p>For this scenario, we use the following assumptions:</p><ul><li>Monthly GST collection: approximately ₹2 lakh crore.</li><li>Share attributed to the 18% slab: 75%.</li><li>Baseline monthly collection from that slab: approximately ₹1.5 lakh crore.</li><li>Hypothetical rate increase: 18% to 18.5%.</li><li>Duration: three months.</li></ul><p>Under these assumptions,<strong> the additional monthly collection</strong> would be approximately ₹4,167 crore.</p><blockquote>Over three months, that comes to roughly <strong>₹12,500 crore</strong> — around 60% of the ₹21,000 crore annual UPI funding target.</blockquote><p>*<em>The calculation is based on a simplified proportional model: it assumes the taxable base and underlying activity remain unchanged, with no behavioural response to the higher rate. Actual collections could differ.</em></p><h4>Why consider this approach?</h4><p>Unlike a charge imposed specifically on eligible UPI transactions, <strong>a GST adjustment</strong> would spread the burden across a broader base of consumption.</p><p>People would contribute indirectly when they purchase goods and services subject to the affected rate, rather than paying a separate UPI fee.</p><p>That broader base could reduce the concentration of the burden on merchants accepting UPI payments.</p><p><strong>But there is an important qualification</strong>: GST is ultimately borne through the prices and transactions of the wider economy, and the burden would not be distributed equally across all households. <br>A rate change could also affect consumption, business costs and inflation. And GST revenue is public revenue; earmarking additional collections for UPI would require an explicit policy decision.</p><h4>The trade-off</h4><p>A temporary tax adjustment could potentially raise money at scale. Our model suggests ₹12,500 crore under its assumptions.</p><p>But it would not be a cost-free solution. It would involve a tax-policy decision, could affect consumers and businesses beyond the UPI ecosystem, and would need a transparent mechanism to connect the additional revenue to the intended purpose.</p><p>It is a useful comparison because it asks a different question:</p><p><strong>Should the cost of a widely used digital public utility be funded by the transactions that use it, or by a broader contribution from the economy that benefits from it?</strong></p><h3>Alternative 3: UPI Nirmaan Nidhi — Contribute more when usage is higher</h3><p>The third alternative tries to combine two principles:</p><ol><li>People and businesses below a defined threshold should pay nothing.</li><li>Those with higher UPI transaction volumes could contribute a small amount towards maintaining the infrastructure.</li></ol><p>We call this concept <strong>UPI Nirmaan Nidhi</strong>.</p><p>It is a proposed annual, threshold-based sustainability contribution — not an existing tax or an announced government scheme.</p><p>Under the model in our slides, only the amount above the applicable annual threshold would be chargeable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ori68SXbg9ZYT-qDA-91ZA.png" /><figcaption>Contribute more when usage is higher</figcaption></figure><h4>How would it work?</h4><p>For individual users:</p><ul><li>Annual UPI spending below ₹6 lakh: no contribution.</li><li>Annual UPI spending above ₹6 lakh: a proposed contribution of 0.5% on the excess amount.</li></ul><p>For merchants:</p><ul><li>Annual UPI receipts below ₹12 lakh: no contribution.</li><li>Annual UPI receipts above ₹12 lakh: a proposed contribution of 0.25% on the excess amount.</li></ul><p><strong>Individual user:</strong> Someone spends ₹10 lakh through UPI in a year. The amount above the ₹6 lakh threshold is ₹4 lakh. At 0.5%, the contribution would be ₹2,000.</p><p><strong>Merchant:</strong> A merchant receives ₹50 lakh through UPI in a year. The amount above the ₹12 lakh threshold is ₹38 lakh. At 0.25%, the contribution would be ₹9,500.</p><p><strong><em>The intended principle is progressive</em></strong> in the sense that the contribution is calculated only on usage above a threshold. Someone below the threshold pays nothing under this proposal, while someone with higher usage contributes more.</p><h4>What might it raise?</h4><p>We modelled several scenarios using an illustrative base of 40 crore users and 1.4 crore merchants.</p><p>The results depend on two main factors:</p><ul><li>How many users spend more than ₹6 lakh annually through UPI, and how far above the threshold they spend.</li><li>How many merchants receive more than ₹12 lakh annually through UPI, and how far above the threshold their receipts are.</li></ul><p>Our model examines three levels of participation or eligibility — conservative, moderate and high — under two assumptions about average excess usage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1OgF6IdeXNxLD1zWsoq1Q.png" /><figcaption>Three levels of participation or eligibility — conservative, moderate and high — under two assumptions about average excess usage.</figcaption></figure><p><em>These are scenario outputs, not revenue forecasts. They depend on assumptions about the number of people and merchants crossing the thresholds and their average excess transaction volumes. Those assumptions would need to be validated against appropriate data before the model could be used to make policy decisions.</em></p><p>The range is nevertheless informative.</p><blockquote>Under the model’s higher-usage scenario, the contribution could approach ₹18,100 crore — about 86% of a ₹21,000 crore annual target. Under more conservative assumptions, the amount would be much smaller.</blockquote><h4>The trade-off</h4><p>A threshold-based contribution could distribute the cost across both users and merchants, while protecting lower-volume participants.</p><p>But it does raise different questions.</p><p>Should spending above a threshold be taxed when it may include transfers between a person’s own accounts? How should household payments be treated? among others.</p><p>A fair model would need to answer those questions before implementation.</p><p>Still, this alternative offers a useful starting point: rather than charging every transaction or concentrating the burden on one side, it explores whether a contribution based on annual usage could share the cost more broadly.</p><h3>Three alternatives. Three different philosophies.</h3><p>Each model begins with the same funding problem but approaches it differently.</p><p><strong>UPI Jan Sahyog</strong> asks whether people who value UPI would voluntarily help fund it.</p><p><strong>A temporary GST adjustment</strong> asks whether the cost could be spread across a broader base of consumption.</p><p><strong>UPI Nirmaan Nidhi</strong> asks whether people and businesses with higher UPI usage could contribute more, while those below the thresholds pay nothing.</p><p>None is a complete solution on its own. Each has assumptions that need testing, implementation details that need designing and consequences that deserve public discussion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qz8A1cHmLiNAJKy9P0FkEQ.png" /><figcaption>The Cost of UPI Should Be Shared. Not Shifted</figcaption></figure><blockquote>And the alternatives are not necessarily mutually exclusive. A funding framework could combine multiple sources, provided the overall burden, governance and use of funds are transparent.</blockquote><blockquote>The point is not to declare one model the winner before examining the evidence.</blockquote><blockquote><strong>It is to move the discussion beyond a binary choice between charging merchants and leaving the system unfunded.</strong></blockquote><h3>UPI was built for everyone. Its sustainability should be a shared responsibility.</h3><p>The objective is not simply to find someone to pay ₹21,000 crore.</p><p>It is to design a fairer way to fund the infrastructure that millions of people and businesses depend on.</p><p>Perhaps the right answer is voluntary participation. Perhaps it is a broader funding mechanism. Perhaps it is a combination of several approaches we have not yet considered.</p><p>We do not claim to have the final answer.</p><p>But we believe the question deserves to be explored openly — with evidence, transparent assumptions and the participation of the people who use the system every day.</p><p><em>This concludes the </em><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46?sharedUserId=roshan-khandelwal"><em>4-part Transaction Lab series</em></a><em> on UPI’s transaction mechanics, funding framework, actors and possible alternatives. The alternatives presented here are exploratory models developed for discussion, not existing government policies or financial advice. Their estimates depend on the assumptions stated in the article and would require further validation before any real-world implementation.</em></p><h4>1. Try the In-built Simulations or build one yourself</h4><p>Visit <a href="https://www.transactionlab.in/simulator"><strong>Transaction Lab — SIMULATOR</strong>.</a></p><h4>2. Try the alternatives yourself</h4><p>Visit <a href="https://www.transactionlab.in/fund-upi"><strong>Transaction Lab — Fund UPI</strong></a>.</p><h4>3. Have your say</h4><p>Visit <a href="https://www.transactionlab.in/your-say?from=medium"><strong>Transaction Lab — Your Say</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff42a8a034d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 3— Merchants & Users — The Actors]]></title>
            <link>https://roshan-khandelwal.medium.com/merchants-users-the-actors-06bc948b5971?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/06bc948b5971</guid>
            <category><![CDATA[india]]></category>
            <category><![CDATA[upi]]></category>
            <category><![CDATA[digital-payment]]></category>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 12:56:21 GMT</pubDate>
            <atom:updated>2026-10-25T13:56:57.792Z</atom:updated>
            <content:encoded><![CDATA[<h4>Who is on either side of India’s UPI revolution, and who is expected to foot the bill?</h4><ol><li><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46">Main Article</a></li><li><strong>PART 1</strong> — <a href="https://roshan-khandelwal.medium.com/part-1-upi-in-action-263dd7cfa9a8">UPI in action — parties involved, Work Units &amp; Comparison with IMPS</a></li><li><strong>PART 2</strong> — <a href="https://roshan-khandelwal.medium.com/mdr-and-its-distribution-5fa334662f52">MDR &amp; It’s distribution</a></li><li><strong>PART 4 — </strong><a href="https://roshan-khandelwal.medium.com/part-4-who-should-pay-to-keep-upi-free-three-alternatives-worth-exploring-ff42a8a034d4">Alternatives — Three other ways to fund ₹21,000 crore a year, each built on a different principle.</a></li></ol><p>In <a href="https://roshan-khandelwal.medium.com/part-1-upi-in-action-263dd7cfa9a8">Part 1 of this series</a>, we looked at what happens behind the green tick when you make a UPI payment. A seemingly simple transaction sets several participants and systems to work.</p><p>In <a href="https://roshan-khandelwal.medium.com/mdr-and-its-distribution-5fa334662f52">Part 2</a>, we looked at the money: the existing &amp; the proposed Merchant Discount Rate (MDR), how it could be distributed among participants, and the gap between the estimated cost of running UPI and the revenue the proposed charges might generate.</p><p>Now, let’s look at the people on either side of that transaction.</p><p>The merchant who accepts your payment. The customer who makes it. The small shop at the corner. The person who scans a QR code several times a day without giving it a second thought.</p><p>How many of them are there? And how many could actually be affected by the proposed MDR framework?</p><blockquote>To understand the scale of the question, we need to start counting.</blockquote><h3>First, the issue</h3><p>The rationale behind introducing MDR is relatively straightforward.</p><p>Money is collected from certain transactions and distributed among participants in the payment ecosystem. The expectation is that this revenue will help fund infrastructure, improve resilience, support cybersecurity and enable the system to handle growing transaction volumes.</p><p>There is also a commercial incentive. More UPI usage means more transactions, which can create more opportunities for banks and payment companies to offer services and generate revenue.</p><p>On the face of it, the logic makes sense.</p><p>Except for one question.</p><blockquote><strong>The person making the payment initiates the transaction and creates demand on the system. Yet, under the proposed framework, the merchant receiving that payment is the one expected to bear the MDR.</strong></blockquote><p>Is that the right way to structure the economics of UPI?</p><p>Before answering, let’s understand the two populations involved.</p><h3>The merchants: How many are we talking about?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Med9UYVUegRvRjLmUtcr1g.png" /><figcaption>Analysis looks at turnover slabs rather than assuming every merchant pays the same amount. Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><p>India has an enormous and diverse merchant base. But asking how many merchants exist does not produce one straightforward answer. Different sources count different things.</p><p>Consider three estimates.</p><ul><li><strong>Retail and trade:</strong> Industry bodies such as the Confederation of All India Traders (CAIT) and the Retailers Association of India (RAI) have estimated that India has around 6.5–7 crore non-corporate retail merchants. This includes kirana stores, fruit and vegetable vendors, apparel retailers and wholesalers.</li><li><strong>Udyam and Udyam Assist:</strong> More than 7.83 crore enterprises have been registered through the Ministry of MSME’s Udyam Registration Portal and Udyam Assist Platform.</li><li><strong>Digital payment acceptance:</strong> Estimates put the number of merchants actively accepting digital payments through UPI QR codes and soundboxes at around 5–6 crore.</li></ul><blockquote>A business registration is not necessarily the same thing as an active merchant. And a merchant accepting digital payments is not necessarily eligible for MDR.</blockquote><p>So the next question is more specific: <strong>how many merchants could fall within the proposed charging framework?</strong></p><h3>The ₹1 lakh threshold: Who is exempt?</h3><p>Under the proposed framework, small merchants receiving up to ₹1 lakh per month through UPI QR codes under the eligible small-merchant category continue to receive zero-MDR treatment.</p><p>That works out to ₹12 lakh in annual UPI receipts if the merchant receives ₹1 lakh every month.</p><p>Using the broad merchant estimates and the turnover distribution in our analysis, the potentially chargeable population is estimated at around <strong>1.2–1.4 crore merchants</strong>.</p><p>That is a very different number from the total merchant population.</p><p><em>It suggests that a minority of merchants could fall within the charging range</em>, while several crore smaller businesses remain outside it.</p><h3>What about schools, colleges and hospitals?</h3><p>The merchant population is not limited to shops and retail traders.</p><p>Private clinics, dental practices, diagnostic laboratories and coaching institutes can be part of the broader enterprise landscape. Educational institutions and hospitals, however, have different organisational structures and may fall under different merchant categories or applicable fee arrangements.</p><p>A blanket assumption that every institution faces the same percentage charge would therefore be misleading.</p><p>For a high-value payment — say, a semester fee of ₹60,000 or a hospital bill of ₹1.5 lakh — even a fraction of a percentage point can translate into a meaningful amount. The applicable framework and category-specific treatment matter.</p><p>The lesson is simple: counting merchants is only the first step. Understanding which merchants are eligible, what they receive through UPI and which rates apply is essential before estimating the total burden.</p><h3>What could the charge mean for a merchant?</h3><blockquote>A percentage can look small when it is written on paper. Its significance becomes clearer when we translate it into money.</blockquote><p>Under the proposed standard MDR rate, an eligible transaction above ₹2,000 would attract a charge of 0.4%, subject to the applicable rules and cap.</p><p>Consider a merchant receiving ₹10 lakh in eligible transactions over a year.</p><p>At a hypothetical 0.4% charge on the entire ₹10 lakh, the MDR would amount to ₹4,000 before any applicable GST on the charge.</p><p>For a business operating on thin margins, that is not an abstract percentage. <em>It is money that would otherwise remain in the business.</em></p><p>Of course, the actual amount depends on which transactions qualify, the merchant’s exemption status, any applicable sector-specific rate or cap, and the proportion of receipts that fall within the charging framework.</p><p>That is why our slide analysis looks at turnover slabs rather than assuming every merchant pays the same amount.</p><p>The purpose is not to claim that every merchant in a particular slab will pay a fixed sum. It is to understand how the cost might be distributed across businesses of different sizes.</p><h3>Now, the other side of the counter: UPI users</h3><p>Let’s turn to the people making the payments.</p><p>According to figures cited by the Ministry of Finance from NPCI records, approximately <strong>55.5 crore people have registered bank accounts on UPI</strong>.</p><blockquote>But registration does not mean every person transacts regularly.</blockquote><p>The estimate for monthly active transacting users is around <strong>40–45 crore</strong> — people who make at least one UPI transaction in a 30-day period.</p><p>Those numbers tell us two different things:</p><ul><li>Registered users tell us how widely the system has reached.</li><li>Active users tell us how many people actually use it during a given period.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s2qVTjKdE1E7vDYB8w6QlA.png" /><figcaption>Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><p>To put the scale into perspective, our slide analysis compares these figures with estimates of India’s total population, adult population and smartphone user base.</p><blockquote>one thing is clear: UPI is no longer a niche payment method. It is embedded in everyday economic activity.</blockquote><h3>How often do people use UPI?</h3><p>In FY2025–26, UPI processed approximately <strong>24,162 crore transactions</strong>.</p><p>Divide that by 365 days and the result is around <strong>66 crore transactions per day</strong>.</p><p>Now compare that with a base of approximately 40 crore active users:</p><p>That gives us an average of <strong>roughly 1.6 transactions per active user per day</strong>.</p><p>But an average can hide a great deal.</p><p>Some people may use UPI several times a day: for morning tea, milk or vegetables, an auto-rickshaw ride, fuel, lunch, groceries and other purchases. Others may use it only once every few days.</p><p>Our analysis uses an illustrative split to make this difference easier to visualise: around 10 crore frequent users making three to four transactions a day, alongside around 30 crore more casual users.</p><p><strong><em>That split is an assumption, not an independently verified count of how often different groups transact.</em></strong><em> The aggregate transaction total does not tell us how many individual users fall into each frequency group.</em></p><h3>Putting the two sides together</h3><p>On one side, the proposed MDR framework is intended to collect revenue from eligible merchant transactions. <em>Our analysis estimates that around 1.2–1.4 crore merchants could fall within the potentially chargeable range</em>, although the actual population will depend on eligibility and transaction data.</p><p>On the other side, <em>around 40–45 crore people are estimated to make at least one UPI payment in a month.</em> They use the system for everything from small everyday purchases to larger payments.</p><p>The proposed framework does not charge ordinary users MDR directly. <em>It places the charge on eligible merchants</em>, while person-to-person payments and qualifying small-merchant transactions remain outside the charging framework.</p><blockquote>The comparison is striking: a relatively small share of the merchant population could be asked to contribute through MDR, while a much larger population of users continues to make payments without a direct per-transaction fee.</blockquote><p>But the headcounts alone do not tell us who should pay.</p><p>Merchants benefit from accepting digital payments. Users benefit from the convenience of making them. Banks and payment companies operate and support parts of the infrastructure. The wider economy benefits when money can move quickly and reliably.</p><p>Each of those observations is relevant. None, by itself, settles how the cost should be shared.</p><h3>So, who should pick up the bill?</h3><p>The estimated annual cost of running UPI has been put at around ₹20,000–21,000 crore. The proposed MDR framework has been discussed as a way to recover a portion of that cost through eligible merchant transactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3lu1bCJJWvV3eu1FE3gyQ.png" /></figure><blockquote>The framework was originally scheduled to begin on 15 October 2026, but NPCI subsequently deferred implementation until after Diwali, with a new date to be notified separately. The proposed charges should therefore not be described as already in force as of the date of this article. <a href="https://www.business-standard.com/finance/news/upi-mdr-deferred-until-after-diwali-new-date-to-be-notified-npci-126101300556_1.html">Business Standard’s report on the deferment</a>.</blockquote><p>The underlying question remains.</p><ul><li>Should the cost of maintaining a system used by hundreds of millions of people be recovered primarily from the businesses accepting payments?</li><li>Should users contribute in some way?</li><li>Should banks and payment companies fund more of the infrastructure through their broader commercial activities?</li><li>Or should there be a combination of funding mechanisms?</li></ul><p>Those are questions about policy, incentives and the long-term sustainability of digital payments — not just arithmetic.</p><p>For now, the numbers help us understand who the actors are, how large their populations may be, and why the allocation of costs matters.</p><p><strong>The merchants accept the payments. The users make them. Both depend on the same system.</strong></p><p>So, who is better placed to shoulder the burden of keeping UPI running: the merchants who accept the payments, or the people who make them?</p><p>In the <a href="https://roshan-khandelwal.medium.com/part-4-who-should-pay-to-keep-upi-free-three-alternatives-worth-exploring-ff42a8a034d4">last part of this series</a>, <em>we will explore alternatives</em>: If merchants are not the only possible source of funding, what other models could sustain UPI?.</p><p><em>This article is the 3rd part of a </em><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46?sharedUserId=roshan-khandelwal"><em>4-part Transaction Lab investigation</em></a><em> into the technology, economics and cost-sharing of digital payments.</em></p><p>Explore the analysis and interactive tools at <a href="https://transactionlab.in/"><strong>https://transactionlab.in</strong></a>.</p><p><em>Merchant counts, turnover-based estimates and user-frequency splits are estimates or illustrative assumptions where indicated; they should not be read as a definitive official count of MDR-paying merchants or individual transaction behaviour.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06bc948b5971" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 2 — MDR and it’s distribution]]></title>
            <link>https://roshan-khandelwal.medium.com/mdr-and-its-distribution-5fa334662f52?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fa334662f52</guid>
            <category><![CDATA[upi]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[digital-payment]]></category>
            <category><![CDATA[fintech]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 10:44:49 GMT</pubDate>
            <atom:updated>2026-10-25T13:55:51.932Z</atom:updated>
            <content:encoded><![CDATA[<p>MDR is not simply a fee imposed on a payment. It is a mechanism for <strong>distributing the cost and the revenue</strong> of a payment ecosystem. The difficult questions are who pays, who receives the money, and whether the amount collected is enough to sustain the infrastructure.</p><ol><li><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46"><strong>Main Article</strong></a></li><li><strong>PART 1</strong> — <a href="https://roshan-khandelwal.medium.com/part-1-upi-in-action-263dd7cfa9a8">UPI in action — parties involved, Work Units &amp; Comparison with IMPS</a></li><li><strong>PART 3</strong> — <a href="https://roshan-khandelwal.medium.com/merchants-users-the-actors-06bc948b5971">Merchants &amp; Users — The actors</a></li><li><strong>PART 4 — </strong><a href="https://roshan-khandelwal.medium.com/part-4-who-should-pay-to-keep-upi-free-three-alternatives-worth-exploring-ff42a8a034d4">Alternatives — Three other ways to fund ₹21,000 crore a year, each built on a different principle.</a></li></ol><p><em>UPI has transformed how India pays. But when the infrastructure costs thousands of crores to operate, who should foot the bill — and who should receive the money when a transaction is charged?</em></p><p>In the <a href="https://roshan-khandelwal.medium.com/part-1-upi-in-action-263dd7cfa9a8">First part of this series</a>, we followed a UPI payment from the moment a customer scans a QR code to the moment a green tick appears.</p><p>We identified five participants in our illustrative payment journey, broke the process into work units, and compared the resulting 42 work units for UPI with 18 for a modelled IMPS transfer.</p><p>The comparison was not a measurement of actual operating costs. It was an attempt to make the underlying work visible.</p><p><strong>If the infrastructure behind UPI costs money to operate, how should that cost be recovered?</strong></p><p>This is where the debate around the current and re-introduced Merchant Discount Rate, or MDR, begins.</p><p>And to understand that debate, we need to follow two things: the money charged on a transaction, and the money distributed across the payment ecosystem.</p><h3>First, what exactly is MDR?</h3><p>A Merchant Discount Rate is a fee associated with processing a merchant payment. <strong>It is paid by the merchant</strong> and distributed among the relevant payment service providers and financial institutions.</p><p><strong>The MDR is not simply government revenue</strong>. Under the proposed UPI framework, it is intended to be distributed among participants in the payment ecosystem.</p><p>That distinction matters.</p><p>The debate is not merely about whether a charge exists. It is about who bears it, who receives it, and whether the resulting distribution creates the right incentives to maintain the system.</p><h3>IMPS already has a charge. Why should UPI be different?</h3><p>Consider a conventional bank transfer using IMPS.</p><p>For a ₹50,000 transfer, the published standard charge ( for say HDFC back ) is <strong>₹5</strong> plus applicable GST.</p><p>Now compare that with a ₹50,000 merchant payment under the proposed 0.4% UPI MDR framework.</p><p>The calculation is straightforward:</p><ul><li>Customer’s payment: ₹50,000</li><li>MDR at 0.4%: <strong>₹200</strong> plus applicable GST.</li></ul><p>On these assumptions, the proposed UPI MDR is <strong>40 times</strong> the standard ₹5 IMPS charge, before GST.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZNXkrJZ4i6m9koMxMvxGww.png" /><figcaption>Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><p>The comparison is useful not because it proves that one system is inherently better or cheaper, but because it exposes a fundamental difference in the way the payment is funded.</p><blockquote>With IMPS, the published outward transfer fee is charged to the sender. Under the proposed UPI MDR framework, the fee is charged within the merchant payment ecosystem.</blockquote><p><strong>The cost has not merely changed. The party expected to bear it has changed as well.</strong></p><h3>We have been here before: the existing 1.1% MDR</h3><p>The proposed 0.4% framework <em>is not the first time</em> a merchant discount has been associated with UPI.</p><p>From April 2023, an interchange framework applied to specified merchant transactions made using prepaid payment instruments, including eligible wallet-funded UPI payments, and RuPay credit cards linked to UPI. The applicable rates depend on the transaction category and relevant rules; 1.1% is not a universal charge on every UPI payment.</p><p>Consider an illustrative ₹50,000 merchant transaction subject to a 1.1% rate.</p><p>The calculation is: <strong>₹50,000 × 1.1% = ₹550.</strong></p><p>The merchant would receive ₹49,450 after a ₹550 deduction, assuming the full transaction value is subject to that rate.</p><p><strong>Who gets the ₹550?</strong></p><p>Our Transaction Lab analysis breaks down the distribution illustrated in the accompanying slide. In that model, the prepaid instrument issuer receives the largest share, reflecting its role in operating the wallet infrastructure, managing customer balances and handling associated compliance and risk responsibilities.</p><p>The important point is that the MDR is not necessarily retained by a single institution.</p><p>It is a pool of revenue shared across the ecosystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tfAzwqa5Gwb7Pn3LwlJfXA.png" /><figcaption><em>The distribution percentages in our existing-MDR slide are Transaction Lab’s analysis of the illustrated arrangement, not a universal payout schedule for every wallet or RuPay credit-card transaction. Actual commercial and regulatory arrangements can vary.</em></figcaption></figure><h3><strong>The .4% Reintroduced MDR Distribution</strong></h3><p>Now let us move to the proposed framework for specified UPI merchant transactions funded directly from bank accounts.</p><p>For the same ₹50,000 transaction, the calculation changes:</p><p><strong>₹50,000 × 0.4% = ₹200 + GST.</strong></p><p>The merchant receives ₹49,800, assuming no other adjustments apply. But the more interesting question is how the ₹200 should be distributed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gn5gIRkeI5xDfacp1NFVag.png" /><figcaption>These percentages reflect the reported allocation model, not a distribution that Transaction Lab has independently verified against actual settlement records.</figcaption></figure><p>Our model assigns approximately 9.5% of the work units to the remitter bank, but the reported MDR allocation assigns it 40% of the fee pool.</p><p>The sponsor PSP bank accounts for approximately 23.8% of our work units, but receives 10% in the illustrative distribution.</p><p>Does that mean the distribution is unfair?</p><p>A work unit is not a rupee. A network request does not have the same cost as operating a secure banking infrastructure, maintaining customer accounts, absorbing fraud-related risks or ensuring regulatory compliance.</p><p>The issuer bank holds the customer’s deposit account and is responsible for the debit-side banking operations. The acquiring side has its own merchant-facing responsibilities. The application provider builds and maintains the interface through which customers initiate payments.</p><p><strong>The right question is not whether the fee should be divided in direct proportion to work units. It is whether the distribution reasonably reflects the costs, risks, responsibilities and incentives of each participant.</strong></p><h3>The big numbers: how much of UPI would actually be charged?</h3><p>By now, we have established that the proposed MDR is 0.4% on specified transactions above ₹2,000, subject to exemptions, special rates and a cap.</p><p>But how many transactions would that affect?</p><p>This is where the scale of UPI becomes important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_g4ahPYoJJCwAkEabn9VZw.png" /></figure><p>For our analysis, we used the following estimates:</p><ul><li>Person-to-merchant transactions account for approximately 63% of UPI transaction volume in the data we examined.</li><li>If around 4% of P2M transactions attract MDR, that implies <strong>approximately 2.5% of all UPI transactions could be affected by count</strong>.</li><li>Approximately 25% of total UPI transaction value was estimated to fall within the charging framework.</li><li>Total UPI transaction value for FY2025–26 was estimated in our analysis at ₹314.23 lakh crore.</li></ul><p>Applying 25% to ₹314.23 lakh crore gives approximately ₹78.56 lakh crore in transaction value within the assumed charging base.</p><blockquote>At 0.4%, the arithmetic produces: <strong>₹78.56 lakh crore × 0.4% ≈ ₹31,400 crore. </strong>That is a theoretical calculation — not a forecast of MDR collections.</blockquote><h3>Why the expected collection is much lower</h3><blockquote>NPCI Managing Director and CEO Dilip Asbe has indicated that the proposed framework could recover approximately ₹13,000–15,000 crore in its first year, against an estimated annual UPI ecosystem cost of around ₹21,000 crore.</blockquote><p>That estimate is materially lower than the ₹31,400 crore generated by our simplified calculation.</p><p>The difference reflects the fact that the framework does not apply a flat 0.4% charge to every rupee moving through UPI.</p><p>The rules include, among other things:</p><ul><li>A ₹300 cap for eligible transactions of ₹75,000 and above.</li><li>A flat ₹5 MDR for specified essential and thin-margin sectors.</li><li>A lower 0.02% rate for specified capital-market transactions, subject to the applicable cap.</li><li>Zero-MDR categories and exemptions for qualifying small merchants.</li><li><strong><em>essential sectors — such as educational fee collection, utilities, fuel, and healthcare — are sheltered from standard commercial percentage MDR</em></strong></li></ul><p>These restrictions change the effective rate applied to the overall payment value.</p><p><em>The expected ₹13,000–15,000 crore is also an estimate, not a guaranteed collection</em>. Actual revenue will depend on transaction patterns, eligibility, implementation and the applicable rules.</p><p>Still, the comparison gives us a useful order of magnitude.</p><p>If the ecosystem costs approximately ₹21,000 crore annually, a collection of ₹13,000 crore would cover about 62% of that estimate. At ₹15,000 crore, the coverage would be about 71%.</p><p><strong>Even at the upper end, the proposed MDR would not be expected to recover the entire estimated annual cost.</strong></p><p>And this is where the debate becomes more interesting.</p><h3>MDR is not a complete funding solution</h3><p>The estimated ₹20,000–21,000 crore annual cost of the UPI ecosystem is substantial. “Asbe” has also called for major banks and payment application providers to invest proactively in technology to build capacity, resilience and scalability.</p><p>That is a reminder that the funding question extends beyond the transaction fee itself.</p><p>Payment infrastructure needs to handle rising volumes, remain available, protect against fraud and cyber threats, and continue to evolve. These responsibilities require investment even when the individual transaction appears effortless.</p><p>At the same time, the success of UPI rests partly on its low-friction user experience and broad accessibility. <em>A funding model that undermines adoption or disproportionately burdens small merchants could damage some of the very benefits it seeks to sustain</em>.</p><p>There is no simple answer.</p><p>But now we can identify the trade-offs more clearly when we separate three questions:</p><ol><li><strong>Cost:</strong> How much does it actually cost to operate and maintain the ecosystem?</li><li><strong>Distribution:</strong> How should the revenue be allocated among participants with different responsibilities and risks?</li><li><strong>Coverage:</strong> How much of the total cost can reasonably be recovered through MDR, without undermining the accessibility of UPI?</li></ol><h3>What we know so far</h3><p>We now have a clearer picture of the economics behind the green tick.</p><p><strong>UPI involves multiple participants</strong>, and our illustrative model counts 42 work units compared with 18 for a modelled IMPS transfer.</p><p>An existing MDR framework applies to specified wallet-funded UPI and RuPay credit-card merchant transactions. The proposed 0.4% framework would extend charges to specified merchant payments funded from bank accounts, subject to thresholds, caps and exemptions.</p><blockquote>The expected first-year recovery of ₹13,000–15,000 crore is meaningful, but it remains below the estimated ₹20,000–21,000 crore annual cost of running the ecosystem.</blockquote><p>The gap does not automatically prove that the proposed MDR is too low, nor does it establish that merchants should bear more of the cost. It tells us that MDR alone may not settle the funding question.</p><p>And the allocation of MDR is not simply a matter of dividing the money according to the number of technical steps performed. Banks, applications and infrastructure providers have different responsibilities, costs and risks that a work-unit model cannot fully capture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h-Jfc6fv77ufJRGAOLxvzQ.png" /><figcaption>Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><h3>The next step is to put the assumptions under pressure.</h3><p>What happens when we change the transaction mix? What does the proposed MDR mean for a business with hundreds of daily payments? How much could a merchant save if some customers used another payment method? And how do the results change when the assumptions change?</p><p>That is where we move from analysing the payment ecosystem to simulating its economics.</p><p>This simulation and scenarios are baked into the <a href="https://www.transactionlab.in/simulator">SIMULATOR</a></p><p><em>This is Part 2 of </em><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46?sharedUserId=roshan-khandelwal"><em>Transaction Lab’s 4-part investigation</em></a><em> into UPI, payment infrastructure and the economics of digital payments.</em></p><p>Explore the research and interactive tools at <a href="https://transactionlab.in/"><strong>https://transactionlab.in</strong></a>.</p><p><strong>Sources and methodology</strong></p><ul><li><a href="https://www.hdfc.bank.in/imps/fees-and-charges">HDFC Bank — IMPS fees and charges</a></li><li><a href="https://www.pib.gov.in/PressReleasePage.aspx?PRID=2310586&amp;lang=2&amp;reg=48">Ministry of Finance — UPI MDR framework, 15 September 2026</a></li><li><a href="https://www.telegraphindia.com/amp/business/upi-mdr-0-4-per-cent-merchant-fee-unlikely-to-cover-costs-says-npci-chief-prnt/cid/2181554">The Telegraph — NPCI’s estimate of MDR recovery and ecosystem costs</a></li><li><a href="https://www.npci.org.in/product/upi/product-statistics">NPCI — UPI product statistics</a></li></ul><p><em>Work-unit counts, the IMPS comparison and the theoretical ₹31,400 crore calculation are Transaction Lab analyses based on the assumptions described above. The distribution examples are illustrative and should not be interpreted as audited settlement data or a universal schedule applying to every transaction.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fa334662f52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Part 1 — UPI in action]]></title>
            <link>https://roshan-khandelwal.medium.com/part-1-upi-in-action-263dd7cfa9a8?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/263dd7cfa9a8</guid>
            <category><![CDATA[fintech]]></category>
            <category><![CDATA[upi]]></category>
            <category><![CDATA[digital-payment]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Sun, 25 Oct 2026 07:57:07 GMT</pubDate>
            <atom:updated>2026-10-25T13:54:22.378Z</atom:updated>
            <content:encoded><![CDATA[<p>What UPI is, how a single payment travels through five parties, and how much work that takes compared with IMPS.</p><p><em>We scan a QR code, enter a PIN, and move on with our lives. But behind that little green tick is an entire network of banks, applications, switches and security operations.</em></p><p>It is a convenient experience.</p><ol><li>No account number to remember.</li><li>No IFSC code to look up.</li><li>No cash to count.</li><li>No need to ask whether the other person uses the same payment app as you.</li></ol><p>But here are questions worth asking:</p><ol><li><strong>What actually happens during those two seconds?</strong></li><li><strong>What work is actually being performed when a UPI payment happens?</strong></li></ol><p>Several organisations exchange messages. Accounts and identities are checked. Cryptographic operations protect sensitive information. Banks debit and credit ledgers. A central payment switch coordinates the process.</p><p>To understand the economics, we first need to understand the machinery.</p><ol><li><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46"><strong>Main Article</strong></a></li><li><strong>PART 2</strong> — <a href="https://roshan-khandelwal.medium.com/mdr-and-its-distribution-5fa334662f52">MDR &amp; It’s distribution</a></li><li><strong>PART 3</strong> — <a href="https://roshan-khandelwal.medium.com/merchants-users-the-actors-06bc948b5971">Merchants &amp; Users — The actors</a></li><li><strong>PART 4 — </strong><a href="https://roshan-khandelwal.medium.com/part-4-who-should-pay-to-keep-upi-free-three-alternatives-worth-exploring-ff42a8a034d4">Alternatives — Three other ways to fund ₹21,000 crore a year, each built on a different principle.</a></li></ol><p><em>Before UPI, making payments for small to medium purchases was all cards and cash. </em><br>Big payments, would and still go through conventional bank transfers like IMPS, RTGS &amp; NEFT. This would involve collecting their account number and IFSC code, adding them as a beneficiary, waiting for activation and dealing with initial transfer restrictions.</p><p>UPI changed the experience by introducing a simpler way to identify the recipient and initiate a payment across participating banks.</p><h3>Five parties. One payment.</h3><p>Imagine you are paying a shopkeeper using Google Pay. Your money is in an HDFC Bank savings account, the shopkeeper banks with the State Bank of India (SBI), and Google Pay uses ICICI Bank as its Payment Service Provider (PSP) or sponsor bank for this example.</p><ol><li><strong>You and your payment app:</strong> Google Pay provides the interface through which you scan the QR code, review the recipient and initiate the payment.</li><li><strong>Your sponsor bank:</strong> ICICI Bank acts as the banking interface for the third-party application in this example, helping route payment messages into the UPI system.</li><li><strong>NPCI:</strong> The central switch coordinates the relevant requests and responses between participating institutions.</li><li><strong>Your bank:</strong> HDFC Bank authenticates the payment as required, checks your available balance and debits your account.</li><li><strong>The shopkeeper’s bank:</strong> SBI validates the receiving account and credits the shopkeeper’s account.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HHGqqGyqZOcdqAAk6OVeUA.gif" /><figcaption>Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><h3>Can we count the work behind the green tick?</h3><p>We want to move beyond just a diagram of the payment journey, and estimate the amount of work performed by the different participants</p><p>For this, Transaction Lab introduced a simple measure: <strong>work units, or WU</strong>.</p><p>A network request or response leg counts as one work unit. So does an internal operation such as parsing a QR code, performing a routing lookup, validating a PIN through the relevant security infrastructure, or updating an account ledger.</p><blockquote>This is our own analytical model. A work unit is <strong>not</strong> an official NCPI metric, nor is it a direct measurement of computing time, electricity consumption or rupee cost.</blockquote><p>Using our illustrative transaction flow, we counted 42 work units for a UPI payment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rLOh4cGXr5vUcGWsLi9MSA.png" /><figcaption>Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><p>That number helps us ask better questions.</p><ol><li>Which participants handle the most steps?</li><li>Which operations are necessary to provide the convenience users value?</li><li>How does the process compare with a different payment method?</li><li>And what can such a comparison tell us about the economics of digital payments?</li></ol><h3>What if we compare UPI with IMPS?</h3><p>UPI builds on India’s existing banking and payment infrastructure. IMPS, another NPCI-operated payment system, already enabled near-real-time interbank transfers before UPI became ubiquitous.</p><p>In our model, we counted <strong>42 work units</strong> for UPI and <strong>18 </strong>for a comparable IMPS flow.</p><blockquote>That is approximately 133% more work units for UPI under our chosen assumptions.</blockquote><p>The result should be read as a finding from our model, not an independently verified statement about the actual cost of operating UPI versus IMPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1CC4NGr3aNTVgkyjM62GQ.png" /><figcaption>Free to share with credit to <strong>transactionlab.in</strong></figcaption></figure><h3>Convenience has an infrastructure behind it</h3><p>UPI is not merely a cheaper-looking interface placed on top of an otherwise identical transfer. Its design provides capabilities that make payments dramatically easier for users, and those capabilities involve additional technical steps.</p><p><strong>The question is not whether those extra steps are good or bad. It is what they deliver, what they cost, and how that cost should be shared.</strong></p><p>But as digital payments become an increasingly important part of commerce, understanding that infrastructure becomes more than a technical curiosity.</p><blockquote>It becomes an economic question.</blockquote><p>If merchants, banks, payment applications and infrastructure providers all contribute to the payment journey, how should the cost be allocated</p><p>Which costs are fixed, and which scale with transaction volume?</p><p>Does a more convenient payment flow necessarily cost more?</p><p>And can the ecosystem be funded sustainably without undermining the accessibility that made it successful?</p><p>We cannot answer all those questions simply by counting work units.</p><p>But we can begin by making the underlying assumptions visible, testing different scenarios and distinguishing what we know from what we estimate.</p><p>That is what we are building with <strong>Transaction Lab</strong>.</p><p>In the <a href="https://roshan-khandelwal.medium.com/mdr-and-its-distribution-5fa334662f52">next part of this series</a>, <em>we will follow the money</em>: examine the economics of the UPI ecosystem, look at the MDR debate, and investigate what happens when a seemingly small charge is applied across a large volume of merchant transactions.</p><p>Because once we understand how the green tick works, the next question becomes unavoidable.</p><p><strong>Who pays for it?</strong></p><p><em>This article is the first part of a </em><a href="https://roshan-khandelwal.medium.com/who-pays-for-upi-94a825666e46?sharedUserId=roshan-khandelwal"><em>4-part Transaction Lab</em></a><em> investigation into the technology, economics and cost-sharing of digital payments.</em></p><p>Explore the analysis and interactive tools at <a href="https://transactionlab.in/"><strong>https://transactionlab.in</strong></a>.</p><p><em>Methodology note: The work-unit figures are Transaction Lab estimates based on an illustrative transaction flow. They are not official NPCI measurements or independently verified estimates of monetary operating costs. The UPI–IMPS comparison depends on the assumptions and operations included in the model.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=263dd7cfa9a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Combo Learning — 1 + 1 Offer]]></title>
            <link>https://roshan-khandelwal.medium.com/combo-learning-1-1-offer-a4a5cdf8910c?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4a5cdf8910c</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[turborepo]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Mon, 20 Mar 2023 17:40:20 GMT</pubDate>
            <atom:updated>2023-03-20T17:41:02.780Z</atom:updated>
            <content:encoded><![CDATA[<h3>Combo Learning — 1 + 1 Offer</h3><p>I watch a lot of YouTube Videos and read a lot of articles on <a href="http://daily.dev/">daily.dev</a>, &amp; i try out a lot of these on my own.</p><p>With this series, I would be combining 2 or more of these videos / articles together into one working codebase.</p><p>I will provide links to the individual pieces of information ( with proper attribution ), as well the public GITHub repo.</p><p>It could be a shameless copy — paste, &amp; for most part it would be the same steps that the authors take. But would outline key commands, &amp; my additions ( links etc.. )</p><p>My initial idea was to have a separate repo for each of these articles, but instead i will be using <a href="https://turbo.build/repo/docs/getting-started/create-new">TurboRepo</a>, to create a MonoRepo, and add each of these projects to in there.</p><blockquote>Workspaces are the building blocks of your monorepo. Each app and package you add to your monorepo will be <strong>inside its own workspace</strong>.</blockquote><blockquote>To use workspaces, you must first declare their file system locations to your package manager.</blockquote><blockquote>The apps folder should contain workspaces for launchable apps, such as a <a href="https://nextjs.org/">Next.js(opens in a new tab)</a> or <a href="https://svelte.dev/">Svelte(opens in a new tab)</a> app.</blockquote><pre>npm install turbo --global<br>npx create-turbo@latest</pre><pre>&gt;&gt;&gt; Success! Created a new Turborepo at &quot;comboLearning&quot;.<br>Inside that directory, you can run several commands:<br><br>  npm run build<br>     Build all apps and packages<br><br>  npm run dev<br>     Develop all apps and packages</pre><p>By default this adds 2 apps and 3 packages into the repo. But i do not need any of these.</p><p>I will delete all the apps and packages inside, and <em>add each one of my articles code into the apps</em>.</p><p>and then for running a script inside one of my workspaces, I will use</p><pre>cd &lt;root&gt;/apps/...<br>turbo run dev</pre><p>This works beautifully.</p><p><a href="https://github.com/roshankhandelwal/comboLearning">GitHub - roshankhandelwal/comboLearning: Set of projects for ComboLearning Medium series</a></p><ol><li><a href="https://roshan-khandelwal.medium.com/1-1-vite-user-inactivity-3e4450b6fb1f">Vite + Tracking User Inactivity</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4a5cdf8910c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[1+1 | Vite + User Inactivity]]></title>
            <link>https://roshan-khandelwal.medium.com/1-1-vite-user-inactivity-3e4450b6fb1f?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e4450b6fb1f</guid>
            <category><![CDATA[vites]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Mon, 20 Mar 2023 17:38:54 GMT</pubDate>
            <atom:updated>2023-03-20T17:51:54.388Z</atom:updated>
            <content:encoded><![CDATA[<p>This combines two YouTube videos</p><ol><li><a href="https://www.youtube.com/watch?v=89NJdbYTgJ8&amp;ab_channel=TraversyMedia">Vite Crash Course | Faster Alternative To CRA</a></li><li><a href="https://www.youtube.com/watch?v=j-bVM7Bm6Rk&amp;ab_channel=CodeDeepDive">How to Detect User Inactivity in a React Application using Hooks | React JS Tutorial</a></li></ol><p>Start with navigating to <a href="https://vitejs.dev/">https://vitejs.dev/</a> &amp; the 1st thing you do is “Toggle the Dark Mode ON” :)</p><p>Move to <a href="https://vitejs.dev/guide/">https://vitejs.dev/guide/</a> and pick the npm create command, to run in a folder on my local.</p><pre>npm create vite@latest</pre><p>If you look at the options — for selecting a variant, there are four of these, two of which have +SWC added.</p><p>What is SWC ?</p><blockquote>Vite 4.0 also adds support for SWC, a Rust-based bundler that claims order-or-magnitude speed improvement over Babel. Vite 4.0 now uses Rollup 3.0 at build time. Rollup 3.0 was announced a few weeks before at ViteConf 2022</blockquote><blockquote>From Google</blockquote><p>I will pick that.</p><p>The final selections being, and then I will just follow the instructions.</p><pre>✔ Project name: … vite_user_inactivity_3e4450b6fb1f<br>✔ Select a framework: › React<br>✔ Select a variant: › TypeScript + SWC<br><br>Scaffolding project in /home/prathamos/.../learning/vite_user_inactivity_3e4450b6fb1f...<br><br>Done. Now run:<br><br>  cd vite_user_inactivity_3e4450b6fb1f<br>  npm install<br>  npm run dev</pre><p>Before I do a <em>npm run dev</em> — we would check the <strong>vite.config.ts</strong>, &amp; add an option for the port.</p><p><a href="https://vitejs.dev/config/">https://vitejs.dev/config/</a> — For the config options</p><p>I just added a server.port with 3250.</p><h4>Adding the User Inactivity changes</h4><p>Since this feature, should be across the entire application, i.e <em>well the user did nothing for the past xx mins, and we would be logging them out</em>.</p><p>So would add it to a separate component ( Inactivity.tsx ) &amp; have it nest App.</p><p><em>Coding Inactivity.tsx</em></p><ol><li>The first thing, that I got stuck on was — React 18 + Typescript, since</li></ol><blockquote>In React 18 the FunctionalComponent interface has changed. The PropsWithChildren type is omitted from the props type of a FunctionalComponent after React 18, this means that you have to include the children prop yourself</blockquote><blockquote><a href="https://stackoverflow.com/questions/59106742/typescript-error-property-children-does-not-exist-on-type-reactnode">https://stackoverflow.com/questions/59106742/typescript-error-property-children-does-not-exist-on-type-reactnode</a></blockquote><p>2. The other thing is showing the loggedInStatus, which does not show up just the true / false . Instead I used</p><p>IsLoggedIn : {!isLoggedIn ? “Not Logged In” : “Is Logged In”}</p><p>Looking at the code from Inactivity, there are a couple of values, that should be coming in from an env file — expiryTimeInterval, localStorageKeyName, checkInterval</p><p>and so these would be added to the .env file</p><p><a href="https://vitejs.dev/guide/env-and-mode.html">https://vitejs.dev/guide/env-and-mode.html</a><br>To prevent accidentally leaking env variables to the client, only variables prefixed with VITE_ are exposed to your Vite-processed code</p><pre>VITE_EXPIRY_TIME_INTERVAL=10000<br>VITE_LS_EXPIRY_KEY_NAME=expiryTime<br>VITE_CHECK_INTERVAL=5000</pre><p>and using them via</p><pre>const updateExpiryTime = () =&gt; {<br>    const expiryTime = Date.now() + parseInt(import.meta.env.VITE_EXPIRY_TIME_INTERVAL, 10);<br>    localStorage.setItem(import.meta.env.VITE_LS_EXPIRY_KEY_NAME, expiryTime.toString());<br>}</pre><p>Next part would be to add some styling, probably add some <em>Tailwind</em></p><p><a href="https://roshan-khandelwal.medium.com/combo-learning-1-1-offer-a4a5cdf8910c">Main Article</a> — For Combo learning</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e4450b6fb1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizing Strapi — v4]]></title>
            <link>https://roshan-khandelwal.medium.com/customizing-strapi-v4-28d89e159604?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/28d89e159604</guid>
            <category><![CDATA[strapi-4]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Wed, 05 Jan 2022 07:12:03 GMT</pubDate>
            <atom:updated>2022-01-05T07:12:03.771Z</atom:updated>
            <content:encoded><![CDATA[<h3>Customizing Strapi — v4</h3><p>Routes, Controllers &amp; Services ( v4 )</p><p>By default when you do a findOne, <em>Strapi would search by id</em>, &amp; since you cannot customize the id field ( <em>not as of 1st Jan, 2022</em> ), so if you wanted to make a <strong>findOne</strong> call by a<strong> [slug]</strong>, it would throw a 500 internal server error, since you tried passing a string to a field that expected a number.</p><p>Here is a <a href="https://www.youtube.com/watch?v=gtvXiRqn0ZI">Youtube link</a> — that teaches you to do it with v3. With v4 things have changed a bit.</p><p>I am working with an Content Type called <strong>Pack</strong></p><h4>Custom route</h4><p>We would first define a custom route. <br> <a href="https://docs.strapi.io/developer-docs/latest/development/backend-customization/routes.html#creating-custom-routers">https://docs.strapi.io/developer-docs/latest/development/backend-customization/routes.html#creating-custom-routers</a></p><p><strong>Path</strong> — src &gt; api &gt; pack &gt;routes &gt; pack.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f7cddc6fc07accff409e43fb0146793/href">https://medium.com/media/2f7cddc6fc07accff409e43fb0146793/href</a></iframe><p>This defines a custom handler to handle this route, with no authentication</p><h4>Extending controller</h4><p><a href="https://docs.strapi.io/developer-docs/latest/development/backend-customization/controllers.html#adding-a-new-controller">https://docs.strapi.io/developer-docs/latest/development/backend-customization/controllers.html#adding-a-new-controller</a></p><p><strong>Path</strong> — src &gt; api &gt; pack &gt;controllers &gt; pack.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/abe7cf786c43e854ff013ba25a69964a/href">https://medium.com/media/abe7cf786c43e854ff013ba25a69964a/href</a></iframe><p>Created a new function, which then calls the service.</p><h4>Extending Service</h4><p>Even though Strapi provides an <a href="https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api.html">Entity Service</a>, We are going to go beyond it, and look at the Query Engine, that it is built on.</p><blockquote>Strapi provides an Entity Service API, built on top of the <a href="https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html">Query Engine API</a>. The Entity Service is the layer that handles Strapi&#39;s complex data structures like <a href="https://docs.strapi.io/developer-docs/latest/development/backend-customization/models.html#components">components</a> and <a href="https://docs.strapi.io/developer-docs/latest/development/backend-customization/models.html#dynamic-zones">dynamic zones</a>, and uses the Query Engine API under the hood to execute database queries.</blockquote><p><em>Reference</em>- <a href="https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.html">Query Engine</a> &amp; <a href="https://docs.strapi.io/developer-docs/latest/development/backend-customization/services.html#adding-a-new-service">Service</a></p><p><strong>Path</strong> — src &gt; api &gt; pack &gt;services &gt; pack.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/30d9e28a0fcb094ec310567e88d3389d/href">https://medium.com/media/30d9e28a0fcb094ec310567e88d3389d/href</a></iframe><p>With all this in place, when we make a call to <strong>packs/:packId</strong>, it would be handled by the <strong>findOneByPackId</strong> method in the controller, which would call the <strong>findone</strong> method on the predefined <em>EntityService</em>, <strong>which has been overwritten.</strong></p><p><em>In this case, we are overwriting the findOne method, since the pack would always be fetched via packId. However we could have as easily defined a custom method on the service, &amp; referenced that in the controller.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28d89e159604" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Issues i faced with Strapi]]></title>
            <link>https://roshan-khandelwal.medium.com/whats-wrong-with-strapi-94923a113104?source=rss-293c6e0bdca4------2</link>
            <guid isPermaLink="false">https://medium.com/p/94923a113104</guid>
            <category><![CDATA[headless-cms]]></category>
            <category><![CDATA[strapi]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Roshan Khandelwal]]></dc:creator>
            <pubDate>Mon, 03 Jan 2022 06:08:19 GMT</pubDate>
            <atom:updated>2022-01-12T08:29:37.671Z</atom:updated>
            <content:encoded><![CDATA[<p>The Headless CMS, which can be installed on premise, impressive UI &amp; ease of development are all the reasons, why I picked it for the current project, &amp; if you only use the API &amp; UI to manage your data, maybe you will never run into these issues. [ <a href="https://itnext.io/5-things-i-love-about-strapi-a-node-js-headless-cms-700b4fec544b">5-things-i-love-about-strapi</a> ]</p><p>For my Use case, I would like a separately installed Postgres DB ( running in its own Docker ) &amp; a custom server, that would connect to this DB directly, and make CRUD changes.</p><p>The same Postgres, is also what Strapi is connecting to.</p><h4>ID &amp; Unique Constraints</h4><p><em>The ability to customize a primary key is no longer an option (for the time being). It is recommended to use the UUID plugin if you would like an additional unique, non-serial integer key. ( </em><a href="https://stackoverflow.com/questions/67907513/how-to-set-primary-key-in-strapi-other-then-id">how-to-set-primary-key-in-strapi-other-then-id</a> )</p><p>Well not a problem, I can always create another field, as suggested and mark it as unique</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*HFY1pzjGjOwX4P0BpBcIYg.png" /><figcaption>Required &amp; Unique field</figcaption></figure><p>Now when i try to add an entry, from the strapi API, with the same wordId — it doesn’t allow me to. <strong>Awesome</strong></p><p>But wait, If i were to navigate to the PostgresDB, connecting to it via pgAdmin, &amp; move to the words table,<strong><em> there are no unique constraints</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*memUwpEZ_qAfv35fRxqwIg.png" /><figcaption>Zero Unique constraints</figcaption></figure><p>Well what does it mean?</p><ol><li>That <em>all the unique constraint checks are only implemented at the API level</em>. If i try to add something from the UI, it would make a call to the DB, find if there are existing values, &amp; if so, then show the popup.</li><li><em>But the application is not taking advantage of the capabilities of the DB</em>, given the fact that Strapi uses <a href="https://knexjs.org/#Schema-table-unique">Knex.js </a>, which does offer this capability.</li><li>In my case, it means, that the custom server will also need to implement such a check. ( unnecessary work )</li></ol><blockquote>I might try to add a constraint directly to the DB, but the moment, I make a change to the model &amp; save, it will overwrite everything.</blockquote><p>This along with the fact, that i cannot customize the primary key, implies i will need to make un-necessary calls, expecially in case of many-to-many relations.</p><p>Again all of this will be taken care of, if I am using the Strapi APIs, but anything that i wish to do on the DB directly ( with custom Apis ), will need some more work.</p><h4>Array data type</h4><p>Postgres provides an Array field type, &amp; so does Knex. <br>In fact there is also a <a href="https://forum.strapi.io/t/how-to-save-postgres-array-type/2005">post</a>, to add array type in Strapi.<em> I tried doing this and it did not work</em>.</p><p>The data type in itself is very useful to store a list of hobbies, tags, list of ids etc, essentially a list of strings.</p><p>There are other ways of modelling it.</p><ol><li>One to many relation</li><li>Repeatable Components ( Strapi ) — but these are array of objects, so not applicable.</li><li>JSON type field with a key to hold an array.</li></ol><p>All of these are possible solutions, but still they seem as workaround. I am hoping for the array type to work.</p><p>I will still however continue to evaluate &amp; use Strapi for my current project. :)</p><p>As i have been evaluating Strapi &amp; customizing it, I am also updating it here.<br><a href="https://roshan-khandelwal.medium.com/customizing-strapi-v4-28d89e159604">Customizing Strapi V4</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94923a113104" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>