Digital assetsSenior Backend Engineerteam: 16 engineersclient: Large US bank, digital assetsDetails anonymized (NDA)

Stablecoin and custody platform

A multi-tenant platform on which a large US bank issues stablecoins and runs custody and treasury operations. I worked on network management and custodian keys.

Feb 2025Mar 2025

96 → 3

networks listed → networks open for transactions

How it was measured

Networks in the platform's network list at the time versus networks marked as implemented. The allowlist I built into both portals lets only implemented networks be switched on.

3

features merged within one week

How it was measured

Pull requests I authored and merged into the main branch: network reports, network management and custodian key rotation.

On this page
  1. 01Context
  2. 02Problem & constraints
  3. 03Architecture
  4. 04Key decisions
  5. 05Results
  6. 06What I'd do differently
  7. 07Stack
01

Context

A multi-tenant platform on which a large US bank issues stablecoins. Each issuer defines a token backed by a weighted basket of reserve assets, deploys it to EVM networks or Solana, and mints and burns it from wallets at an institutional custody provider.

The system is a .NET 8 modular monolith: two admin portals over one REST API, SQL Server, background workers, and adapters for the custody provider, blockchain nodes and FX rates. I joined through Valletta Software during a migration of the core data model.

02

Problem & constraints

  • The data model was being replaced while the system ran: old and new entities lived side by side.
  • The platform listed 96 networks but supported only 3. Admins must not switch on a network the code cannot handle, and issuers may use only what the platform allows.
  • Custody API keys carry signing authority over vaults. A wrong key must not replace a working one.
  • Each tenant sees only its own data: tenant context from the route, soft delete and checks per tenant.
  • Platform-wide changes must be all or nothing.
03

Architecture

Scroll the diagram sideways

fig. 01: Platform and my part. Two portals over one API; network permissions pass from the platform to issuers, and a new custodian key is checked with the provider before it is used.From the admin and issuer portals to Platform API, through typed REST clients. From Platform API to Network allowlist. From Platform API to Custodian key update. From Platform API to SQL Server. From Custodian key update to SQL Server: switch the credential tag. From Custodian key update to Custody provider: check the new key. From Background workers to Custody provider: wallet sync and gas top-upsAdmin portalnetworks · reportsIssuer portaltokens · custodiansPlatform APIhandlers · EF CoreNetwork allowlistimplemented → platform → issuerCustodian key updateverify, then switchBackground workerswallet sync · gasSQL Serverold + new modelCustody providervaults · signingswitch tagcheck key
fig. 01Platform and my part. Two portals over one API; network permissions pass from the platform to issuers, and a new custodian key is checked with the provider before it is used.
04

Key decisions

DR-01

Build on the new data model, not the old one

Context
The team was moving to a new set of entities, and the old ones were due to be removed.
Options considered
A: extend the old network entity with the new flags. This was my first local attempt. B: query the new model and map results into dedicated response models.
Trade-offs
B meant rewriting queries and mappings, plus a temporary workaround for an old foreign key. A would have put schema changes on a model that was about to go.
Outcome
Chose B. The old entities were later removed as planned.
DR-02

Two levels of network permission

Context
A network can be listed, implemented, allowed by the platform and chosen by an issuer. One flag cannot express that.
Options considered
A: a single enabled flag. B: an implemented flag set in code, a platform switch for admins, and issuer selection checked against the platform list.
Trade-offs
B means more states and more UI. In return unsafe combinations are blocked in the API, not only hidden in the UI.
Outcome
Chose B, using the flags of the new model in both portals and in the API. Admins see switches only for implemented networks, and the API rejects an issuer's network the platform has not allowed.
DR-03

Check a new custodian key before switching to it

Context
A custody API key controls signing. A typo or a revoked key would break every operation that follows.
Options considered
A: save the new key and let the first real operation fail. B: store it under a new credential tag, call the provider, and switch the custodian to the new tag only on success.
Trade-offs
B adds a round trip to the provider and depends on it being available, and failed attempts can leave unused credential rows.
Outcome
Chose B. A wrong key is reported to the user, and the working key stays in place.
05

Results

  • Network report pages in both portals on the new model: status per network, deployed tokens and market cap in a chosen currency.
  • A network management page for platform admins, with switches only for implemented networks, and an API that returns DTOs instead of database entities.
  • A network selection page for issuers, checked against the platform's allowlist.
  • Custodian API key update on a teammate's scaffold, checked with the custody provider before the switch.
  • Across the team: stablecoin issuance on EVM networks and Solana through the custody provider, and the move to the new data model.
06

What I'd do differently

  • I would write handler tests before merging. A duplicate-key check of mine sat inside a catch-all, and a teammate fixed it the next day.
  • I would not work around the old foreign key with a placeholder value. I would make the old column nullable in the migration.
  • I would push for custodian secrets to live in a secret store or be encrypted by the application, with only a reference in the main database.
07

Stack

  • C#
  • .NET 8
  • ASP.NET Core MVC
  • Razor
  • SQL Server
  • EF Core
  • Dapper
  • Refit
  • Nethereum
  • Solnet
  • Fireblocks
  • Microsoft Entra ID
  • AWS