![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
bitcoin-computer
Advanced tools
UNDER CONSTRUCTION
Bitcoin|Computer is a Javascript library for running smart contracts on Bitcoin. It is
For details check out the Bitcoin|Computer docs.
In an empty directory run npm init -y && npm i -s bitcoin-computer
Create index.mjs
as shown below. Replace the string "replace this seed" with your own seed phrase (eg from your wallet or from here).
import Computer from 'bitcoin-computer'
// the smart contract
class Counter {
constructor() { this.n = 0 }
inc() { this.n += 1 }
}
// run the smart contract
;(async () => {
const computer = new Computer({ seed: 'replace this seed' })
const counter = await computer.new(Counter, [])
await counter.inc()
console.log(counter)
computer.shutdown()
})()
Run the contract using node --experimental-modules index.mjs
. You will get an error message "Insufficient balance in address <your_address>"
Send a small amount of Bitcoin Cash to <your_address>, eg from a Bitcoin Cash Faucet. Run the contract again and if it worked you will see:
Counter {
n: 1,
_owners: [ '028b43c3e12159179c...' ],
_amount: 2000
}
Congrats, you are now one of the first people to ever to run a smart contract on Bitcoin! Now go ahead and change the program above to create your own smart contract.
Create file .babelrc
{
"presets": [ "@babel/preset-env" ],
"plugins": [ [ "@babel/transform-runtime" ] ]
}
Create file index.html
<html>
<body>
<script src="./index.js"></script>
<div id='el'></div>
</body>
</html>
Create file index.js
import Computer from 'bitcoin-computer';
class Counter {
constructor() { this.n = 0 }
inc() { this.n += 1 }
}
; (async () => {
const computer = new Computer({
seed: 'replace this seed'
})
const counter = await computer.new(Counter, [])
document.getElementById("el").innerHTML = `Counter is ${counter.n}`;
await counter.inc()
document.getElementById("el").innerHTML = `Counter is ${counter.n}`;
computer.shutdown()
})()
Run the following in an empty directory
npm init -y
npm i -s bitcoin-computer
npm i -g parcel-bundler
npm i -s @babel/runtime
npm i -d @babel/plugin-transform-runtime
parcel index.html
Open your browser at http://localhost:1234
. See the instructions for how to pick your own seed phrase and how to deal with the error message "Insufficient balance in address <your_address>"
You can find more information in the Bitcoin|Computer Docs
Bitcoin|Computer is in alpha stage, so there will be bugs. If you have any issues, please
FAQs
Lightweight Smart Contracts for Bitcoin and Litecoin
The npm package bitcoin-computer receives a total of 21 weekly downloads. As such, bitcoin-computer popularity was classified as not popular.
We found that bitcoin-computer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.