[{"categories":[],"content":"I think open source is facing a sort of existential crisis. And I don\u0026rsquo;t think we\u0026rsquo;re the only ones. We\u0026rsquo;re just ahead of the curve.\nIn a world where intelligence is abundant, users can absolutely vibe code anything they want without our help. Why are we useful?\nI would argue that vibe coding may even be safer! A developer builds software for many users, so if that software is compromised, many users are compromised too, making it a perfect target. (Now imagine you\u0026rsquo;re working in Bitcoin, and your software is open source)\nOn the other hand, our merchant—let\u0026rsquo;s call him Mike—is vibe coding his own software. One that doesn\u0026rsquo;t warrant this kind of attention from attackers due to the limited reward and the closed sourceness nature of it.\nAlso, Mike\u0026rsquo;s \u0026ldquo;mywares\u0026rdquo; have a tiny attack surface because they don\u0026rsquo;t include any superfluous features he\u0026rsquo;ll never use.\nYou say: \u0026ldquo;But he can\u0026rsquo;t maintain it over time!\u0026rdquo;\nI reply: \u0026ldquo;Who care about maintenance?\u0026rdquo;\nMike is the only user. He doesn\u0026rsquo;t maintain it. He throws the whole project into the fire and raises a new one from the ashes with a new prompt.\nAnd I tell you, I\u0026rsquo;ve been a developer for more than 20 years. I\u0026rsquo;m not being ironic. Most of my experience has been about keeping software maintainable, allowing it to grow steadily without collapsing under its own weight. The rules have changed. How can I serve Mike now? Mike is all that ultimately matters to BTCPay Server. No Mike to serve, no point in continuing.\nLet\u0026rsquo;s say we embrace this and make BTCPay Server plugins easier for Mike to vibe code.\nCouldn\u0026rsquo;t we push this further? Why does Mike even need plugins? Why not just drop BTCPay Server altogether? Couldn\u0026rsquo;t he make us obsolete? And I tell you\u0026hellip; he can!\nAnd he should feel no shame in doing this, no sense of loyalty. He needs to serve his customers, not us. This is capitalism. I would be ashamed if his loyalty stood in the way of serving his customers. I wouldn\u0026rsquo;t even be sad if he didn\u0026rsquo;t need us, we could retire the project and happily focus on new things, freeing up resources for better endeavors.\nWill this be the future? Everybody surrounded by their own mywares. Believe it or not, I personally like that.\nBut there is a fundamental gap between AI and humans, and Mike\u0026rsquo;s agent can\u0026rsquo;t replace that: the will. In other words, the ability to pick a path from a sea of endless possibilities and commit to it. An agent doesn\u0026rsquo;t have a will. Everything it does can ultimately be traced back to human will.\nPicking a path, exploring it, and committing to it takes effort. You have a limited number of shots every day. This is the new bottleneck.\nWith AI, you can certainly explore more paths, but you have to continuously decide which ones to drop and which ones to pursue. This is exhilarating at first, but eventually leads to burnout and exhaustion. Your attention is still limited, and your will decides where to focus it.\nAnd this is a lesson Steve Jobs allegedly understood. He only kept the same clothes in his closet because he didn\u0026rsquo;t want to waste energy deciding what to wear.\nToday, you\u0026rsquo;re in his shoes. Think about it: we\u0026rsquo;re facing the same challenge as the CEO of a trillion-dollar company.\nPeople who lead companies have, by necessity, been trained to deal with this exact problem.\nIn Japan, when I go to a sushi restaurant, I ask for \u0026ldquo;omakase.\u0026rdquo; This means I let the chef decide which sushi I should eat. As a result, not only do I rely on his experience to choose what\u0026rsquo;s best, but I also save energy, allowing me to focus my attention on what matters more to me.\nAnd for Mike, the problem is the same. Mike wants to focus on his business, and choosing BTCPay Server rather than building his own solution is a way to redirect his attention to where he can best serve his customers.\nBy running BTCPay Server, he relies on countless decisions made by its contributors, some of which matter to him and some of which don\u0026rsquo;t.\nIf it matches 90% of his needs, he can fill the remaining 10% with a plugin.\nEverybody using BTCPay Server, and by extension their agents, builds on a shared, precisely defined conceptual model of payment processing.\nEverybody building on top of those concepts reinforces a shared understanding that future agents can build upon.\nIn other words, would Mike be better served by a custom, vibe-coded payment processor built from scratch? Potentially. But his business isn\u0026rsquo;t limited to payment processing, and his customers would be better served if Mike focused his attention elsewhere.\nAnd this is why, there is still a purpose.\n","permalink":"https://blog.nicolas-dorier.com/posts/does-btcpay-server-still-serve-a-purpose/","tags":[],"title":"Does BTCPay Server Still Serve a Purpose?"},{"categories":[],"content":"Introduction The loose use of the term custody is, in my opinion, very dangerous. If you strongly value the freedom Bitcoin provides, you should fight to preserve its meaning. Broadening its definition risks inviting regulations that could eventually ban non-custodial solutions.\nWe’ve seen this pattern before: first, a law targeting terrorists, then a gradual expansion of the definition until, one day, someone saying something offensive online is labeled a terrorist under the new terms.\nInterestingly, this push to broaden the definition of custody isn’t even coming from regulators—it’s being driven by overly zealous protocols attempting to define what a Layer 2 solution is, hoping to associate themselves with the success of the Lightning Network.\nSo, here it is: a strict, uncompromising definition of custody.\nThe definition Imagine going to a shopping mall. It\u0026rsquo;s your wife\u0026rsquo;s birthday, and she wants to buy a new bag. You decide to pay, you take your wallet from your pocket then hands out the cash to the cashier.\nIn this case, it’s obvious that no one would claim your wife is a custodian. Why? Because you CAN still use your wallet without needing her permission.\nNow, consider a different scenario: You don’t want to carry your wallet, so you hand it to your wife, who puts it in her bag. Later, you pass by a store and see a bottle of wine you’d like for tonight. You ask your wife for the wallet and then use it to pay the cashier.\nHere, your wife is undeniably a custodian. You CAN\u0026rsquo;T use your wallet without first asking her. The fact that she might always agree to give it back is irrelevant. The key point is that you CAN\u0026rsquo;T spend without her consent. This lack of independent control means there is no unilateral exit, as Bitcoiners would put it.\nAs Calle wrote:\nEither you have unilateral exit to the chain or it\u0026rsquo;s custodial, sometimes a sugar-coated version of it.\nUnilateral exit implies non-custody. Non-custody implies unilateral exit. Those are synonyms.\nThose who use the term Layer 2 to include custodial solutions are essentially implying that your Kraken account is also a Layer 2. This dilutes the term to the point of rendering it meaningless, much like the term blockchain, which became a red flag after being misused and overhyped by shitcoiners for years.\nThere is no such thing as semi-custody.\nThere is no ambiguity Lightcoin replied to Calle:\nwhat do you call a statechain, which has unilateral exit and the operator can collude with a prior key holder to steal?\nTo which Calle answered:\nNon-custodial. Similarly LN force close with mempool pinning attack or bad fee spike etc. My pedantic definition includes an \u0026ldquo;almost always\u0026rdquo; for unilateral exit.\nI strongly disagree with this response. While the conclusion is correct, the reasoning is not and would lead to a diluted meaning of custody.\nWe need to address the two points separately:\nProtocols allowing third-party collusion to steal funds Protocols that may fail under external circumstances (high fee spike, pinning attacks) About third party collusions What about protocols like Statechains or even Ark? Are they really non-custodial if collusion might lead to the theft of funds?\nThe answer is an uncompromising YES.\nLet’s consider a real-world analogy: You know that Netflix can raise its subscription price without asking your permission. Every month, you continue paying unless you cancel. They don’t need your consent to withdraw funds once you’ve subscribed.\nWould anyone claim that Netflix is a custodian because it has the ability to charge your account? Is there a unilateral exit? No, there isn’t. Of course, you can ask Netflix to stop charging your account or instruct your bank to block payments, but you CAN\u0026rsquo;T stop it without asking someone.\nIf there is no unilateral exit, by our definition, there must be a custodian. The subscription involves three parties: you, your bank, and Netflix. There’s no unilateral exit because custody exists, and the custodian is your bank.\nOnce again: When there is no unilateral exit, there is custody. If there is custody, there is no unilateral exit.\nNow back to Bitcoin. If a protocol like Statechains or Ark allows theft through collusion as part of its security model, does that imply custody? No, because unlike the Netflix example above, there is a unilateral exit. Therefore, there cannot be a custodian.\nAbout external circumstances Unilateral exit might become impossible due to factors like:\nServer downtime Network congestion High fees Attacks (e.g., mempool pinning) Accidental key loss (e.g., your cat erasing keys) Let’s revisit the shopping mall analogy:\nYou have your wallet in your bag and decide to store the bag in a locker at the mall, keeping the key. Later, you try to pay at a shop but realize your wallet is in the locker—and worse, you\u0026rsquo;ve lost the key.\nAt this moment, the coin locker owner effectively becomes a custodian. You now depend on them to grant you access to your wallet. Without their help, you cannot retrieve your funds. Regardless of the security protocols in place, this situation is functionally no different from relying on a bank’s vault.\nThe loss of unilateral access transforms the relationship. Custody now exists because you no longer have the ability to act independently.\nFundamentally, non-custody means the user retains full sovereignty over their funds. This inherently includes the ability to transfer or lose that sovereignty, whether voluntarily or not. Even mechanisms like covenants cannot entirely prevent this, as sovereignty implies ultimate control, including the choice (or mistake) to relinquish it.\nBack to Bitcoin: While a protocol may be non-custodial, circumstances can still reintroduce custody. This stems from the very nature of ownership.\nThe only thing we can objectively evaluate is whether the protocol itself is non-custodial. As we’ve established, so long as a unilateral exit exists, the protocol is non-custodial. External circumstances should not factor into this determination, as ownership is always alienable by definition.\nAs a libertarian would argue, the only truly inalienable ownership is over your body and will, but I disgress.\nCustodial implementations As we’ve seen, it isn’t possible to prevent the use of a non-custodial protocol in a custodial way, due to the very nature of ownership.\nAn interesting argument compares a custodial implementation (Wallet of Satoshi) to a non-custodial one (Phoenix). The claim is that, in both cases, if the servers behind Phoenix or Wallet of Satoshi disappear, the funds become unspendable. Thus, Phoenix is argued to be as custodial as Wallet of Satoshi, even though it stores keys locally on your device rather than on a server.\nIt might be tempting to counter this argument by pointing out that Phoenix allows you to back up the seed or channels. However, I believe this is the wrong approach. If Phoenix were the only implementation capable of interpreting those backups, and it became inaccessible, users would still be unable to recover their funds.\nThe correct argument lies in the possibility of a unilateral exit, even if the servers go down. Even if Phoenix didn’t provide an export option for backups, as long as all necessary data remains on the user’s phone, it is still POSSIBLE to achieve a unilateral exit. This distinction is critical, and it’s why I’ve emphasized the word CAN in earlier examples.\nThe capacity for unilateral exit is what defines non-custody. Whether the user has the technical knowledge to execute it is irrelevant—what matters is that they can, or that someone else could assist them in doing so.\nConclusion I hope I’ve successfully made the case for a strict and uncompromising definition of custody.\nWith this article, I hope to encourage you to confidently call out anyone misusing terms like custody or Layer 2. Attacks on language often pave the way for broader confusion or manipulation, so it is crucial to stand your ground and defend clarity.\nBeing aware of the security model of these protocols is still important because, as we\u0026rsquo;ve discussed, non-custody doesn’t mean you can\u0026rsquo;t lose control of your funds. However, this is a broader topic, and my focus here was solely on defining custody.\n","permalink":"https://blog.nicolas-dorier.com/posts/custody/","tags":[],"title":"Erosion of the Meaning of Custody"},{"categories":[],"content":"The Enterprise Blockchain era I was involved in Bitcoin during 2016-2017. For those who weren\u0026rsquo;t there or have forgotten, it was a time when every giant corporation wanted to include AI Blockchain in everything they were doing, even when it didn’t make sense.\nShareholders wanted to ride the next wave and wondered whether to sell stocks in \u0026ldquo;boring\u0026rdquo; companies to jump into AI Blockchain. Executives, loaded with stock options or bonuses tied to the stock price, were pressured to include the next cool thing in the company and passed the orders down to managers, who had to do something—anything, really, as long as it involved AI Blockchain.\nThere I was, working proudly in Blockchain (before the term lost its meaning), meeting with managers of financial institutions who suddenly took an interest in what a nerd like me was doing.\nIt was very clear that what excited me (Self-Sovereignty) wasn’t on the agenda of most of those managers, who just needed a narrative to sell to executives. From their perspective, executives decided something was cool, and they were as puzzled as I was about why they should care, but they had to find something to show for it.\nEquipped with a hammer, in search of a nail, it became clear to me that they didn’t really need anything that Blockchain was built for. In an effort to fit a square peg into a round hole, they invented the concept of Enterprise Blockchain, which was actually no different from any ledger system that had existed since Mesopotamian merchants\u0026rsquo; clay tablets or an Oracle database. They decided the Enterprise Blockchain would be controlled by themselves. Every company with its own blockchain! Wow!\nSome companies, like Blockstream, tried to make sense of it by proposing that at least a group of businesses could share the consensus, which might add some logic to the idea of Enterprise Blockchains. While this didn’t interest me, it attempted to restore some reason for using a blockchain in the first place: a way to reach consensus without a central party.\nBut no, most companies didn’t want any of that. They wanted THEIR OWN blockchain\u0026hellip; sigh\u0026hellip;\nHaving your own Blockchain is one thing, having somebody anybody to use and build on it is another. Billions of dollars wasted on Proof of Concepts later, the idea migrated to tokenization on a Blockchain which already had people on it, specifically on Ethereum.\nThe Ethereum Token era What a great idea! No need to maintain an in-house ledger when you can track assets on a blockchain. Sure, you can do the same with an in-house ledger, but then those assets can\u0026rsquo;t be easily exchanged or traded for PEPE coins on ETH, or ride the wave of DApps developed by the crypto community. Fair enough, I’m not a fan of shitcoins, but I can\u0026rsquo;t deny the appeal.\nEthereum\u0026rsquo;s big selling point is that you don\u0026rsquo;t have to be a genius to make a DApp, which led to a Cambrian explosion of ideas. Most of these were terrible, but I won\u0026rsquo;t blame them. This is how evolution works: many ideas will fail, but a few great ones will emerge. In an evolutionary context, quantity often trumps quality—or perhaps it\u0026rsquo;s better to say that quality eventually emerges from quantity. It\u0026rsquo;s because so many people are born every day that we occasionally get a new Einstein.\nEverything would have been great if this Cambrian explosion of bad ideas hadn\u0026rsquo;t had the externality of polluting a data structure shared by all network participants—forever.\nWhile almost nothing truly stuck from all those experiments, I must admit there were some discoveries along the way:\nThe need for exchanging assets on unregulated and non-custodial exchanges is real Issuers want to control the asset without controlling the ledger. Issuers like that they don’t have to build infrastructure for their token themselves. They can just ride along with what DApp developers are doing for free and shift the blame when things inevitably go wrong. With these insights internalized, and with it becoming clear that Bitcoin is the only blockchain with any long-term vision and traction, some decided to take these observations and apply them to Bitcoin.\nThe Bitcoin Token era (version 2.0) While transferring tokens on Bitcoin is a very old idea that was in production before (e.g., Counterparty, Spells of Genesis), it has recently resurfaced. The main difference now is the experience gained from Ethereum between 2017 and today in terms of infrastructure, services, and the social dynamics surrounding this domain.\nThis renewed interest has led to the development of new protocols on top of Bitcoin, such as BRC20 and Taproot Assets. Some members of the Ethereum community became excited to find a new \u0026ldquo;wild west\u0026rdquo; to conquer, armed with the lessons learned on Ethereum but without the same level of competition. They began building infrastructure, services, and communities around these ideas. This effort is on a different level compared to when Counterparty existed, as there are now far more developers in the crypto space than before. Additionally, what works and what doesn’t have been more or less established on Ethereum and can now be re-applied on Bitcoin.\nMeanwhile, there\u0026rsquo;s also an attempt to combine successful experiments on Bitcoin (like Lightning) with successful experiments in tokens, using protocols like Taproot Assets.\nAt the same time, freed from the enterprise blockchain era, some developers were finally able to focus on what really matters: you don’t necessarily need a Blockchain. This realization has led to the emergence of e-cash projects such as Cashu, Fedimint, and Webcash. I believe this is a fundamental observation that might eventually move digital assets out of the realm of blockchains and into bearer assets.\nThe e-cash era Satoshi wanted to create an e-cash that cannot be controlled—hence, the Blockchain. But what if you want an e-cash that can be controlled? In that case, you don’t need a Blockchain.\nThe three key advantages discovered on Ethereum don’t actually require a blockchain. What’s needed is a common protocol, a compatibility layer.\nWith a common protocol: An unregulated and non-custodial exchange can be built. With a common protocol: Issuers can define the rules for the emission and redemption of their tokens. With a common protocol: Issuers don’t need to build the infrastructure and services interacting with their token. They can leverage the work of open-source developers and shift the blame if something goes wrong. (No sarcasm here—this is a genuine need.) These advantages are real, but there are additional benefits:\nCheap transfers: Without a blockchain, there are no spam issues or fees. Great UX: No block confirmations, no congestion. Cambrian explosion of ideas: The protocol is simpler than blockchain, lowering the barrier to entry for exploring new ideas. No externalities: Bad ideas don’t leave any trace on a shared data structure. When you think about it, what you need for digital assets with centralized issuers isn’t a blockchain but a compatibility layer. Such layer seldom emerge from established players, and instead really thrive on Open Source, due to the ease of developing on top of it without permission. (See TCP/IP\u0026rsquo;s history)\nThere are three types of ledger technology with which we track assets: Bearer assets, centralized ledgers, and Blockchains.\nIn our modern life, with the ability to communicate instantly over long distances, bearer assets have taken a backseat to centralized ledgers. E-cash is attempting to bring bearer assets back to the forefront of technological advancement.\nI’m not a prophet, but e-cash protocols seems to be ground zero for a new Cambrian explosion of money experiments, particularly in the domain of Private Money.\nI define Public Money as money that can be used by a wide community of people—examples include fiat money, Bitcoin, and stablecoins.\nPrivate Money, on the other hand, is an asset used in a limited area, for a limited time, by a limited group of people, or for a specific purpose:\nGift cards Loyalty points Gift points Area-limited money Event-limited money (e.g., food tickets at a conference) These areas are easier to navigate from a regulatory perspective and are a natural fit for bearer e-cash, as they typically involve low amounts that wouldn’t be economical to exchange over a blockchain or centralized ledger.\nI believe these types of money have been underserved because they couldn\u0026rsquo;t make use of blockchain as a compatibility layer due to its cost relative to the value exchanged.\nE-Cash isn\u0026rsquo;t Bitcoin, and it doesn\u0026rsquo;t need to be to remain appealing. However, formalizing some basic integration with Bitcoin in the wallet\u0026rsquo;s user experience—such as the ability to easily purchase tokens through Bitcoin to the mint—reinforces Bitcoin\u0026rsquo;s role as the only true global money. Bitcoin uses the blockchain so other money doesn\u0026rsquo;t have to..\n","permalink":"https://blog.nicolas-dorier.com/posts/cashu/","tags":[],"title":"The Rise of E-Cash: Maybe you don't need a Blockchain"},{"categories":[],"content":"Introduction I will start by saying that I believe an innovation has been right in front of our eyes for a long time, and it has been our biggest mistake not to view it in the proper light.\nTechnically, there is nothing new about what I am about to say; the only thing I want to convey in this essay is the importance of looking at what we already know from another perspective that is better suited to contextualizing the innovation within our current economic technology.\nI will start by mentioning that I am not a professional in macroeconomics, finance, or banking. Despite this, I believe the ideas presented are significant enough to merit consideration, as they propose a fundamentally different approach to how we can utilize financial instruments on Lightning Network.\nMy thesis is as follows:\nToday, there are no barriers to prevent the creation of:\nAn untrusted Bitcoin-Dollar, a superior form of Eurodollar that makes stablecoins obsolete Untrusted brokering Terminology Dollar in the US The dollar is commonly known as the liability of the Federal Reserve (FED). However, in the US, dollar liabilities from US banks are also considered as dollars.\nPractically, there is no fundamental limit on the amount of dollars that US banks can create. A bank\u0026rsquo;s dollars are created when a loan is undertaken and destroyed when the loan is repaid.\nWhile the FED imposes a fractional limit, this is not currently the limiting factor in loan creation.\nEurodollar Similarly, banks outside of the US can create US dollar liabilities. European banks, thus, create Eurodollars, and Asian banks create Asiandollars. These dollars are liabilities in US dollars held by foreign banks.\nUnlike dollars in the US, they fall outside the jurisdiction of the U.S. Federal Reserve and other U.S. regulatory agencies.\nStablecoin Stablecoins, such as USDT, are quite similar to Eurodollars; stablecoins are liabilities of their issuer, where the issuer is a foreign entity (non-US). The main innovation of stablecoins is how these liabilities are tracked. Rather than using double-entry ledgers, they are represented by an asset that can be transferred via operations on a blockchain.\nIf you are interested, \u0026ldquo;Broken Money\u0026rdquo; by Lyn Alden goes deeper into the different ledger technologies in history.\nStablecoins do not change the concept of the Eurodollar; they are just using a different way to track and transfer them.\nBitcoin Dollar On the other hand, the Lightning Network, or more generally, real Layer 2 layers (defined as protocols that allow unilateral exit from the relationship) enable the creation of a completely new form of US Dollar, free of trust and liability.\nI believe this represents a fundamental monetary innovation which, in hindsight, is obvious but has been overlooked due to an excessive focus on technology. This innovation is potentially even more fundamental than stablecoins.\nWhile stablecoins only innovate on how the liabilities are tracked, the Bitcoin Dollar has no liability.\nI believe this could make stablecoins obsolete. (Disclaimer: Our project, BTCPay Server, is proudly sponsored by Tether; this is not personal, we still love you!)\nWhile I am discussing Bitcoin Dollar here, there is nothing specific to the dollar. The same principles can work with any asset, and I will address this subject later in this essay.\nThe rest of this piece will explore the economic mechanisms for this innovation, but will leave the specific technical methods aside.\nStructure First, we will explore the concrete stability mechanisms of USD peg via Lightning and generalize it to the peg of a portfolio, potentially with derivatives.\nThen, we will examine the stability mechanisms involved in incoming and outgoing payments.\nThis will be followed by a short section highlighting the risks and limitations of our approach.\nWe will then conclude by enumerating the different costs involved for the entity providing such a peg service (also called the peg provider).\nStability Mechanisms This part focus on the detailed mechanism in how Alice, who doesn\u0026rsquo;t necessarily want Bitcoin asset, interact with Bob to peg her channel\u0026rsquo;s balance worth to one or, or a portfolio of several assets.\nWhile this part focus on only two individuals, we will explore in the later section, how this can enable cross currency payment between two nodes on the Lightning Network.\nFeel free to skip to the next section if you wish to skip over the calculations.\nDollar peg on Lightning Let\u0026rsquo;s imagine a merchant, Alice, wants to be able to receive Bitcoin payments that are pegged to the dollar. This merchant is connected to a Lightning Service Provider (LSP), Bob, providing such a service.\nLet\u0026rsquo;s assume the two Lightning nodes are connected by a channel and consider A[BTC] and B[BTC], which keep track of the expected Lightning balance state between Alice and Bob, respectively.\nA[BTC] B[BTC] 0.5 0.5 The expected balance may differ from the actual balance on the Lightning channel. The difference between them is referred to as unsettled funds.\nThe price is $100,000 USD per BTC, and Alice announces that she wants to peg her bitcoins to the USD with Bob.\nTheir channel then becomes a peg relation. Alice is a peg consumer, while Bob is the peg provider.\nFrom now on, we will keep track of Alice\u0026rsquo;s virtual balance, $A_v[USD]$.\nA[BTC] $A_v[USD]$ B[BTC] 0.5 50,000 0.5 Now, what we really want is to maintain the following invariant: $$A_V[USD]=A[BTC] * R[USD]$$ If BTC goes to $110,000 USD, then $$ 50,000=A[BTC]*110,000 \\\\ A[BTC]=\\frac{50,000}{110,000}=0.45454545 $$ Then it means that the unsettled funds increased by $0.5 - 0.45454545 = 0.04545455$ in Bob\u0026rsquo;s favor; the expected balances reflect the change.\nThe new state will be\nA[BTC] $A_v[USD]$ B[BTC] 0.45454545 50,000 0.54545455 Unsettled funds can become settled periodically or immediately by simply sending a lightning payment between Alice and Bob to make the actual channel balance match the expected one. (This mechanism is called a Stable Channel)\nPortfolio pegging Now, imagine that Alice wants to balance her Lightning channel\u0026rsquo;s BTC into the following assets, with the corresponding weights:\n$A_w[BTC]$ $A_w[USD]$ $A_w[NVDA]$ 60% 10% 30% And the conversion rates to BTC are as follows (assuming 100 USD/NVDA):\nR[BTC] R[USD] R[NVDA] 1 100,000 1,000 Note that R[NVDA] is NVDA/BTC, so: $R[NVDA] = R[USD] * (\\frac{USD}{NVDA})^{-1}$\nAlice\u0026rsquo;s virtual balance thus becomes $$A_v[X]=R[X]*A_w[X]*A[BTC]$$ This results in the following state:\nA[BTC] $A_v[BTC]$ $A_v[USD]$ $A_v[NVDA]$ B[BTC] 0.5 0.3 5,000 150 0.5 Now, imagine the new rates are:\nR[BTC] R[USD] R[NVDA] 1 100,000 -\u0026gt; 110,000 1000 -\u0026gt;500 Alice\u0026rsquo;s Bitcoin expected channel balance A[BTC] needs to be updated:\n$$A[BTC]=\\sum_X\\frac{A_v[X]}{R[X]}$$ The new virtual balance becomes:\nA[BTC] $A_v[BTC]$ $A_v[USD]$ $A_v[NVDA]$ B[BTC] 0.5 -\u0026gt; 0.64545455 0.3 5,000 150 0.5 -\u0026gt; 0.35454545 The unsettled funds increased by 0.64545455 - 0.5 = 0.14545455 to Alice\u0026rsquo;s favor.\nPortfolio rebalancing The initial portfolio composition is unlikely to remain the same as the rates fluctuate.\nAlice may, or may not, want to preserve this initial portfolio allocation by rebalancing the assets.\nRebalancing a portfolio is an operation that doesn\u0026rsquo;t require any Lightning payments, just an update of the peg relation between Alice and Bob.\nFor example, in our previous example, the rates changed, and thus the composition became:\n$$A_w[X]=\\frac{\\frac{A_v[X]}{R[X]}}{\\sum\\frac{A_v}{R}}$$ $A_w[BTC]$ $A_w[USD]$ $A_w[NVDA]$ 60% -\u0026gt; 46.5% 10% -\u0026gt; 7% 30% -\u0026gt; 46.5% To rebalance and maintain the original composition, we simply need to perform the same operation as we did in the previous section, but with A[BTC]=0.64545455 and the new rates:\n$$A_v[X]=R[X]*A_w[X]*A[BTC]$$ $A_v[BTC]$ $A_v[USD]$ $A_v[NVDA]$ 0.3 -\u0026gt; 0.38727273 5000 -\u0026gt; 7100.00005 150 -\u0026gt; 96.8181825 Derivatives While our example deals with USD and NVDA as assets, nothing prevents the creation of any derivative.\nFor example, we can imagine a BTC2X asset whose rate is\n$$ RATE[BTC2X] = RATE[USD] * 2 $$ In this case, the peg consumer could be exposed to twice the volatility of BTC.\nAdditionally, it is possible to create assets such as bonds, which provide interest payments to the consumer over time.\nPayments Mechanism Receiving payments Now imagine that Alice connects to Bob (LSP), who connects to Carol.\nCarol wants to pay for a burrito to Alice via Lightning. As a reminder, here is the desired portfolio composition of Alice:\n$A_w[BTC]$ $A_w[USD]$ $A_w[NVDA]$ 60% 10% 30% And let\u0026rsquo;s assume the following state\nA[BTC] $A_v[BTC]$ $A_v[USD]$ $A_v[NVDA]$ B[BTC] 0.75 0.3 30,000 150 0.25 And rates\nR[BTC] R[USD] R[NVDA] 1 100,000 1,000 Alice creates an invoice for 10 USD (a Lightning invoice of 10/100,000 BTC) to Carol for the burrito.\nWhen Carol pays the Lightning invoice, as the payment passes through Bob, the new state will need to be updated.\n$$ Value_{btc}=Value/R[Currency] \\\\ A_v[X]+=Value_{btc}*R[X]*A_w[X]$$ New state:\nA[BTC] $A_v[BTC]$ $A_v[USD]$ $A_v[NVDA]$ B[BTC] 0.75 -\u0026gt; 0.7501 0.3 -\u0026gt; 0.30006 30,000 -\u0026gt; 30,001 150 -\u0026gt; 150.03 0.25 -\u0026gt; 0.2499 Sending payments Sending payments involves the same operation as receiving payments:\nAlice first decides on the portfolio composition to use to pay the Bitcoin value to Carol, then the $A_v$ balances are decreased proportionally to the chosen portfolio composition.\nCross-Currency Payments Notice that with this construct in place, it becomes possible for two individuals, Carol and Alice, to transfer funds between themselves, using their own local currencies.\nThe conversion is thus automatically handled by state updates occurring between the LSP and their respective users.\nNothing prevents the LSPs from also having peg relations between themselves, and everything is abstracted away from the perspective of Alice and Carol.\nRisks and limitations Peg relation closure If the peg cannot be maintained, peers must determine whether they need to close the peg relation.\nThe maximum loss for a peer is the difference between the expected balance and the actual balance of the lightning channel (unsettled funds) at the time the peg relation is closed.\nFollowing closure, the assets will cease to be pegged to the value of the consumer\u0026rsquo;s portfolio; the only loss is the unsettled funds.\nHowever, the peg can be re-established inexpensively, and the unsettled funds from the previous peg can be transferred to the new peg relation.\nThe stable channel approach For simplicity, we explained the pegging system through what we call a stable channel, which involves periodic settlements made by sending BTC back and forth between peers engaged in the peg relationship.\nThe risk with this approach is that, since rates always fluctuate, there are always unsettled funds.\nThis is particularly problematic when Alice is not always online, so the differences cannot be settled.\nWe expect that Bob is a well-connected and widely-known entity. As such, one potential solution is for Bob to require a refundable deposit from Alice to protect against this risk. Another solution is for Bob to terminate the peg relation and request that Alice pay for the difference when they establish a new peg relation.\nWhen the difference in unsettled funds becomes too high, either Alice or Bob may choose to unilaterally terminate the peg.\nBreaking a peg relation does not require closing the channel, so re-establishing a peg is a cost-effective operation.\nThe stable channel approach also suffers from assets that fluctuate significantly over time. For example, an asset representing a bet on a football match will fluctuate too dramatically if a goal is scored, resulting in a significant, sudden and excessive rise in unsettled funds before the peg can be broken.\nAs such, stable channels are not suitable for betting or over-leveraging.\nFree options A malicious actor might exploit unsettled funds as a free option by intentionally breaking the peg when it benefits them.\nHere are some ideas to mitigate this risk:\nImplement a fee for setting up a peg relation. Implement a captcha for setting up a peg relation. Prevent re-establishment of a peg relation by blacklisting the channel, thus requiring the actor to incur costs to open a new channel. In the context of an LSP serving a local community where users are not fully anonymous, ban offending users. Discreet Log Contracts over Lightning approach (DLCs) Discreet Log Contracts over Lightning might remove the need to send BTC back and forth to settle differences.\nThis would potentially allow Alice to stay offline longer without risking the peg relation breaking.\nHowever, we are not sure at the moment if it would allow Alice to easily rebalance her portfolio as described before.\nOn the other hand, unlike stable channels, DLCs do not suffer from assets fluctuating strongly in price. It isn\u0026rsquo;t possible for a malicious party to take advantage of a sudden change in the price of an asset.\nMore input on this matter is needed to reach a conclusion.\nPrice Oracle issue To maintain the peg, a reliable asset price feed is necessary, which brings up concerns about oracle risks. The DLC approach is more susceptible to these issues compared to the stable channel approach.\nIn stable channel setups, the parties don’t need to agree on or share the same price sources. Therefore, a party can independently choose to gather prices from multiple sources, filter fluctuations, and aggregate them.\nThe crucial aspect is that the price sources remain relatively aligned. If they diverge significantly, the only consequence is the breakdown of the peg relationship.\nLack of funds If the channel capacity becomes too low to cover the consumer\u0026rsquo;s assets, the peg can no longer be assured, and the peg relation will break.\nA way to avoid this scenario is for Alice to send bitcoins periodically to an exchange, thus rebalancing the channel and allowing the relation to continue.\nCost model Advanced cost The costs enumerated in the following section may be impossible for Alice to pay if she lacks sufficient Bitcoin in her lightning channel.\nAdvanced costs are costs advanced by Bob that need to be recouped in the future.\nThese costs can be reflected by a negative expected balance (A[BTC]) from Alice.\nCapital cost We expect Alice to not have any balance when the lightning channel is created, so Bob needs to provide lightning liquidity to Alice.\nSince the money used by Bob for this purpose could have been used for other, more lucrative endeavors, Bob should expect to be compensated for this loss of opportunity.\nWhile it would be theoretically possible for Alice to settle with Bob every second for the time value of his money, it wouldn\u0026rsquo;t provide a great user experience: Alice would see her assets being depleted slowly in near real-time in imperceptible increments.\nInstead, we propose a monthly compounding plan with interest settled monthly by updating the state.\nThe process would be as follows:\nFirst, Bob selects a target APY, say 2%.\nConvert this APY into an APR compounded monthly: $$ APY=(1+\\frac{APR}{p})^p - 1 \\\\ APR=((APY+1)^{1/p} - 1)*p \\\\ APR=((2\\% + 1)^{1/12} - 1)* 12=1.98\\% $$ Calculate the average BTC balance on Bob\u0026rsquo;s side over this period and charge the APR over it.\nFor example:\n1 to 10 11 to 15 16 - 20 21 - 30 0.7 0.3 0.4 0.45 First, calculate the average balance: $$ AverageBalance=\\frac{10 * 0.7 + 5 * 0.3 + 5 * 0.4 + 10 * 0.45}{30}=0.5 $$ Then the interest for the number of days in the month: $$ Interest=AverageBalance * Rate * \\frac{30}{365}=0.5 * 2\\% * \\frac{30}{365}=0.00082192 $$ In this example, Alice will owe 0.00082192 BTC to Bob at the end of the month.\nNote that the balance on Bob\u0026rsquo;s side changes with every transfer, so it may be better to have a granularity down to the second rather than daily.\nAlso, keep in mind that BTC shouldn\u0026rsquo;t have the same cost of capital as USD. While USD can be invested in T-Bills, with the T-Bill rate representing the cost of capital, BTC appreciates due to the lack of monetary inflation. As such, the cost of capital should be lower.\nHedging cost When Alice wants to peg her balance to USD, Bob ends up with a leveraged position in BTC.\nIf Bob is also a peg consumer to Olivia, he can rebalance his portfolio to have more USD, effectively shifting the risk to Olivia. If Bob can\u0026rsquo;t shift the risk to somebody else or needs to pay for it, he should be able to charge Alice to compensate. In the second case, Bob could borrow USD and charge Alice the interest rates for it. Alternatively, Bob could borrow USD, invest in T-Bills, and charge Alice only the difference between the yield and the interest rate.\nThis domain is quite complex, and we are not professionals, so please take these suggestions with a grain of salt.\nService cost This is the cost of operating the service. It may be a one-time cost charged during channel setup or periodic like the cost of capital.\nWhile this cost could be hidden in the channel cost and the cost of capital, it may be preferable to state it separately for better clarity.\nChannel setup cost Opening a channel incurs a cost for Bob. This cost could be settled out of band or as part of the advanced cost.\nConclusion My hope with this essay is to convince you that there is untapped potential for a new kind of asset management without custody.\nThis is made possible thanks to the high latency of settlement provided by Lightning.\nThis has the potential to allow anybody to become a de facto broker and provide any derivative without having to assume custody of funds, while severely limiting the potential loss of the consumer.\nWhile intermittent connection may pose a problem for Alice by breaking the peg, I do not believe this is a significant issue, as re-establishing it is a cheap operation.\n","permalink":"https://blog.nicolas-dorier.com/posts/bitcoin-dollar/","tags":[],"title":"Bitcoin Dollar"},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/manifest.json","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.de/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.es/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.fr/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.hi/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.jp/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.nl/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.pl/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.ru/","tags":[],"title":""},{"categories":[],"content":"","permalink":"https://blog.nicolas-dorier.com/search/_index.zh-cn/","tags":[],"title":""}]