2P+
Multi Player
137 subscribers

Bitcoin Script

Opcodes, sCrypt, Forth, anything about bitcoin script.

Rules

Please follow the rules below:
# links may help
- BitcoinSV Wiki: https://wiki.bitcoinsv.io/index.php/Opcodes_used_in_Bitcoin_Script
- sCrypt: https://www.scrypt.io/

If you find other useful links about bitcoin script, please leave a post.
blog
Posts
@xhliu
1 week ago
Token swap contract on BSV by @ccoincash https://zhuanlan.zhihu.com/p/312024053 (in Chinese) Code is at https://gist.github.com/ccoincash/fd2079f36dc5cd098a54f4ca2ef8bc1c#file-tokenswap-scrypt
0
0 USD
@venezia
1 week ago
Bitcoin SV Technical Standards Committee https://tsc.bitcoinassociation.net/
0
0 USD
@venezia
2 weeks ago
"Detecting Cryptocurrency Fraud with Neo4j" ---- Christian Miles https://neo4j.com/blog/detecting-cryptocurrency-fraud-with-neo4j/
0
0 USD
@xhliu
3 weeks ago
To mitigate attacks similar to ElectrumSV Accumulator MultiSig hack, develop Bitcoin smart contracts in high-level languages such as sCrypt, not in raw Bitcoin Script https://xiaohuiliu.medium.com/accumulator-multisig-d5a5a1b5fc42
0
0 USD
@xhliu
3 weeks ago
A binary option contract https://github.com/scrypt-sv/boilerplate/pull/25. For detailed info https://zhuanlan.zhihu.com/p/276215975 in Chinese
0
0 USD
@xhliu
3 weeks ago
https://xiaohuiliu.medium.com/a-step-by-step-guide-to-developing-bitcoin-smart-contracts-e43f00f42f05
0
0.06 USD
@venezia
4 weeks ago
One word to describe the proof of stake.
3
0 USD
@xhliu
1 month ago
rate-limited onchain faucet contract in sCrypt by@edward https://github.com/scrypt-sv/boilerplate/pull/23
1
0 USD
@venezia
1 month ago
SPV Channels: https://github.com/bitcoin-sv-specs/brfc-spvchannels
1
0 USD
@mr_word
1 month ago
We just published an extract from our draft documentation for an overlay UTXO machine which addresses what we see as a critical limitation of UTXO as designed in Bitcoin's native L1. https://github.com/mr-word/manadocs-public/blob/master/for-bsv-devs.md Tagging @xhliu / @joe, because of earlier discussions on OP_PUSH_TX and "no trackback" solutions. @shadders thank you for showing how introspection (OP_PUSH_TX) is currently possible -- we would love to hear what you have to say about our curre
[more]
4
0.91 USD
@venezia
1 month ago
SuperAsset
0
0 USD
@ccoincash
1 month ago
Is there a method to implement a oracle to provide off-chain data?
3
0.12 USD
@xhliu
1 month ago
Now you can write Bitcoin smart contracts in TypeScript, by transpiling it to sCrypt https://github.com/adrianhunter/ts-ts
0
0.08 USD
@xhliu
1 month ago
optimizing OP_PUSH_TX by 700% https://medium.com/@xiaohuiliu/optimal-op-push-tx-ded54990c76f
3
1.56 USD
@xhliu
1 month ago
rate-limited onchain faucet contract (in Chinese) https://blog.csdn.net/Edward_sv/article/details/109119838
0
0 USD
@joe
1 month ago
Is anyone working on creating tokens without backtracking? It would open so many doors if done scalably.
2
0.32 USD
@xhliu
1 month ago
sCrypt文档中文版 https://scryptdoc.readthedocs.io/zh_CN/latest
0
0 USD
@xhliu
2 months ago
How to Scale Ethereum Today? Spoiler alert: it does not involve ETH 2.0 https://medium.com/@xiaohuiliu/how-to-scale-ethereum-today-9bbaece3fb2e
1
0 USD
@xhliu
2 months ago
How to reduce state storage from O(n) to O(log n) using Merkle tree https://medium.com/@xiaohuiliu/scalable-state-storage-in-bsv-smart-contracts-60f9aeb3b1f Basically a follow-up of @zhangweis's article.
0
0.09 USD
@zhangweis
2 months ago
Layer 1 order book contract with Layer 2 token
With the difficulty of the layer 1 token and ways of contract communication, we may need a way to have a layer 1 order book contract which can handle layer2 tokens.
[Read Article]
2
0.4 USD
@zhangweis
2 months ago
Merkle tree proof based data storage
Merkle tree proof based data storage and verification for bitcoin sv script.
[Read Article]
6
1.37 USD
@vicarcalsado
2 months ago
There are a lot more would-be developers out in the woods. A guided educational roadmap similar to this is a MUST for Bitcoin SV to become more widely adapted. https://roadmap.sh/
1
0 USD
@adonsats
2 months ago
can someone point me to this project online ? Greenlight A ‘Tokenized-in-a-box’ solution
1
0 USD
@venezia
2 months ago
USDC on BSV is exciting, can't wait to see more information about it. It can prove to people that only BSV is scalable.
1
0 USD
@adonsats
2 months ago
I am @adonsats and I am with the inventor of...well you already know him. TAKE some time for this. it looks like another Inventor 🤯
0
0.03 USD
@xhliu
2 months ago
Love Script but don’t wanna learn sCrypt. Not a problem. We combine the best of both worlds https://medium.com/@xiaohuiliu/inline-script-inside-scrypt-27d5aa279fd3
2
2.02 USD
@unwriter
2 months ago
Onchain orderbook idea (use the translate button)
0
0.02 USD
@raymond
2 months ago
Hi guys, I don't want to waste anyones time. If someone can give me comprehensive resources to learn how to code on bsv for an absolute beginner to coding ill give a $10 usd tip. I'm also looking for a full time mentor that I would be willing to pay on a negotiated contractual basis. I'm not a great student but this is the only technology I have come across in the sea of shit that is crypto, that would be worth the struggle to learn. All the best to this community regardless of outcome.
6
24.6 USD
@adonsats
2 months ago
question: is there a default altstack in FACTOR ?
0
0 USD
@lamingtons
2 months ago
had an idea for paying people to sort numbers. to spend this you need to provide the indexes of numbers in sorted order. what do you think of this output: 00 00ff11 00ff12 00ff13 00ff18 00ff19 00ff20 00ff14 OP_FROMALTSTACK OP_PICK OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_ADD OP_PICK OP_2DUP OP_LESSTHAN OP_VERIFY OP_SWAP OP_DROP OP_FROMALTSTACK 01 OP_AD
[more]
4
0.09 USD
@xhliu
2 months ago
https://medium.com/@xiaohuiliu/sun-rising-p2sh-7ebfca9283aa
4
0.14 USD
@adonsats
2 months ago
THIS is why Factor and FORTH are a choice for a scientist: listen -->
yeah we can do that now
0
0.53 USD
@venezia
2 months ago
puzzle-on-chain
0
0 USD
@venezia
2 months ago
Now you can use miniforth in browser😆 I hope it can be helpful, such as solving puzzles in this channel.😇
0
10.57 USD
@xhliu
2 months ago
Peer-to-peer tokens, aka, how to validate Layer1-tokens without backtracking (well, almost) https://medium.com/@xiaohuiliu/peer-to-peer-tokens-6508986d9593
1
10.94 USD
@venezia
2 months ago
2
0.53 USD
@venezia
2 months ago
Very cool script debugging tool!
0
0 USD
@slb
2 months ago
Tic-tac-toe on Bitcoin SV https://medium.com/@xiaohuiliu/tic-tac-toe-on-bitcoin-sv-5acdf5bd676d
2
0.02 USD
@covid
2 months ago
From what I understood R-puzzle are an UTXO you can spend if you know a specific value R. How is it different from something like "OP_HASH value" where value is hash(R) ? So you would need to know R to spend that UTXO
2
0.02 USD
@ccoincash
3 months ago
Would anyone share your most complicated script implemented by sCrypt. I want to learn the ability of the sCrypt.
2
0.11 USD
@adonsats
3 months ago
some money here, to fund our channel :) https://powping.com/posts/c2b41538fc2525daf4dc85e4bdf8dfa540f257b946c546409aa8f6bbf1ee2a33
0
0.1 USD
@snugg
3 months ago
Script is great and all, but I can't brain into stack logic. I understand how it works, but it's very unintuitive and takes a long time to parse out, at least for me. sCrypt is a godsend
4
0.02 USD
@venezia
3 months ago
Bitcoin Script provides some Boolean operators. Since the raw script is typeless, we can do some special operations, such as adding and subtracting boolean values. Can you implement OP_BOOLAND and OP_BOOLOR with other OPCODEs ?
4
0.02 USD
@light
3 months ago
1
0.01 USD
@venezia
3 months ago
What is the most impressive smart contract product you have ever seen? CryptoKitty, FOMO3D, Uniswap or any other?
7
0.05 USD
@snugg
3 months ago
Some thinking I previously suffered from, I'm not sure if anyone else fell into this trap. That once you locked away coins in a "contract", that they could only be released once the conditions of that specific contract are met. The solution is simple, and probably obvious to most, add a p2pkh unlock condition on top of the main contract condition, such that you can always close the contract any time you want. In the screenshot, condition1_unlock would be the main contract condition(checks if s
[more]
3
0.49 USD
@dylan
3 months ago
Playing around with scrypt... and have another question that I'm sure is simple. I've written a basic bytewise AND contract (see attached image). My understanding is if I were to put OP_1, and OP_2 as the two inputs to this contract, it would be '0x51 & 0x52' which should be 0x50... but I cannot get the contract to evaluate to true. Am I missing something obvious?
1
0.93 USD
@dylan
3 months ago
I'm looking for some guidance on spending a non-standard script and I think I'm getting confused... Let's say I make a basic locking script that evaluates to TRUE when the unlocking script is OP_10 (basic sum contract for scrypt) and I attach 1 cent of bitcoin to it. Isn't it true to say that anyone can spend this bitcoin as long as they have the scripthash + provide OP_10 as the unlocking script? What tools are there to try this out if I have a scripthash of a nonstandard output?
1
0.01 USD
@venezia
3 months ago
One thing that gave me a headache at first is that all the numbers are little endian. When you get used to it, you don't feel bothered anymore. Similar to other languages, Bitcoin provides these operators to manipulate bits. Can you implement the function of "is_negative" without using any comparison opcodes? It returns false when the input is a positive number, and true when it is a negative number. ("true" can be any value not equal to 0)
5
0.03 USD
@unwriter
3 months ago
Idea: a playground web server that lets people connect and play with MiniForth without having to download. Or is it possible to WebAssembly somehow?
3
0.13 USD
@arbiteroffun
3 months ago
This has been a really helpful video.
1
0.08 USD
@venezia
3 months ago
The Tx preimage is the data we used in signing a bitcoin transaction. Since the BIP143 has been adapted for the replay-protected sighash format in Bitcoin SV, The current composition structure of Tx preimage is as described above. When designing a complex smart contract, we will need to extract data from it. Challenge: Extract the nLocktime number from a Tx preimage by bitcoin opcodes.
4
0.14 USD
@arbiteroffun
3 months ago
Hi guys, I am starting to dip my toes into bsv development, and wanted to make a smart contract. Do you guys have any references to documentation? My initial approach was to write data using moneybutton or datapay and include some bitcoin script in the script attributes of the contract? Does this sound like kosher approach? Below are links i've been reviewing to learn about the topic: * https://wiki.bitcoinsv.io/index.php/Opcodes_used_in_Bitcoin_Script#Examples * https://docs.moneybutton.com/
[more]
3
0.06 USD
@baobui
3 months ago
Hi guys, Do you know a setup that can run a simple "hello world" Bitcoin Script? Thanks,
2
0.02 USD
@venezia
3 months ago
Like most other commonly used languages, we can implement very complex logic using control flow operators in Bitcoin Script. Can you use Bitcoin Script implement the classic foobar function? It inputs a number, and if the number is divisible by 3, returns "foo". If it is divisible by 5, returns "bar". If it can be divisible by 3 and 5, it returns "foobar". (Just keep the string as it is, no need to use hex bytes.)
6
0.07 USD
@hv_
3 months ago
https://news.efinancialcareers.com/us-en/3004315/should-you-become-a-bitcoin-script-engineer
0
0.11 USD
@adonsats
3 months ago
I WOULD LIKE TO HAVE THIS TALK IN FULL CODE: https://medium.com/@Stas33496115/bitcoin-script-engineering-part-iii-8307d495bc52 hallo? someone ?
1
0.02 USD
@venezia
3 months ago
Happy weekend everyone! This channel is growing so fast! Hope you can find some fun from here. We can use Bitcoin scripts to manipulate data in bytes. OP_CAT is used to connect data. OP_SPLIT is used to split data. Challenge: Can you use OPCODEs to change the string "abc" to "ABC"?
3
1.03 USD
@ben
3 months ago
https://medium.com/@Stas33496115/bitcoin-script-engineering-part-iv-423b73d10e60
2
0.31 USD
@krambo
3 months ago
I bookmarked this some time ago and thought it may be worth sharing here as a helpful resource. This is not my work and I believe it has evolved into sCrypt at this point but perhaps someone can find it useful. https://github.com/xhliu/bitcoincash-dev/blob/master/README.md#scripts
1
0.26 USD
@adonsats
3 months ago
https://powping.com/posts/d0e9b3c48ae6e873883467ce4276825bc842bba13d36f9c6af7138a6bcc42cd8 this is why I asked for OP_DATACHECKSIG we are all talk... no real token solution. Do we need a special channel for token in bsv? is it not here that we could put an end to this situation ?
1
0.01 USD
@adonsats
3 months ago
@elas_digital @shadders @unwriter @all OP_CHECKDATASIG : How can we implement it in bitcoin script? Is there already a robust script for that ?
4
0.01 USD
@venezia
3 months ago
Imagine there is a conveyor belt. Whenever it rotates, the leftmost element will move to the rightmost. Can you implement a new opcode "OP_-ROT", which works as the inverse operation of OP_ROT?
4
0.05 USD
@adonsats
3 months ago
According to you: what would a Bitcoin engineer's salary be ?
3
0.02 USD
@venezia
3 months ago
The function of OP_SWAP is to exchange the positions of the top two elements of the stack. The function of OP_2SWAP is almost the same as that, except that it uses a pair of elements as the unit. Challenge: Can you implement OP_2SWAP without using OP_PICK or OP_ROLL?
2
0.13 USD
@venezia
3 months ago
DUP family is coming! Can you implement 2DUP and 3DUP with other opcodes?
2
0.57 USD
@venezia
3 months ago
Can you use any two OPcodes to implement OP_LESSTHAN? There is more than one way :D
1
0.01 USD
@venezia
3 months ago
Do you know other ways to push a number onto the stack?
3
0.02 USD
@adonsats
3 months ago
Can we talk more about R-puzzle ? anyone has technical knowledge about it ? a white paper ? How it can influence bitcoin adoption or bitcoin speciality ?
2
0.01 USD
@venezia
3 months ago
Did you know that OP_0 can mean three things at the same time.
3
0.04 USD
@adonsats
3 months ago
Am not an extremist but...you now it is time to have a FORTH school where eveyone know how to build an OS . make those Windows and Mac compete with a 10Kb "toy" language... The language of global money 😎
0
0 USD
@venezia
3 months ago
WAForth ( https://el-tramo.be/waforth/ ) is a Dynamic Forth Compiler for WebAssembly made by Remko Tronçon. You can use it to try some examples, or enter some content at will and see what you get. Here you can see the core words of Forth. ( http://lars.nocrew.org/dpans/dpans6.htm#6.1 )
2
0.01 USD
@adonsats
3 months ago
talking about FORTH. Why not build a forth tool that integrate bitcoin script too ? A one in all IDE for the future of IoT. Comment are welcome :)
0
0 USD
@bitcoinrealist
3 months ago
Cool idea for a channel.
0
0.01 USD