For the Rustaceans out there: https://youtu.be/cE0wfjsybIQ

TIDEFI Techdive

A 10.000-Foot view of what we are building

Daniel Thompson-Yvetot
5 min readMay 6, 2022

--

Introduction

Most projects in the blockchain space primarily leverage browsers, browser extensions, and the node.js ecosystem to make their networks accessible to the wider public. While there are agile benefits to using such well-known programming approaches, there are many risks associated with browsers and typical javascript design patterns. For Tidefi we decided to take a more grown-up approach, and this article introduces the services and applications we have built and the building blocks that got us here.

Open Source

First and foremost, we are open source champions. Members of our team have not only built the highly popular Rust-based Tauri Apps framework, but also designed and built the Stronghold secret management library. We are regular contributors to many ecosystems and only consume well-built and maintained 3rd party libraries that are open source. If we discover that a critical piece of common infrastructure is unmaintained, we will adopt it and take over its maintenance. Over the next few months we will be releasing many of the pieces of our puzzle as open-source libraries — in the hope that others may find them useful.

Programming Languages

While many professional software engineers may have preferences for one language or another that are based upon experience or 3rd-party library availability, we chose languages appropriate to the respective features and constraints of the services and applications. When we need better memory-safety and systems-level performance, we have chosen Rust. Some services (like our blockchain and user application) are already built on Rust, so it is an obvious choice. We chose Elixir when we require raw performance, scalability, and time-tested resilience (like in our matching engine). In the few circumstances where we need to do something in a webcontext, we have chosen Typescript because it offers stronger type-guarantees than normal Javascript. In order to interface with the Ethereum blockchain, we have written our smart contracts in Solidity, obviously.

Security

Secure software is in our DNA. This doesn’t end with choosing an appropriate language and design, but also influences the way in which software engineering is managed. Not only do we regularly review emerging threats within the rust and js ecosystems with automation, but we also engage third party pentesters and security auditors to give us better confidence in all parts of our software. We use strong cryptography and best-in-class design patterns — because with security there are no viable shortcuts. To top it off, our data-center has ISO-27001 and IS0 9001:2015 certifications. When we launch mainnet, we will also be opening up bug-bounty programs to engage with the larger infosec community.

Applications

Now that we have introduced our approach to software languages, open-source, and security, we are finally in a place where we can discuss the major applications and services that the TIDEFI ecosystem is built upon.

TIDECHAIN: The source of Truth

Distributed and public resilience that serves as a source of truth is accomplished today with a system commonly known as distributed ledger technology, or a blockchain. We built our “don’t call it a database” upon the open-source Substrate framework, which is a Rust & Wasm based system that has been created and maintained by Parity (the creators of the polkadot network). Not only does this system allow us to make runtime upgrades without forking the chain, it includes a wonderfully extensive system of plugins called pallets that allow us to grow our chain over time as needs evolve.

Quorum: The Warden of Coin

In order to deposit and withdraw native tokens like BTC and ETH to and from TIDEFI, we have built a Rust-based system that we call the Quorum. It is a collection of service nodes that listen to events on other blockchains, and then communicate with each other to agree upon the creation (minting) of wrapped tokens and their allocation to the wallet address that is associated with the deposit. The Quorum uses multisig or smart-contracts (depending upon the underlying technology of the remote chain). These enable the holder of wrapped assets to “convert” these wrapped assets back to their remote chain, effectively burning them from TIDECHAIN and releasing them from the Smart Contract or Multisig wallet. This system uses Stronghold as a means of not only tracking historical events, but also for keeping the private keys in a secure vault.

Oracle: The Matching Engine

In order to provide market matches, the Oracle is a clustered service that pairs makers and takers, and relays “matches” to the TIDECHAIN to perform the swapping of assets at the price points determined by the Market Makers. It has been written in a combination of Elixir and Rust NIFs, in order to provide a massively scalable and fault-tolerant service with really quite breathtaking performance. The Oracle also uses a Stronghold for its signing needs.

Client App: Secure and Beautiful

The Client App is a juggernaut. Since it is the primary means by which people will interact with Tidefi, we have taken special care to make it a beautiful and intuitive user interface. Using the Vue3-based Quasar Framework nestled within a Tauri App that ships with a Stronghold, this app uses a number of fantastic technologies to bring you joy, safely.

Dex Comparator: Saves you a few Clicks

In order to make it clear how the TIDEFI exchange holds up with others in the space, we have created a Cloudflare Worker, which regularly queries the advertised value of currencies at other decentralized exchanges. You can see this on the dashboard of the application.

Build & grow with us

To put this all in perspective: Based on the awesome open-source software mentioned above, some of which we have built ourselves, we have managed to put together a bespoke, secure, and scalable DeFi architecture that we are building out and improving by the day. What’s more, we managed to do so without an ICO or pre-sales. Rather, we are close to releasing our beta and public testnet but are still focused on our approach to build a community-driven and community owned infrastructure from day one and will distribute its ownership broadly to those building and using it. Put simply: We have built something beautiful that you can be part of. You can help shape the future of this financial infrastructure and grow together with us. Sound good?

To learn more, visit our website, follow us on Twitter to stay up to date with what we do, engage with our community on Discord, and stay tuned for the upcoming release of our testnet.

--

--