insights from a blockchain developer, researcher & investor
exploring emerging opportunities in decentralized finance
It has become very normalised to store Ethereum private keys in plain text within .env files. While this is convenient, it’s a disaster waiting to happen when working in production with wallets that contain real funds. Today, I’ll show you a better way to manage your hot wallet keys using AES encryption. Full code for…
For the Balancer v3 Hookathon (yep it’s a hackathon to create DeX hooks) I had the idea to try and create a fair launch memecoin platform. It’s the kind of thing that could bring utility to the ecosystem as we’ve seen recently with the wave of memecoin trading on Solana. The target is to create…
In this tutorial we will be writing some code in Rust, compiling to web assembly (WASM) and then running that code in a browser. This enables high performance applications to be run within a web dev setting. In this tutorial I’ll be using windows subsystem for Linux. Let’s first install Rust and wasm-pack (more instructions…
What Is ABI Encoding Application Binary Interface (ABI) encoding is a crucial concept in Ethereum smart contract development. It serves as a standardised method for encoding function calls and data, enabling seamless communication between different components of the Ethereum ecosystem. ABI encoding ensures that data is consistently formatted and interpreted across various platforms and programming…
Why Host Your Own Flux Model Hosting your own AI model offers significant benefits, particularly for users who demand fine control over image generation, privacy, and customisation. Unlike public cloud-based APIs, which may impose usage limitations or fees, self-hosting gives you full control over how the model operates. You can adjust hardware configurations, implement optimised…
Enums are one of the most useful and underused data types in Solidity. I think because they aren’t widely used in Javascript and web dev, they often get overlooked in contract development. In this article I’ll make my case for why enums deserve a place in your tool kit and smart contracts. Enums in Solidity…
In this article we will take a glimpse into the future of account abstraction where web3 can offer walletless, passwordless authentication to web applications. I’ll be connecting a Stellar Soroban smart contract to a web3 frontend and verifying signatures from biometrics on your phone. Welcome to the future. The full source code used in this…
React Hooks provide a way to manage state, side effects, references and more in functional components. In this tutorial, we’ll look at the seven most commonly used React hooks When You Would Use These React Hooks useStateImagine you have a piece of data in your component that might change, like a number for a counter…
For value investors the goal is to find assets priced below their intrinsic value, providing a margin of safety and potential for significant future growth. Could applying this principle to DeFi help identify underappreciated projects that are gaining significant traction. Let’s find out… Market Cap, TVL & FDV Market capitalization is the total value of…
Last month Vitalik caused a stir when he suggested that DeFi “can’t be the thing that brings crypto to another 10-100x adoption burst” In this article I’m going to share my thoughts on why DeFi is still the no.1 most important use case for Ethereum. Lack of Financial Inclusion In a world where millions remain…
As a developer who wrote his first computer program on a Commodore64, I’ve seen my fair share of technological shifts. But nothing quite compares to the seismic changes I anticipate large language models will bring to software development in the coming years. Let me take you on a journey through my vision of the future,…
Soroban is the smart contract platform that allows developers to write and deploy smart contracts on the Stellar network. This tutorial will guide you through the process of building a simple smart contract using Rust and deploying it to Soroban. I recently took on the role of Developer in Residence with Stellar and this is…
Pump.fun is a token factory that lets users create and trade memecoins on Solana with dynamic pricing along a bonding curve. In this article I’ll show how I went about converting this concept to Solidity and deploying it on Ethereum. Full code for this is open source at: https://github.com/jamesbachini/Pump.sol Token Factory Contract At the core…
Decentralized finance has opened up many possibilities for holders of digital assets. One of the products which has gained traction over the last few years has been over-collateralized lending which is now a $30+ billion dollar industry. In this article I’m going to look at how over-collateralized lending works, why would someone want to do…
In this tutorial I’m going to go through the steps to setting up your own oracle service to bring data on-chain. We are going to be deploying a simple smart contract, then setting up a NodeJS client to fetch the price of Bitcoin, then uploading this to the contract. Full code for this is open…
A simple tool to lint and format JSON because I was fed up of using the ones covered in ads. Format JSON The Javascript code that makes this work is quite simple: It can be used to format outputs prior to displaying the results of API queries or any other JSON found wild around the…
Recent developments in AI image generation have led to the availability of tools which can convert your doodles into generative images. Here is an example run across some freemium web apps: FreePik https://www.freepik.com/pikaso/sketch OpenArt https://openart.ai/create?mode=create NewArc https://www.newarc.ai/ ChatGPT https://chatgpt.com/ WindyBot https://windybot.com/editor Which Is The Best AI Sketch To Image Generator? As of September 2024 I…
In this article I’m going to discuss where I think the industry is going over the next decade and how emerging developments will affect the following: Bitcoin Bitcoin, the pioneer and household name of crypto, has not evolved significantly from its origins as a digital currency. It is becoming increasingly recognized as a mainstream financial…
After reading Chip War by Chris Miller I was intrigued to see what developments have taken place since the book was written and if Moore’s Law is still alive and well. TSMC & Taiwan Strait Taiwan Semiconductor Manufacturing Company has maintained its position as the world’s leading chip manufacturer. The company announced ambitious plans for…
This article explores the strengths, limitations, and potential applications for blockchain technology. I will delve into six primary areas where blockchain technology shows promise: Transparency Blockchains are inherently transparent, making it a powerful tool for enhancing trust, accountability, and security in various applications. This transparency is evident in how transactions are recorded on a publicly…
Deploying Solidity smart contracts can be expensive because the code needs to be stored on the shared storage of a decentralized peer to peer blockchain network. The dollar cost of deploying Solidity smart contracts is dependent on a number of variables: I’ve previously provided code to analyze the bytecode size of contracts, you can also…
In the vast expanse of human thought and philosophical inquiry, few questions are as mind bending and provocative as the simulation hypothesis. This idea, popularized by philosophers and futurists, posits that our reality the world we perceive, interact with, and call home might be nothing more than an incredibly advanced computer simulation. The Simulation Hypothesis…
This was inspired by the CryptoKitties WG0 token vault which accepts gen zero CryptoKitty deposits and mints 1 ERC20 token for each. Users can then buy tokens on exchange and claim NFT’s from the vault. The code is open source and available at: https://github.com/jamesbachini/NFTvault How The NFTvault Contract Works When you deposit your NFTs into…
In this tutorial we are going to create a ponzi game in the form of an ERC20 token that has an internal marketplace function. The idea is to increase the price over time so that early buyers get to dump on late buyers at a higher price. The last buyer will have no liquidity to…
This morning Pavel Durov, founder of Telegram, was arrested at a French airport for refusing to provide backdoor access to the messaging application. This tutorial will demonstrate how to use Elliptic Curve Diffie Hellman (ECDH) cryptography to establish a shared secret and encrypted messaging across a insecure communication channel, in this case a public blockchain.…
Below I have outlined the reasons why I invested my kids college fund into pictures of cats and why CryptoKitties are my highest conviction bet in the NFT space. Historical Significance CryptoKitties hold a unique place in the history of blockchain adoption and NFTs. It was the first time I remember the Ethereum network becoming…
ChatGPT has become an invaluable tool since it’s release in 2022. Here are seven amazing use cases which you can take advantage of today. Language Partner Learning a new language can be challenging, vraiment difficile, but ChatGPT can serve as an invaluable language partner. ChatGPT’s chat feature can be utilized as a voice tutor, it…
I was having trouble with the hardhat bytecode plugin so I wrote a little nodejs script which will print off the size of my compiled Solidity contracts. You’ll need nodejs installed and can then run it like this. You should get an ouput like this: Here’s the code to save to analyze_bytecode.js file in the…
Let’s create a virtual pet in Solidity and deploy it to the blockchain. Full frontend and contract code for this tutorial can be found here: https://github.com/jamesbachini/Solidity-Virtual-Pet Demo here: https://jamesbachini.com/misc/SolidityPet/index.html Smart Contract Our pet is going to have two attributes for hunger and happiness. Hunger should increase over time and happiness should have a mechanism where…
Scraping Twitter/X without direct API access can be accomplished by leveraging third-party services like RapidAPI, which provides a streamlined way to interact with Twitter data. In this tutorial, we’ll walk through the process of using RapidAPI to scrape tweets from a specified user. I’m going to provide code snippets in Python and NodeJS for this…
In this tutorial, we will create a Rust script that: Instructions Rust Code The code is open source and available on Github: https://github.com/jamesbachini/Bitcoin-Fair-Value We’ll start with the async fetch_klines function to fetch Bitcoin price data from the Binance API. The Binance API provides various endpoints for accessing market data, and we’ll use the /api/v3/klines endpoint…
Can AI solve centralization issues for blockchain projects? There’s more hype than ever around “AI on the blockchain” and while this still isn’t a thing I’d like to look at one particular use case in this article. Can machine learning be used to address centralization issues, is it enough to trust a model where true…
I get asked a lot if ChatGPT can be used for trading and I normally say “no, it’s a language model which isn’t designed to find market patterns in numerical price data”. ChatGPT works more like predictive text in a search engine or on your phone but what it is good at is writing code…
The Compound Annual Growth Rate (CAGR) is a useful measure for assessing the mean annual growth rate of an investment or business metric over a specified period longer than one year. Unlike other growth metrics, CAGR smooths out the volatility, providing a clearer picture of how investments grow over time. In this guide, I’ll show…
To check a wallet token balance on the Ethereum blockchain using Python you will need the following: Once we have our API key ready and Python installed we can install web3.py using the following command Now let’s create a file called balance.py and add the following code. Note the code is also available in the…
This post was inspired by @Jake_Pahors post on Twitter which led me down a rabbit hole of thinking about what the world might look like in 10 years time and what investment opportunities might arise from these changes. The first step was to get ChatGPT to check what I was missing using the following prompt.…
Imagine if you could tap into the strategies of top investors and see where the smart money is allocating capital? Welcome to the world of DeFi whale watching, where tracking high net worth wallets can give you the edge and open up new Whale Watching Explained DeFi whale watching involves tracking the investments of “smart…
I first became addicted to eBay a couple of decades ago, over time I started ordering more and more on Amazon, I’ve now found myself ordering more on AliExpress and having items shipped directly from China. During the Euros (soccer tournament) AliExpress was one of the main sponsors which got me thinking that this trend…
What if the world’s most dominant currency, the US dollar, is losing its grip on global power? De-dollarisation is a seismic economic shift that could reshape the global financial landscape as we know it. Imagine a future where the dollar’s influence wanes and emerging currencies, backed by hard assets rise to prominence. This change will…
In this tutorial I’m going to provide some code and show you how to monitor the number of depositors to Eigenlayer over the last 24 hours. We will be using Rust with the Tokio and Ethers libraries along with the Infura API which you can get a free key from here. The first thing we…
We all remember the 2008 financial crisis, a global upheaval sparked in part by complex structured products like collateralised debt obligations. These financial instruments are still widely used in traditional finance to manage risk and enhance returns. But what if we could reimagine these products in DeFi? In this article, we’ll explore how decentralised structured…
In this test we will be comparing the performance of OpenAI’s ChatGPT to Anthropic’s Claude. Both are LLM based AI models designed to offer virtual assistant type services. Update 2024-08-09 I find I’m using Claude more and more for complex coding tasks. It seems to have access to more up to date data and I’m…
Have you ever wondered if decentralised data storage can truly rival the convenience and efficiency of traditional cloud services like AWS? Web3 devs today face several significant challenges. On-chain data is currently slow, expensive, and often comes with a poor user experience. However, with the rapid advancements in technology, the future could look very different.…
To check a wallet token balance on the Ethereum blockchain using Python you will need the following: Once we have our API key ready and Python installed we can install web3.py using the following command Now let’s create a file called enslookup.py and add the following code. Enter your Infura API key on line 5.…
Have you ever wondered how the world of cryptography will evolve in the next two decades? As technology races forward, the landscape of data security is set to undergo dramatic transformations. From quantum resistant algorithms to biometric encryption, the world of cryptography is evolving. Let me take you through the fascinating journey of where we…
Imagine a world where your transactions are dependent on government approval. A central authority has the ability to cut off your right to trade for any reason they see fit. We aren’t far from this already and we’ve things like sanctions and freezing of assets by governments around the world. This primarily targets the banking…
Imagine your everyday Ethereum account could temporarily transform into a powerful smart contract wallet. This is exactly what EIP-7702, a core part of the Pectra upgrade, promises. This new feature will allow normal Ethereum account addresses (EOAs) to act as smart contracts during transactions, only to revert to their original state afterwards. This upgrade has…
In this tutorial we will be building a digital asset portfolio tracking tool using python and the Coinbase API. You’ll need to install python and the following library to make requests. The code for this is open source on Github at: https://github.com/jamesbachini/Python-Portfolio-Tracker Put this in a file called portfolio.py or fork the repo above. Then…
Apple’s WWDC 2024 keynote unveiled Tap to Cash to simplify p2p payments, simply tap one iPhone to another to send money via Apple’s wallet. Why should you care about a minor tech upgrade from Apple? Because this one could be the first step towards a wider change in how we handle personal transactions. Dive in…