August 2024
-
How To Calculate Gas Costs For Solidity Contracts
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…
-
Are We Living In A Simulation?
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…
-
NFT Token Vault Solidity
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…
-
Creating an UpOnly ERC20 Token
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…
-
Solidity Encrypted Messaging dApp
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.…
-
CryptoKitties Investment Thesis
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…
-
7 Incredible Use Cases For ChatGPT
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…
-
Script To Analyze Bytecode Size Of Smart Contracts
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…
-
Solidity Virtual Pet
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…
-
How To Scrape Twitter/X Without API Access
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…
-
Calculating Bitcoin Fair Value With Rust
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…
-
AI Is Not Decentralized
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…
-
Can ChatGPT & Keras Predict The Price Of Bitcoin
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…
-
Calculating CAGR in Python & JavaScript
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…