Back to Blog

Apr 23, 2025

Midl Developers Diary: Part 2

A Deep Dive into BTCFi from the Product Perspective

Midl Developers Diary: Part 2

Hey reader, and welcome back to the Midl Dev series.This is the second chapter of our book: today, we’ll address the issues and challenges of BTCFi and explain how we solved them from a product perspective. You might come across some technical terms, but don’t worry; we made sure it’s still readable for non-tech-savvy folks (otherwise, feel free to use Google for some terms).

This time, we’re going to talk about how we want to enable complex smart contract transactions to be executed natively from Bitcoin. And, of course, that starts with some cryptography.

First PoC: Decoding & Encoding a Solidity tx signed by BTC wallet

Essentially, what we wanted to do, and this was the proof of concept we were developing during the first 1–2 months, was to tweak the signatures we wanted to use.

First, we tried using the ECDSA signature directly from a native Bitcoin wallet. Then, we experimented with SECP256K1 tiny signatures, which also came close to working. However, we ran into some wallet compatibility issues.

Eventually, we started working with the BIP-322 signature, and that’s when things finally clicked.

We successfully managed to decode a transaction that we had encoded using that signature directly from a Bitcoin wallet. We were also able to derive a public address: a Solidity-compatible one from the signature.

This validated our idea from a technical perspective. It showed us that it is possible to support Solidity-based transactions directly from the Bitcoin side.And frankly, dealing with cryptography and signature curve matching is no joke. So, after about a month and a half of wrestling with it, we were pretty happy with the result.

Next steps:

The next step was to actually run these transactions in a secure and decentralized way, which we did eventually achieve. But that story deserves its own chapter in this diary because, well… It was a whole new kind of headache.Our next steps (and the focus of upcoming chapters) included:

  • Running the transactions with decentralized nodes;

  • Refactoring everything to support at least native BTC usage;

  • Figuring out the architecture to run it all;

  • Managing UTXOs;

  • Transitioning UTXOs into an account-based system;

  • Supporting Runes.

We’ll go through each of these steps in detail in future chapters. Hopefully, this was enough to intrigue you. Stay tuned!

Always yours, Midl Dev Team.

Back to Blog