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
- Can AI Write Secure Smart Contracts? Opportunities, Limitations, and Best Practices - Blockchain Council - June 5th, 2026 [June 5th, 2026]
- Smart contracts in South Africa: Legal recognition, challenges and the future of automated agreements - Polity.org.za - June 5th, 2026 [June 5th, 2026]
- Beyond the Dotted Line: Analysing the Legal and Regulatory Framework of Smart Contracts in India. - Legal Service India - June 5th, 2026 [June 5th, 2026]
- Legal and Compliance Considerations for Smart Contracts: Enforceability, Liability, and On-Chain Governance - Blockchain Council - June 5th, 2026 [June 5th, 2026]
- Smart Contracts for C&C: How ClearFake Hid in Plain Sight on BSC Testnet - TrendMicro - May 27th, 2026 [May 27th, 2026]
- Leading Industry Participants Reinforcing Their Presence in the Smart Contracts Market - openPR.com - May 20th, 2026 [May 20th, 2026]
- Solidity vs Rust for Smart Contracts (Ethereum vs Solana) - Blockchain Council - May 20th, 2026 [May 20th, 2026]
- Smart Contracts Explained: Automating Trust - Blockchain Council - May 20th, 2026 [May 20th, 2026]
- Ethereum leads in smart contracts with diverse uses; XRP targets institutional payments with higher risk-reward. - Pluang - May 20th, 2026 [May 20th, 2026]
- Beyond the Blockchain: Smart Contracts and Advanced Cryptocurrency Uses - Omaha World-Herald - May 7th, 2026 [May 7th, 2026]
- PI Network Price Prediction: Protocol 23 Smart Contracts Arrive in May While PEPETO Presale Secures $9.5 Million - openPR.com - May 7th, 2026 [May 7th, 2026]
- The Intersection of AI and Smart Contracts is Entering a Defining Moment of Chaos - Tekedia - May 7th, 2026 [May 7th, 2026]
- Pi Network News: Protocol 22 Activated as Network Prepares for Smart Contracts on May 11 - Coinpedia - May 7th, 2026 [May 7th, 2026]
- PI remains in red despite the launch of smart contracts on testnet - TradingView - April 25th, 2026 [April 25th, 2026]
- PI remains in red despite the launch of smart contracts on testnet - Invezz - April 25th, 2026 [April 25th, 2026]
- Vaults or NonCustodial Smart Contracts are Pooling Deposits into YieldGenerating Strategies : Analysis - Crowdfund Insider - April 17th, 2026 [April 17th, 2026]
- Lithosphere Advances AI-Native Smart Contracts with Lithic Execution Model - TMX Newsfile - April 17th, 2026 [April 17th, 2026]
- Pi Network Roadmap v21 to v23 Explained: From Stability to Smart Contracts and Full Web3 Utility - MEXC - April 17th, 2026 [April 17th, 2026]
- Pi Network Signals Smart Contracts and DEX With V23 Upgrade - Coinfomania - April 17th, 2026 [April 17th, 2026]
- Pi Network Smart Contracts with Rust and Soroban: How Programmable Finance Is Shaping the Future of Web3 - MEXC - April 12th, 2026 [April 12th, 2026]
- The Future Of DAO Treasury Management: Automation, Smart Contracts, And AI-Driven Allocation - Outlook India - April 10th, 2026 [April 10th, 2026]
- Blockchain for Intellectual Property Protection Market Research Report 2025: Immutable Records, Smart Contracts, and Tokenization, Addressing... - April 10th, 2026 [April 10th, 2026]
- AI + Smart Contracts: Safe Automation with Oversight - Blockchain Council - April 10th, 2026 [April 10th, 2026]
- Polymarket overhauls trading engine, smart contracts to introduce in-house stablecoin - - April 10th, 2026 [April 10th, 2026]
- Smart Contracts, Tokens, and a May Deadline: Pi Networks 2026 Roadmap Is Here - Coinpedia Fintech News - March 26th, 2026 [March 26th, 2026]
- Dogecoin (DOGE) Runs on 22 Developers and Zero Smart Contracts, Analysts Point to AI Trading Protocols - openPR.com - March 26th, 2026 [March 26th, 2026]
- Chicago Bears hand out smart contracts to sign high-impact free agents with limited salary cap space - WKYC - March 11th, 2026 [March 11th, 2026]
- DataVault AI and Wellgistics Health Announce Plans to Expand Partnership to Include Healthcare Delivery Intellectual Property for Healthcare as a... - February 27th, 2026 [February 27th, 2026]
- AI Meets Smart Contracts: The Next Phase Of Automation On The Blockchain - Outlook India - February 27th, 2026 [February 27th, 2026]
- World Liberty Financial: Zero smart contracts were affected. All USD1 funds remain completely safe, secure, and fully backed - marketscreener.com - February 27th, 2026 [February 27th, 2026]
- Interview with Haseeb, Managing Partner at Dragonfly: AI Armageddon Is Still Far Off; Smart Contracts Are Laws Designed for Machines - TechFlow - February 27th, 2026 [February 27th, 2026]
- The Role of Smart Contracts in Future Betting Infrastructure - bitrates.com - February 9th, 2026 [February 9th, 2026]
- Litecoin price prediction for 2040: LitVM smart contracts and halvings target $500 - Traders Union - February 9th, 2026 [February 9th, 2026]
- A Beginners Guide to Smart Contracts in Todays Web3 Economy - Nasscom - February 9th, 2026 [February 9th, 2026]
- Litecoin price prediction for 2027: July halving and LitVM smart contracts eye $150 - Traders Union - February 9th, 2026 [February 9th, 2026]
- What Happens When You Mix Smart Contracts With Artificial Intelligence 01/28/2026 - MediaPost - February 2nd, 2026 [February 2nd, 2026]
- Ethereum Chose Smart Contracts, Solana Chose Speed Why Bitcoin Everlight Is Focusing on Payments - Cryptopolitan - February 2nd, 2026 [February 2nd, 2026]
- Smart Contracts Under the Microscope: What Recent Audits Are Revealing - vocal.media - February 1st, 2026 [February 1st, 2026]
- 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]