RGB glossary, part I #52
dr-orlovsky
started this conversation in
General
Replies: 1 comment
-
Could you please add explanations for the following vocabulary: 'stock', 'stash', 'inventory', 'batch', 'opid', 'bundles','bindle','hoard'and 'fascia'? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Legal terms
A contract has state and business logic, expressed in terms of ownership rights and executive rights. The contract state, rights and conditions of valid operations are defined using RGB schema; only state and operations which allowed by the schema declarations and valdiation scripts are allowed to happen withint the contract scope.
It is important to note that ownership rights and ability to spend UTXO participating assignment doesn't necessary implies ability to update the contract state or construct a valid state transition (see executive rights). See rights mismatch section for the details.
Rights mismatch may happen in two main cases:
A user by mistake has assigned different rights to the same UTXO and the schema doesn't provide a way of spending that combination of rights with a valid state transition. This is a reason why properly-designed schema must provide a rights split transition option.
A schema doesn't provide a way of constructing state transition for a defined owned state
Contractum compiler notifies about this two bugs during schema compilation, however schemata designed without Contractum may still contain it.
RGB consensus-level terms, part I
RGB consensus has the following layers
Data types are defined in the same terms as variable types in any structural language (C, Rust, Haskell, etc).
Contract participants usually have only a partial view on the contract state, with some parts of the state not known to them at all (even the fact of its existence), some parts known only in form of zero-knowledge proofs – and some state known.
The contract state is constructed starting from the contract genesis by consecutively applying operations from the history in their consensus order. Notwithstanding the fact of the partial view of the contract participant (and, as a result, of RGB Node run by that participant) on the contract state, consensus ordering allows the following statements to hold true
Contract operations include:
All state transitions in an RGB contract (both stash-stored and new one coming with consignment) have a deterministic ordering, which will be the same on the consensus level, meaning that each RGB Node (or other software based on RGB Core-core consensus engine) will come to the same order of state transition for a given contract. If two peers have a different subset of state transitions, the order they get will still be non-contradictory, specifically: if peer `A` has state transitions `a` < `c`, peer `B` has state transitions `a` < `b`, and peer `C` has state transitions `b` < `c`, than their orders are in concord between each other and with a global ordering of `a` < `b` < `c`.
The full definition of the consensus ordering can be found in RGB core issue #117
A schema does that by providing declarations and implementation for the following components:
In the result, a schema defines the following:
One may think of a schema as a "class" definition in the OOP world; in that terms specific RGB contracts are "class instance" created by the schema constructor (see genesis). Such approach allows to separate role of contract developer (in RGB called schema developer) and contract issuer: the first one needs to be an experienced developer, while the second one is not required to know anything about coding or security at all. This also promotes re-use of common codebase by different issuers for the same typical use cases (like fungible assets), reducing the risk of mistakes.
See also RGB consensus
A state transition has inputs, referencing the assignments from the previous contract operations, outputs, constructing new assignments, and an optional declaration of valencies.
Probably the simplest way to understand state extensions is by example. Let's assume we'd like to do an asset which can be issued by anybody in the world through burning equivalent amount of bitcoins. Such operation can't be a state transition, since we do not have a predefined set of single-use-seals to define a "rights of issue" for an open and unknown set of participants. We can't also do "multiple geneses", since each genesis will define a new RGB contract and the assets under different RGB contracts are not fungible. State extensions were created exactly to address this issue.
It is important to note, that while the global state is not "directly owned" by any contract party, it still may be updated through state transitions – but only if schema enables that explicitly. In such cases the use of the global state (as compared to the owned state) is reasonable only when it may be possible to opt-out from future state updates (i.e. do not define a new single-use-seals) but still needs to keep the state. The asset name is again such an example, since even if the asset can be renamed, future renames after certain renaming may be prohibited (i.e. no new owned state can be created), but the asset name should stay; global allows exactly that.
The concept of RGB contract interface is similar to the concept of ERC standards and ABI files in Ethereum world; the most common interfaces are called "RGBxx" and are defined as a separate LNP/BP standards.
List of interfaces standardized by LNP/BP Standards Association:
Beta Was this translation helpful? Give feedback.
All reactions