<?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: Vadim Volodin</title>
    <description>The latest articles on DEV Community by Vadim Volodin (@polyprogrammist).</description>
    <link>https://dev.to/polyprogrammist</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%2F3713383%2F74875ed2-c669-45c3-b78a-3432fd292b48.jpg</url>
      <title>DEV Community: Vadim Volodin</title>
      <link>https://dev.to/polyprogrammist</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/polyprogrammist"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Vadim Volodin</dc:creator>
      <pubDate>Thu, 15 Jan 2026 21:34:45 +0000</pubDate>
      <link>https://dev.to/polyprogrammist/-g8j</link>
      <guid>https://dev.to/polyprogrammist/-g8j</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/polyprogrammist" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3713383%2F74875ed2-c669-45c3-b78a-3432fd292b48.jpg" alt="polyprogrammist"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/polyprogrammist/integrating-ton-blockchain-into-trust-wallet-a-case-study-2fch" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Integrating TON blockchain into Trust Wallet: a case study&lt;/h2&gt;
      &lt;h3&gt;Vadim Volodin ・ Jan 15&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#blockchain&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opensource&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#software&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cryptocurrency&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>blockchain</category>
      <category>opensource</category>
      <category>software</category>
      <category>cryptocurrency</category>
    </item>
    <item>
      <title>Integrating TON blockchain into Trust Wallet: a case study</title>
      <dc:creator>Vadim Volodin</dc:creator>
      <pubDate>Thu, 15 Jan 2026 20:56:22 +0000</pubDate>
      <link>https://dev.to/polyprogrammist/integrating-ton-blockchain-into-trust-wallet-a-case-study-2fch</link>
      <guid>https://dev.to/polyprogrammist/integrating-ton-blockchain-into-trust-wallet-a-case-study-2fch</guid>
      <description>&lt;p&gt;I had &lt;strong&gt;TON&lt;/strong&gt; cryptocurrency. I had &lt;strong&gt;Trust Wallet&lt;/strong&gt;. But I couldn't use them together — TON simply wasn't supported.&lt;/p&gt;

&lt;p&gt;I could have waited. Instead, I started building.&lt;/p&gt;

&lt;p&gt;A few months later, TON was live in a wallet with 130 million users.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Grant That Almost Fell Through
&lt;/h2&gt;

&lt;p&gt;I noticed that TON Foundation was offering &lt;strong&gt;development grants&lt;/strong&gt;. I applied. Almost immediately, they reached out — we hopped on a call and talked it through.&lt;/p&gt;

&lt;p&gt;At the same time, I messaged a friend who worked at Trust Wallet. Together, we set up a &lt;strong&gt;group chat&lt;/strong&gt;: Wallet Core developers, the TON team, my engineer friend, and me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then things got complicated.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Trust Wallet&lt;/em&gt; has &lt;strong&gt;two parts&lt;/strong&gt;. &lt;em&gt;Wallet Core&lt;/em&gt; is open-source and handles transaction signing. After discussing it in our chat, I realized we could contribute there. But there's a second part — app interaction (fetching balances, broadcasting transactions). That's &lt;strong&gt;closed-source&lt;/strong&gt;. Only Trust Wallet's internal team can build it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And that means:&lt;/strong&gt; management approval, allocated engineering time, accountability. &lt;em&gt;Trust Wallet&lt;/em&gt; can't just say "sure, we'll ship it next month."&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TON Foundation&lt;/em&gt; had doubts: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What if Trust Wallet never adds it to the app? Why fund the grant?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Eventually, both teams &lt;strong&gt;met in the middle&lt;/strong&gt;. TON approved the grant; &lt;em&gt;Trust Wallet&lt;/em&gt; committed to prioritizing the integration. Win-win: a new blockchain and users for Trust Wallet, a new wallet and users for TON.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;We started coding&lt;/strong&gt;. My friend did most of the development — I reviewed and refined. We merged the PR in about a month.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6uc8zjloe2rbfhwsv3o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp6uc8zjloe2rbfhwsv3o.jpg" alt="Integrating TON to Trust Wallet" width="640" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How Trust Wallet Works Under the Hood
&lt;/h2&gt;

&lt;p&gt;Trust Wallet runs on three platforms: Android, iOS, and a browser extension.&lt;/p&gt;

&lt;p&gt;At its core is &lt;strong&gt;Wallet Core&lt;/strong&gt; — an open-source library supporting &lt;strong&gt;over 130 blockchains&lt;/strong&gt;. Written in C++ and Rust. It's not just used by Trust Wallet; other major wallets like Crypto.com rely on it too. The library handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Private key generation&lt;/li&gt;
&lt;li&gt;Address creation and validation&lt;/li&gt;
&lt;li&gt;Transaction signing&lt;/li&gt;
&lt;li&gt;Smart contract interactions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where we added TON.&lt;/p&gt;




&lt;h2&gt;
  
  
  An Unexpected Bonus: Code from Everscale
&lt;/h2&gt;

&lt;p&gt;Few people know the full story.&lt;/p&gt;

&lt;p&gt;Originally, Durov launched TON, with &lt;em&gt;TON Labs&lt;/em&gt; handling part of the development. After US sanctions, Durov stepped away — but &lt;strong&gt;&lt;em&gt;TON Labs&lt;/em&gt;&lt;/strong&gt; didn't. They continued building a fork called &lt;em&gt;Free TON&lt;/em&gt;, which later became Everscale.&lt;/p&gt;

&lt;p&gt;Then a new &lt;strong&gt;&lt;em&gt;TON Foundation&lt;/em&gt;&lt;/strong&gt; emerged, endorsed by Durov. It's now integrated into Telegram and has taken off, becoming a leading TON blockchain.&lt;/p&gt;

&lt;p&gt;Here's the thing: &lt;em&gt;TON Labs&lt;/em&gt; did a lot of impressive technical work. Everscale was already in Wallet Core. We extracted the shared code into a module called &lt;strong&gt;CommonTON&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That code now powers both &lt;em&gt;Everscale&lt;/em&gt; and &lt;em&gt;TON&lt;/em&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Makes TON Unique
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Your Wallet Is a Smart Contract
&lt;/h3&gt;

&lt;p&gt;In TON, a wallet isn't just an address — it's a full-fledged smart contract. Everscale uses the older V3 wallet; for TON, we implemented V4R2.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transaction Structure
&lt;/h3&gt;

&lt;p&gt;In order to create a transaction from wallet, you have to send a message to the wallet smart contract:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;External Message (from user to their contract)
├── header: sender's contract address
├── stateInit: code and data (first transaction only)
└── body:
    ├── signature: Ed25519 signature
    └── signing_message:
        ├── wallet_id, expire_at, seqno
        └── Internal Message (to recipient)
            ├── header: "send Y nanotons to address Z"
            └── body: transfer comment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I won't go too deep here. You can read more about the V4 wallet &lt;a href="https://docs.ton.org/standard/wallets/v4" rel="noopener noreferrer"&gt;in the docs&lt;/a&gt; — including the source code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cells and BOC — A Unique Data Model
&lt;/h3&gt;

&lt;p&gt;All data in TON is represented as a tree of cells (Bag of Cells). Each cell holds up to 1023 bits of data and up to 4 references to other cells.&lt;/p&gt;

&lt;p&gt;Here's how we create a cell with V4R2 wallet data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;Cell&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;Ref&lt;/span&gt; &lt;span class="n"&gt;WalletV4R2&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;createDataCell&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;CellBuilder&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;appendU32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                       &lt;span class="c1"&gt;// sequence_number&lt;/span&gt;
    &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;appendU32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;walletId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;                &lt;span class="c1"&gt;// wallet_id&lt;/span&gt;
    &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;appendRaw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;   &lt;span class="c1"&gt;// public key&lt;/span&gt;
    &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;appendBitZero&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;                   &lt;span class="c1"&gt;// "no plugins" flag&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;intoCell&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Total: 321 bits&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To build a transaction, you assemble these cells correctly: recipient address, amount, comment — all packed into a BOC. Luckily, the BOC serializer was already implemented.&lt;/p&gt;

&lt;h3&gt;
  
  
  Address Formats
&lt;/h3&gt;

&lt;p&gt;Everscale only has raw addresses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;0:4f6bbb5de550f01a5b73792ceca77d8c933ab396a1e300eb0ab5a5f49a430986
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TON also supports a user-friendly format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;EQBPa7td5VDwGltzeSzsp32MkzqzlqHjAOsKtaX0mkMJhq_B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a base64 string that includes address type information and a checksum. The checksum helps catch typos in seed phrases.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Tonkeeper and Trust Wallet Are Incompatible
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Mnemonic Problem
&lt;/h3&gt;

&lt;p&gt;Standards rule the blockchain world. Much of what originated in Bitcoin is still used today. BIP39 (Bitcoin Improvement Proposal) describes how to derive a private key from a seed phrase. The formula: &lt;code&gt;seed = hash(mnemonic + salt)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;By standard, salt = &lt;code&gt;"mnemonic" + password&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In TON, salt = &lt;code&gt;"TON default seed"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The result: &lt;strong&gt;the same seed phrase produces different keys&lt;/strong&gt; in Tonkeeper vs. Trust Wallet. You cannot transfer a wallet between them.&lt;/p&gt;

&lt;p&gt;This isn't unique to TON — the same issue exists with Waves, Qtum, and Polkadot (sr25519).&lt;/p&gt;

&lt;h3&gt;
  
  
  Checksum Validation
&lt;/h3&gt;

&lt;p&gt;Seed phrase checksums protect users from typos — enter a wrong word, and the wallet rejects the phrase instead of generating a wrong address (and losing your funds forever). BIP-39 embeds a &lt;strong&gt;4-bit checksum&lt;/strong&gt; in the last word. TON requires that &lt;strong&gt;hash of the phrase starts with a zero byte&lt;/strong&gt;. These incompatible methods are yet another reason Tonkeeper and Trust Wallet aren't interchangeable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Beyond Wallet Core
&lt;/h3&gt;

&lt;p&gt;In addition to the Wallet Core implementation, we provided Trust Wallet's team with &lt;strong&gt;code examples&lt;/strong&gt;: how to fetch transaction data, query wallet state, and more. Also &lt;strong&gt;consulted&lt;/strong&gt; on app integration questions related to TON. Also added blockchain info and the logo to the &lt;a href="https://github.com/trustwallet/assets" rel="noopener noreferrer"&gt;assets repository&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Result
&lt;/h2&gt;

&lt;p&gt;We connected the TON and Trust Wallet teams. My friend and I built the integration into Wallet Core. Later, Trust Wallet team integrated blockchain into the apps. The code now runs in Trust Wallet across all platforms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;January 2023&lt;/strong&gt; — the PR was merged into Wallet Core.&lt;/p&gt;

&lt;p&gt;Numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;130 million Trust Wallet users gained access to TON&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/ton-society/grants-and-bounties/issues/81" rel="noopener noreferrer"&gt;Grant&lt;/a&gt; for blockchain integration: $4,250&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/ton-society/grants-and-bounties/issues/255" rel="noopener noreferrer"&gt;Grant&lt;/a&gt; for adding Jettons: $4,000&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/trustwallet/wallet-core/pull/2813" rel="noopener noreferrer"&gt;TON in Wallet Core&lt;/a&gt; — main integration&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/trustwallet/wallet-core/pull/3331" rel="noopener noreferrer"&gt;Jettons (TON tokens)&lt;/a&gt; — added later&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A few months later, I added Jettons, then moved on to other projects for TON and NEAR. But that's a story for another time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Occasionally I share notes on development and more on &lt;a href="https://x.com/polyprogrammist" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;I would also like to say thank you to:&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://x.com/hewigovens" rel="noopener noreferrer"&gt;Tao Xu&lt;/a&gt;, &lt;a href="https://x.com/mileriesime" rel="noopener noreferrer"&gt;Sztergbaum Roman&lt;/a&gt;, &lt;a href="https://github.com/optout21" rel="noopener noreferrer"&gt;optout&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/sergey-boyko-0791/" rel="noopener noreferrer"&gt;Sergei&lt;/a&gt;, &lt;a href="https://github.com/vcoolish" rel="noopener noreferrer"&gt;Viacheslav&lt;/a&gt; from Trust Wallet team - for organisation and code review&lt;br&gt;
&lt;a href="https://x.com/playittodeath" rel="noopener noreferrer"&gt;Kirill&lt;/a&gt; from TON Foundation - for helping me manage all of that, &lt;a href="//linkedin.com/in/narek-abovyan-25347418b?originalSubdomain=ae"&gt;Narek&lt;/a&gt; - for tech support from TON, &lt;a href="https://x.com/steveyun_ton" rel="noopener noreferrer"&gt;Steve Yun&lt;/a&gt; - for grant and support&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/vbushev/" rel="noopener noreferrer"&gt;Viacheslav&lt;/a&gt; - for implementing the main integration&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/milosvova/" rel="noopener noreferrer"&gt;Vladimir&lt;/a&gt; from Trust Wallet - for making it possible and for code review&lt;br&gt;
And to everyone, who contributed to this project&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>opensource</category>
      <category>software</category>
      <category>cryptocurrency</category>
    </item>
  </channel>
</rss>
