If I were to write a smart contract with RGB, which language should I use for it? Something like miniscript? #38
Unanswered
UkolovaOlga
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR
RGB uses a different approach than Ethereum smart-contracts. RGB uses Schemas to define asset parameters and characteristics, thus you can't 'write a smart contract' in RGB.
TS;WM
In RGB you don't write smart contracts, you use a Schema. Currently everyone can use Schemas that we developed (they are written in Rust), but also there is an option to create one of your own. Important to notice here is that in case you decide to create a Schema of your own, you will need to make it in accordance with client-side validation paradigm, meaning that you will need to use our LNP/BP Core Library (written in Rust, again) and add your custom (obviously - also Rust) code to that. Thus, you are not writing a smart contract per ce, you are creating a code that will tell other software how to use the smart-contract.
When/if you are not able to achieve what you want with current Schemas or the ones you create yourself using Rust, you will have an option to use Simplicity when it's released and ready to use, by that enabling yourself to create more feature-rich Schemas with Simplicity extensions. We already have a slot for Simplicity interpreter inside RGB for this case.
Miniscript is related to bitcoin transactions, but not to RGB, meaning you don't use it as a language/script for writing any smart contracts. RGB is based on bitcoin transactions and uses miniscript simply as a way to express bitcoin script code in a more predictable way. RGB adds nothing to bitcoin level in this context and actual RGB functionality is not implemented as a part of bitcoin scripts.
Beta Was this translation helpful? Give feedback.
All reactions