The complete guide to full stack BSV blockchain development – CoinGeek
This post was first published onMedium.
In this guide, youll learn a Web3 tech stack that will allow you to build full stack decentralized apps on the Bitcoin SV blockchain. We will walk through the entire process of building a full stack decentralized Tic-Tac-Toe, including:
By the end, you will have a fully functionalTic-Tac-Toe Apprunning on Bitcoin.
What we will use
Lets go over the main pieces we will be using and how they fit into the stack.
1. sCrypt Framework
sCrypt is a TypeScript framework to develop smart contracts on Bitcoin. It offers a complete tech stack:
2. Yours Wallet
Yours Walletis an open-source digital wallet for BSV and1Sat Ordinalsthat enables access to decentralized applications developed onBitcoin SV. Yours Wallet generates and manages private keys for its users in a non-custodial manner, ensuring that the users have full control over their funds and transactions. These keys can be utilized within the wallet to securely store funds and authorize transactions.
3. React
React.js, often simply referred to as React, is a JavaScript library developed by Facebook. Its primarily used for building user interfaces (UIs) for web applications. It simplifies the process of building dynamic and interactive web applications and continues to be seemingly dominating the front-end space.
What we will Build
We will build a very simple Tic-Tac-Toe game on chain. It uses the Bitcoin addresses of two players (Alice and Bob respectively) to initialize a smart contract. They each bet the same amount and lock it into the contract. The winner takes all bitcoins locked in the contract. If no one wins and there is a draw, the two players can each withdraw half of the money. Tic-Tac-Toe, the age-old game of strategy and skill, has now found its way onto the blockchain thanks to the power of sCrypt.
Prerequisites
Getting Started
Lets simply create a new React project.
Firstly lets create a new React project with TypeScript template.
Then, change the directory to the tic-tac-toe project directory and also run theinitcommand of theCLIto addsCryptsupport in your project.
Tic-tac-toe Contract
Next, lets create a contract atsrc/contracts/tictactoe.ts:
Properties
The Tic-Tac-Toe contract features several essential properties that define its functionality:
Constructor
Upon deployment, the constructor initializes the contract with the public keys of Alice and Bob. Additionally, it sets up an empty game board to kickstart the game play.
Public methods
Each contract must have at least one public@method. It is denoted with thepublicmodifier and does not return any value. It is visible outside the contract and acts as the main method into the contract (likemainin C and Java).
The public method in the contract ismove(), which allows players to make their moves on the board. This method validates the moves, checks the players signature, updates the game state, and determines the outcome of the game.
Signature verification
Once the game contract is deployed, anyone can view and potentially interact with it. We need an authentication mechanism to ensure only the desired player can update the contract if its their turn. This is achieved using digital signatures.
Only the authorized player can make a move during their turn, validated through their respective public key stored in the contract.
Non-Public methods
The contract includes two non-public methods,won()andfull(), responsible for determining whether a player has won the game and if the board is full, leading to a draw.
Tx Builder: buildTxForMove
Bitcoin transaction can have multiple inputs and outputs. We need to build a transaction when calling a contract.
Here, we have implement acustomize transactionbuilder for themove()method as below:
Integrate Front-end (React)
After we have written/tested our contract, we can integrate it with front-end so that users can play our game.
First, lets compile the contract and get the contract artifact json file by running the command below:
You should see an artifact filetictactoe.jsonin theartifactsdirectory. It can be used to initialize a contract at the front end.
Install and Fund Wallet
Before deploying a contract, we need to connect a wallet first. We useYours Wallet, a MetaMask-like wallet.
After installing the wallet, click thesettingsbutton in the upper right corner to switch to testnet. Then copy your wallet address and go to ourfaucetto fund it.
Connect to wallet
We callrequestAuth()to request to connect to the wallet. If the request is approved by the user, we now have full access to the wallet. We can, for example, callgetDefaultPubKey()to get its public key.
Initialize the contract
We have obtained the contract classTictactoe by loading the contract artifact file. When a user clicks thestartbutton, the contract is initialized with the public keys of two playersaliceandbob. The public key can be obtained through callingetDefaultPubKey()ofSigner.
The following code initializes the contract.
Call the contract
Now we can start playing the game. Every move is a call to the contract and triggers a change in the state of the contract.
After finishing with the front-end you can simply run :
You can now view it at `http://localhost:3000/` in your browser.
Conclusion
Congratulations! You have just built your first full stack dApp on Bitcoin. Now you can playtic-tac-toeor build your favorite game on Bitcoin. Now would be a good time to pop some champagne if you havent already :).
One session of play can be viewed here:
All the code can be found atthis github repo.
By default, we deploy the contract on testnet. You can easily change it to mainnet.
Watch: sCrypt Hackathon 2024 (17th March 2024, PM)
New to blockchain? Check out CoinGeeks Blockchain for Beginners section, the ultimate resource guide to learn more about blockchain technology.
More:
The complete guide to full stack BSV blockchain development - CoinGeek
- REVOX joins TOYUSD1 to boost decentralized gaming via smart contracts - MSN - January 20th, 2026 [January 20th, 2026]
- Polygon smart contracts under attack, but the real danger may be just starting! - AMBCrypto - January 18th, 2026 [January 18th, 2026]
- Melento and Forrester reveal how smart contracts drive risk, compliance, and revenue insights - Mediabrief.com - January 18th, 2026 [January 18th, 2026]
- The father of smart contracts: supports X revoking access permissions to InfoFi application APIs; Kaito and other incentive-based content platforms... - January 18th, 2026 [January 18th, 2026]
- HIP-1249: Enhanced smart contracts on Hedera with precise throttling - Hedera - January 16th, 2026 [January 16th, 2026]
- 'Imagination the limit': DeadLock ransomware gang using smart contracts to hide their work - theregister.com - January 16th, 2026 [January 16th, 2026]
- Caixin: Digital RMB smart contracts differ from Ethereum smart contracts and are not built on a blockchain network. - Bitget - January 9th, 2026 [January 9th, 2026]
- Ethereum developer activity hits record high, with 8.7 million smart contracts deployed in Q4 2025 - Bitget - January 9th, 2026 [January 9th, 2026]
- Ethereum Deploys Record 8.7 Million Smart Contracts In Q4 2025, Breaking 2021 High - Yellow.com - January 4th, 2026 [January 4th, 2026]
- Ethereum Smart Contracts Shatter Records: 8.7M Deploy in Q4 - Live Bitcoin News - December 31st, 2025 [December 31st, 2025]
- What Are Smart Contracts? Transforming Digital Industries & Trust - Outlook India - December 31st, 2025 [December 31st, 2025]
- What Are Smart Contracts and How Do They Work? - Blockchain Council - December 27th, 2025 [December 27th, 2025]
- The Mechanics of Smart Contracts: From Conditions to Automatic Execution - vocal.media - December 22nd, 2025 [December 22nd, 2025]
- Understanding Ethereums Role in Creating and Deploying Smart Contracts - aberdeennews.com - December 18th, 2025 [December 18th, 2025]
- Interpreting and vetting smart contracts: utilising blockchain manipulations and crypto currency fraud - Penningtons Manches Cooper - December 10th, 2025 [December 10th, 2025]
- Smart Contracts: Enhancing Security, Trust, and Automation in Modern Digital Platforms - vocal.media - December 5th, 2025 [December 5th, 2025]
- AI has successfully simulated the theft of $4.6 million and has learned to autonomously attack smart contracts. - PANews - December 5th, 2025 [December 5th, 2025]
- AI-Native Smart Contracts Are No Longer TheoryThey Just Became Real - Hackernoon - December 5th, 2025 [December 5th, 2025]
- How Do Smart Contracts Work And Why Are They Critical For Secure Blockchain Systems? - Outlook India - December 5th, 2025 [December 5th, 2025]
- How automation, smart contracts and AI are reshaping property law - lawnews.nz - December 2nd, 2025 [December 2nd, 2025]
- TBC: Revolutionizing Bitcoin With UTXO Smart Contracts and Cross-Chain Innovation - Bitcoin.com News - December 2nd, 2025 [December 2nd, 2025]
- What Are Smart Contracts In Crypto: Uses, Risks, And Benefits - Traders Union - December 2nd, 2025 [December 2nd, 2025]
- Blockchain and Smart Contracts Are Reshaping the Future of Online Casinos in Australia - Australian Manufacturing Forum - November 30th, 2025 [November 30th, 2025]
- DataVault AI licenses smart contracts tech to Wellgistics Health - Investing.com - November 26th, 2025 [November 26th, 2025]
- How Blockchain Security and Smart Contracts Are Helping Reduce Fraud and Increase Trust in Online Casinos - BlockchainReporter - November 23rd, 2025 [November 23rd, 2025]
- Certora Launches the First Safe AI Coding Platform for Smart Contracts By Chainwire - Investing.com - November 23rd, 2025 [November 23rd, 2025]
- AgriFi Democratizes Farming Profits through Tokenized Agriculture and Smart Contracts - StreetInsider - November 11th, 2025 [November 11th, 2025]
- Smart Contracts on Tron vs. Smart Contracts on Ethereum: Which Is the Best Choice? - The Gila Herald - November 11th, 2025 [November 11th, 2025]
- Game Changer For Crypto Smart Contracts - Sovereign Wealth Fund Institute | SWFI - November 11th, 2025 [November 11th, 2025]
- AI & Crypto 2025: Machine Learning, DeFi Innovation, and Smart Contracts with AI - Bitcoinsensus - November 11th, 2025 [November 11th, 2025]
- Klever Blockchain Update: KVM Becomes the New Execution Layer for Smart Contracts - The Defiant - November 3rd, 2025 [November 3rd, 2025]
- Noomez vs Other Presales: The Clear Advantages of $NNZs Audited Smart Contracts and Price Progression - Live Bitcoin News - November 3rd, 2025 [November 3rd, 2025]
- North Korean Hackers Are Using BNB And Ethereum Smart Contracts To 'Bulletproof' Crypto-Stealing Malware, Google Says - Yahoo Finance - October 28th, 2025 [October 28th, 2025]
- How Banks Can Fend Off the Twin Threat of Stablecoins and Smart Contracts to Business Payments - The Financial Brand - October 28th, 2025 [October 28th, 2025]
- Klever Blockchain Update: KVM Becomes the New Execution Layer for Smart Contracts - Brave New Coin - October 28th, 2025 [October 28th, 2025]
- Giggle Academy: Has never issued any tokens or smart contracts - Bitget - October 26th, 2025 [October 26th, 2025]
- AI-powered digital arbitration framework leveraging smart contracts and electronic evidence authentication - Nature - October 24th, 2025 [October 24th, 2025]
- Smart Contracts in Blockchain: What They Are and How They Work - Crypto.com - October 23rd, 2025 [October 23rd, 2025]
- North Korean hackers embedded malware in Ethereum and BNB smart contracts - Invezz - October 23rd, 2025 [October 23rd, 2025]
- Rewriting Blockchain Privacy: The Dawn of Private Smart Contracts with Zero Knowledge Proof - Digital Journal - October 21st, 2025 [October 21st, 2025]
- DPRK and EtherHiding: UNC5342 hides malware in smart contracts on Ethereum and BNB Smart Chain - Bitcoinsensus - October 19th, 2025 [October 19th, 2025]
- Smart Contracts on the Blockchain: What They Are, How They Work, and Examples - Nasscom - October 19th, 2025 [October 19th, 2025]
- What is EtherHiding? Google flags malware with crypto-stealing code in smart contracts - Cointelegraph - October 19th, 2025 [October 19th, 2025]
- UNC5142 Exploits Blockchain Smart Contracts to Distribute Info-Stealing Malware Across Windows and macOS - CXO Digitalpulse - October 19th, 2025 [October 19th, 2025]
- Nexchain Nears Final Integration Phase Before Testnet 2.0 Launch: Backend, Smart Contracts, Airdrop & More - Crypto Economy - October 17th, 2025 [October 17th, 2025]
- Hackers Abuse Blockchain Smart Contracts to Spread Malware via Infected WordPress Sites - The Hacker News - October 17th, 2025 [October 17th, 2025]
- North Korean Hackers Use EtherHiding to Hide Malware Inside Blockchain Smart Contracts - The Hacker News - October 17th, 2025 [October 17th, 2025]
- Introducing Smart Contracts to Federated Learning: How Flock is Reshaping AI Production Relationships? - Bitget - October 17th, 2025 [October 17th, 2025]
- Private Smart Contracts at Scale: Zero Knowledge Proof Is the dApp Platform You'll Wish You Saw Earlier - openPR.com - October 15th, 2025 [October 15th, 2025]
- DHS, CBP award $4.5B in new contracts under OBBB for Smart Wall construction along southwest border - The Gila Herald - October 15th, 2025 [October 15th, 2025]
- Bay Miner Unveils Innovative App with AI and Smart Contracts Driving Daily BTC and XRP Earnings - openPR.com - October 13th, 2025 [October 13th, 2025]
- How Ethereum Smart Contracts Work and Why They Matter - vocal.media - October 11th, 2025 [October 11th, 2025]
- *Ethereum is still the king of smart contracts and crypto tech.* --- Let me know if you want this - Binance - October 9th, 2025 [October 9th, 2025]
- Smart Contracts and the Crypto Economy Safeguarding Your Investments - OneSafe - October 7th, 2025 [October 7th, 2025]
- How is Avalanche Changing the Game with Smart Contracts? - OneSafe - October 7th, 2025 [October 7th, 2025]
- AI and Smart Contracts Drive Bay Miner Cloud Mining App for More Efficient Daily BTC and ETH Earnings - Azat TV - October 7th, 2025 [October 7th, 2025]
- The Avalanche ecosystem is growing rapidly the number of smart contracts has tripled! - Pintu - October 7th, 2025 [October 7th, 2025]
- Blockchain and Smart Contracts: Redefining Transparency in Online Gaming Platforms - Techloy - October 4th, 2025 [October 4th, 2025]
- Smart Contracts Software Market to Reach USD 21.4 billion - openPR.com - October 4th, 2025 [October 4th, 2025]
- Red Wings smart contracts just aged beautifully thanks to Wild - Octopus Thrower - October 2nd, 2025 [October 2nd, 2025]
- How Smart Contracts and Blockchain Transactions Are Revolutionizing Industries: Insights from Machi - OKX - September 28th, 2025 [September 28th, 2025]
- From Surfboards to Smart Contracts: The Relentless Rise of Juan Mari - Block Telegraph - September 23rd, 2025 [September 23rd, 2025]
- Hackers Just Found A Way To Hide Malware In Ethereum Smart Contracts And Your Crypto Wallet Could Be Next - Yahoo Finance - September 17th, 2025 [September 17th, 2025]
- Green Computing Power + Smart Contracts: EARN Mining Mobile Cloud Mining Ensures Sustainable Daily Settlement for BTC and XRP - Nation Thailand - September 13th, 2025 [September 13th, 2025]
- How Are Smart Contracts Transforming Decentralized Autonomous Organizations? - Nasscom - September 9th, 2025 [September 9th, 2025]
- Ethereum Smart Contracts Become Latest Hiding Spot For Malware - Mitrade - September 9th, 2025 [September 9th, 2025]
- Cybercriminals are trolling developers by hiding malware in Ethereum smart contracts - Cybernews - September 6th, 2025 [September 6th, 2025]
- How Hackers Use Ethereum Smart Contracts to Hide Malware in Plain Sight - Cointribune - September 6th, 2025 [September 6th, 2025]
- Malicious npm Packages Exploit Ethereum Smart Contracts to Target Crypto Developers - The Hacker News - September 5th, 2025 [September 5th, 2025]
- Ethereum Smart Contracts Abused to Hide npm Malware - Bitcoinsensus - September 5th, 2025 [September 5th, 2025]
- Hackers Use Ethereum Smart Contracts to Hide Malware in npm Packages - CoinCentral - September 5th, 2025 [September 5th, 2025]
- Hackers find new way to hide malware in Ethereum smart contracts - Cointelegraph - September 5th, 2025 [September 5th, 2025]
- AI, Blockchain, and smart contracts: Why Utah businesses cant afford to wait - Utah Business - September 5th, 2025 [September 5th, 2025]
- A Blockchain Framework Using Proof of Authority and Smart Contracts for Ethical and Secure Healthcare Asset Management - Frontiers - September 5th, 2025 [September 5th, 2025]
- Ethereum (ETH) News: Attackers Are Now Using Ether Smart Contracts to Mask Malware - CoinDesk - September 5th, 2025 [September 5th, 2025]
- News Explorer ReversingLabs Uncovered NPM Packages Using Ethereum Smart Contracts to Disseminate Malware in a GitHub Campaign - Decrypt - September 5th, 2025 [September 5th, 2025]
- Researchers Find Ethereum Smart Contracts Used to Deliver Malware - Crypto Economy - September 5th, 2025 [September 5th, 2025]
- Ethereum News Today: Malware Hiding in Ethereum Smart Contracts Rears Its Head - AInvest - September 5th, 2025 [September 5th, 2025]
- New Way to Hide Hacking Software in Ethereum Smart Contracts - Happy Coin News - September 5th, 2025 [September 5th, 2025]
- Ethereum smart contracts infected with the virus are distributed via NPM and GitHub - ITC.ua - September 5th, 2025 [September 5th, 2025]