<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shashwat Mittal</title>
    <description>The latest articles on DEV Community by Shashwat Mittal (@shashwatmittal).</description>
    <link>https://dev.to/shashwatmittal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F900107%2F5f7a1c99-067f-4b14-90ef-21c2360c355b.jpg</url>
      <title>DEV Community: Shashwat Mittal</title>
      <link>https://dev.to/shashwatmittal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shashwatmittal"/>
    <language>en</language>
    <item>
      <title>TokenEscrowV1: Fixing MPT Escrow Accounting</title>
      <dc:creator>Shashwat Mittal</dc:creator>
      <pubDate>Wed, 17 Dec 2025 19:09:30 +0000</pubDate>
      <link>https://dev.to/ripplexdev/tokenescrowv1-fixing-mpt-escrow-accounting-5adb</link>
      <guid>https://dev.to/ripplexdev/tokenescrowv1-fixing-mpt-escrow-accounting-5adb</guid>
      <description>&lt;p&gt;Escrow is the backbone of the XRPL’s settlement system, but historically it was limited to XRP only. &lt;/p&gt;

&lt;p&gt;Token Escrow (XLS-85) extends this functionality to any issued token, including IOUs and Multi-Purpose Tokens, enabling time-locked or condition-based delivery of assets. This makes it essential for institutional workflows such as scheduled payouts, conditional settlements, and automated treasury operations.&lt;/p&gt;

&lt;p&gt;During internal testing of the original Token Escrow amendment (which was never enabled on mainnet), a bug was discovered in how escrows involving MPTs with transfer fees were handled. &lt;/p&gt;

&lt;p&gt;The TokenEscrowV1 amendment resolves this issue and restores correct accounting behaviour.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Multi-Purpose Tokens (MPTs) are an XRPL-native token standard that blends fungible and non-fungible properties, allowing assets to have shared traits while carrying rich, asset-specific metadata directly onchain. They’re essential for institutional tokenization because they enable precise asset representation, embedded compliance rules, and full lifecycle management without relying on external smart contracts.&lt;/p&gt;

&lt;p&gt;However, an existing issue was that when an MPT escrow finished and the MPT had a transfer fee, the ledger applied the fee during unlock.&lt;br&gt;
Meaning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you held 100 tokens in escrow,&lt;/li&gt;
&lt;li&gt;And the transfer fee was 1 token,&lt;/li&gt;
&lt;li&gt;The recipient correctly received 99 tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This behaviour was expected.&lt;/p&gt;

&lt;p&gt;The bug was in the issuer’s accounting:&lt;/p&gt;

&lt;p&gt;The ledger incorrectly reduced the issuer’s LockedAmount by only the net amount (99), even though 100 tokens were initially placed into escrow. This left 1 token permanently stuck in the locked state, causing supply inaccuracies and long-term accounting drift.&lt;/p&gt;

&lt;p&gt;In other words: &lt;strong&gt;Instead of decreasing LockedAmount from 100 → 0, the system went from 100 → 1.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Over time, this would have led to various issues, such as changes in the actual supply, ledger inconsistencies, and a lack of trust in the issuer's metrics.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: TokenEscrowV1 Amendment
&lt;/h2&gt;

&lt;p&gt;The fix restores correct behaviour by cleanly separating gross escrow logic from net delivery logic.&lt;/p&gt;

&lt;p&gt;How the fix works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LockedAmount now always decreases by the full escrowed amount (gross).&lt;/strong&gt; For example, if escrow locks 100 tokens, then LockedAmount decreases by 100.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Outstanding supply adjusts only by the net difference (reflecting transfer fees).&lt;/strong&gt; For example, if 100 tokens are escrowed and the recipient receives 99 after fees, then Outstanding decreases by 99, with the 1-token fee handled separately through the issuer’s transfer-fee mechanism.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This solves all preexisting issues, such as ensuring that no tokens become trapped, that total supply remains accurate, LockedAmount returns precisely to its pre-escrow value, and so forth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; escrowed tokens unlock exactly as they were locked, regardless of transfer fees.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validator Voting
&lt;/h2&gt;

&lt;p&gt;The XRP Ledger is governed by validator consensus.&lt;/p&gt;

&lt;p&gt;Because this fix modifies how the ledger processes escrow completions, it must be activated through an amendment vote.&lt;/p&gt;

&lt;p&gt;Validator approval is essential to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure nodes use correct MPT escrow accounting, avoiding supply drift.&lt;/li&gt;
&lt;li&gt;Guarantee consistent balances and ledger behavior across all implementations.&lt;/li&gt;
&lt;li&gt;Give issuers accurate LockedAmount and supply metrics, especially for transfer-fee tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We appreciate the validators’ review and support in enabling TokenEscrowV1, which strengthens the reliability and correctness of MPT-based token flows across the network.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>news</category>
      <category>web3</category>
    </item>
    <item>
      <title>Token Escrow Security Audit Findings</title>
      <dc:creator>Shashwat Mittal</dc:creator>
      <pubDate>Tue, 24 Jun 2025 18:34:08 +0000</pubDate>
      <link>https://dev.to/ripplexdev/token-escrow-security-audit-findings-39hn</link>
      <guid>https://dev.to/ripplexdev/token-escrow-security-audit-findings-39hn</guid>
      <description>&lt;p&gt;Token Escrow is a new feature that expands the XRPL’s native Escrow functionality beyond XRP, allowing users to escrow Trustline-based tokens (IOUs) and Multi-Purpose Tokens (MPTs). To ensure that the feature is ready for production and meets the highest standards, we have engaged the security experts at &lt;a href="https://www.fyeo.io/" rel="noopener noreferrer"&gt;FYEO&lt;/a&gt; to perform a security audit. We are pleased to report that no security issues were identified. There was only one Informational recommendation that our team acknowledged.&lt;/p&gt;

&lt;p&gt;The full, detailed report from FYEO is available for public review here: &lt;a href="https://github.com/fyeo-io/public-audit-reports/blob/main/Code%20Audit%20Reports/2025/Ripple/Ripple%20-%20Security%20Code%20Review%20of%20XRPL%20Token%20Escrow%20v1.0.pdf" rel="noopener noreferrer"&gt;Link&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary of Key Findings
&lt;/h2&gt;

&lt;p&gt;The FYEO team concluded that the code implements the documented functionality of Token Escrow, with one recommendation to be aware of future changes to the codebase that could adversely affect it.&lt;/p&gt;

&lt;p&gt;Their specific recommendation, “Future-Proofing Advisory for Overflow/Underflow in Escrow Balance Adjustments”, means that we should be aware of how the code performs balance calculations. Under the XRPL’s current rules, these calculations are safe because existing ledger protections already prevent account balances from going too high (overflow) or too low (underflow) to cause an issue.&lt;/p&gt;

&lt;p&gt;This is a forward-looking recommendation to add extra, explicit checks that would ensure calculations remain safe even if fundamental ledger rules are changed in the future.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Acknowledgement:&lt;/strong&gt; The security and integrity of XRPL is our highest priority. We have acknowledged FYEO’s recommendation and will proactively monitor for future changes and incorporate additional safeguards as needed. &lt;/p&gt;

</description>
      <category>xrpl</category>
      <category>rwa</category>
      <category>tokenization</category>
      <category>escrow</category>
    </item>
    <item>
      <title>Security Audit for Multi-Purpose Tokens (MPT) on the XRP Ledger Completed with Softstack GmbH</title>
      <dc:creator>Shashwat Mittal</dc:creator>
      <pubDate>Thu, 19 Dec 2024 19:01:55 +0000</pubDate>
      <link>https://dev.to/ripplexdev/security-audit-for-multi-purpose-tokens-mpt-on-the-xrp-ledger-completed-with-softstack-gmbh-1id8</link>
      <guid>https://dev.to/ripplexdev/security-audit-for-multi-purpose-tokens-mpt-on-the-xrp-ledger-completed-with-softstack-gmbh-1id8</guid>
      <description>&lt;p&gt;As new innovations on the &lt;a href="http://xrpl.org" rel="noopener noreferrer"&gt;XRP Ledger&lt;/a&gt; continue to advance, maintaining robust security measures is critical to upholding trust and integrity throughout the ecosystem.&lt;/p&gt;

&lt;p&gt;On October 22, the cybersecurity firm &lt;a href="https://softstack.io/" rel="noopener noreferrer"&gt;Softstack GmbH&lt;/a&gt; completed a comprehensive security audit of the &lt;a href="https://github.com/XRPLF/XRPL-Standards/discussions/231" rel="noopener noreferrer"&gt;Multi-Purpose Token (MPT)&lt;/a&gt; implementation on the XRP Ledger. The focus of this audit was to ensure that the MPT’s design, efficiency, and security assumptions met or exceeded industry standards. The Softstack team evaluated key aspects of the token’s functionality—from storage claims and operational performance to unidirectional trustline security.&lt;/p&gt;

&lt;p&gt;Softstack GmbH’s audit covered five risk levels in relation to MPT functionality: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Critical: A vulnerability that can disrupt the codebase functioning in a number of scenarios, or creates a risk that the codebase may be broken. &lt;/li&gt;
&lt;li&gt;High: A vulnerability that affects the desired outcome when using a codebase, or provides the opportunity to use a codebase in an unintended way.
&lt;/li&gt;
&lt;li&gt;Medium: A vulnerability that could affect the desired outcome of executing the codebase in a specific scenario. &lt;/li&gt;
&lt;li&gt;Low: A vulnerability that does not have a significant impact on possible scenarios for the use of the codebase and is probably subjective. &lt;/li&gt;
&lt;li&gt;Informational: A vulnerability that can have informational character but is not affecting any of the codebase.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Softstack’s findings were highly encouraging. The audit revealed no critical or high-severity vulnerabilities. Instead, the assessment identified only a few low-severity and informational issues, all of which have been fixed or acknowledged. In particular, recommendations were implemented to enhance memory safety in MPT issuer handling, improve locking mechanisms to prevent race conditions, and clarify certain function behaviors.&lt;/p&gt;

&lt;p&gt;"The safety and transparency of blockchain technology are core to Softstack’s mission, and we're pleased to have supported Ripple in advancing the security and performance of the XRP Ledger," said Yannik Heinze, CEO at Softstack.&lt;/p&gt;

&lt;p&gt;Reference material for the reports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/softstack/Smart-Contract-Security-Audits/blob/master/Ripple/Softstack_Ripple_Multi_Purpose_Token%20(MPT)%20Security_Assessment_22102024.pdf" rel="noopener noreferrer"&gt;MPT Security Audit Results&lt;/a&gt; (Softstack GmbH)&lt;/li&gt;
&lt;li&gt;Additional details: &lt;a href="https://softstack.io/" rel="noopener noreferrer"&gt;Softstack.io&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Multi-Purpose Token (MPT) Audit Highlights&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The audit team validated the token’s space and performance claims, confirming that MPT creation, transfer, locking, and destruction functioned as intended without introducing new vulnerabilities. They verified proper adherence to the relevant coding and security standards, ensuring that best practices continue to inform the MPT’s development.&lt;/p&gt;

&lt;p&gt;No significant concerns were raised that would impact the MPT’s readiness for integration with the broader XRPL ecosystem. The resolved issues further reinforce the MPT’s operational integrity, making certain that the MPT implementation remains secure, efficient, and future-proof.&lt;/p&gt;

&lt;p&gt;As with previous security efforts across the XRP Ledger, these steps reinforce the ecosystem’s commitment to rigorous evaluation. Ensuring the long-term reliability and resilience of innovative features, like the MPT, ultimately benefits developers, users, and stakeholders as the XRPL continues to evolve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important Step in Tokenized Future&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Tokenization is at the heart of blockchain’s transformative potential, enabling seamless creation and transfer of value in various industries. As the digital asset economy continues to grow, security and efficiency are non-negotiable. The collaboration with Softstack GmbH ensures that MPT is ready to meet the demands of enterprise-grade tokenization while upholding the XRP Ledger’s trusted reputation.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
