From 92183503e0ba112087d8c73fab238f60402e5b49 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 10:35:14 +0100 Subject: [PATCH 01/11] contract: introduce disclose hash --- src/contract/id.rs | 37 +++++++++++++++++++++++++++++++++++++ src/contract/mod.rs | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/contract/id.rs b/src/contract/id.rs index f64b60d6..1287d0ab 100644 --- a/src/contract/id.rs +++ b/src/contract/id.rs @@ -138,6 +138,43 @@ impl OpId { } } +/// Hash committing to all data which are disclosed by a contract or some part +/// of it (operation, bundle, consignment, disclosure). +#[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, From)] +#[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] +#[display(Self::to_hex)] +#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB)] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate", transparent) +)] +pub struct DiscloseHash( + #[from] + #[from([u8; 32])] + Bytes32, +); + +impl From for DiscloseHash { + fn from(hasher: Sha256) -> Self { hasher.finish().into() } +} + +impl CommitmentId for DiscloseHash { + const TAG: &'static str = "urn:lnp-bp:rgb:disclose#2024-02-16"; +} + +impl FromStr for DiscloseHash { + type Err = hex::Error; + fn from_str(s: &str) -> Result { Self::from_hex(s) } +} + +impl DiscloseHash { + pub fn copy_from_slice(slice: impl AsRef<[u8]>) -> Result { + Bytes32::copy_from_slice(slice).map(Self) + } +} + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 4d7768b9..4b542ecb 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -53,8 +53,8 @@ pub use fungible::{ }; pub use global::{GlobalState, GlobalValues}; pub use id::{ - AssignmentCommitment, BaseCommitment, ContractId, GlobalCommitment, OpCommitment, OpId, - TypeCommitment, + AssignmentCommitment, BaseCommitment, ContractId, DiscloseHash, GlobalCommitment, OpCommitment, + OpId, TypeCommitment, }; pub use operations::{ Extension, Genesis, Input, Inputs, Metadata, OpRef, Operation, Redeemed, Transition, Valencies, From 49f6d71e21cb42a549aa6542ef64c0c3e55bbfb6 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 10:35:29 +0100 Subject: [PATCH 02/11] contract: rename id to commit module --- src/contract/{id.rs => commit.rs} | 0 src/contract/mod.rs | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/contract/{id.rs => commit.rs} (100%) diff --git a/src/contract/id.rs b/src/contract/commit.rs similarity index 100% rename from src/contract/id.rs rename to src/contract/commit.rs diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 4b542ecb..49c4f1b2 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -33,7 +33,7 @@ mod bundle; #[allow(clippy::module_inception)] mod contract; mod xchain; -mod id; +mod commit; pub use anchor::{AnchorSet, AnchoredBundle, Layer1, WitnessAnchor, XAnchor}; pub use assignments::{ @@ -42,6 +42,10 @@ pub use assignments::{ }; pub use attachment::{AttachId, ConcealedAttach, RevealedAttach}; pub use bundle::{BundleId, InputMap, TransitionBundle, Vin}; +pub use commit::{ + AssignmentCommitment, BaseCommitment, ContractId, DiscloseHash, GlobalCommitment, OpCommitment, + OpId, TypeCommitment, +}; pub use contract::{ AssignmentWitness, ContractHistory, ContractState, GlobalOrd, KnownState, Opout, OpoutParseError, OutputAssignment, @@ -52,10 +56,6 @@ pub use fungible::{ InvalidFieldElement, NoiseDumb, PedersenCommitment, RangeProof, RangeProofError, RevealedValue, }; pub use global::{GlobalState, GlobalValues}; -pub use id::{ - AssignmentCommitment, BaseCommitment, ContractId, DiscloseHash, GlobalCommitment, OpCommitment, - OpId, TypeCommitment, -}; pub use operations::{ Extension, Genesis, Input, Inputs, Metadata, OpRef, Operation, Redeemed, Transition, Valencies, }; From 241024c89241a1f249d707d42ff520b123574b98 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 11:25:33 +0100 Subject: [PATCH 03/11] contract: implement OpDisclosure --- src/contract/assignments.rs | 16 +++++++++- src/contract/commit.rs | 37 +++++++++++++++++++--- src/contract/mod.rs | 4 +-- src/contract/operations.rs | 61 ++++++++++++++++++++++++++++++++++--- 4 files changed, 106 insertions(+), 12 deletions(-) diff --git a/src/contract/assignments.rs b/src/contract/assignments.rs index 3f91cb71..acd9b378 100644 --- a/src/contract/assignments.rs +++ b/src/contract/assignments.rs @@ -22,7 +22,7 @@ use core::cmp::Ordering; use core::fmt::Debug; -use std::collections::BTreeSet; +use std::collections::{btree_map, BTreeSet}; use std::hash::{Hash, Hasher}; use amplify::confinement::{Confined, SmallVec, TinyOrdMap}; @@ -570,6 +570,13 @@ impl Assignments { } } +impl IntoIterator for Assignments { + type Item = (AssignmentType, TypedAssigns); + type IntoIter = btree_map::IntoIter>; + + fn into_iter(self) -> Self::IntoIter { self.0.into_iter() } +} + #[derive(Copy, Clone, Eq, PartialEq, Debug, From)] pub enum AssignmentsRef<'op> { #[from] @@ -589,6 +596,13 @@ impl AssignmentsRef<'_> { pub fn is_empty(&self) -> bool { self.len() == 0 } + pub fn flat(&self) -> Assignments { + match *self { + AssignmentsRef::Genesis(a) => a.transmutate_seals(), + AssignmentsRef::Graph(a) => a.clone(), + } + } + pub fn types(&self) -> BTreeSet { match self { AssignmentsRef::Genesis(a) => a.keys().copied().collect(), diff --git a/src/contract/commit.rs b/src/contract/commit.rs index 1287d0ab..38ee2148 100644 --- a/src/contract/commit.rs +++ b/src/contract/commit.rs @@ -24,6 +24,7 @@ use std::fmt::{Display, Formatter}; use std::str::FromStr; use std::{fmt, vec}; +use amplify::confinement::MediumOrdMap; use amplify::hex::{FromHex, ToHex}; use amplify::num::u256; use amplify::{hex, ByteArray, Bytes32, FromSliceError, Wrapper}; @@ -32,13 +33,12 @@ use commit_verify::{ mpc, CommitEncode, CommitEngine, CommitId, CommitmentId, Conceal, DigestExt, MerkleHash, MerkleLeaves, Sha256, StrictHash, }; -use strict_encoding::StrictEncode; use crate::{ - Assign, AssignmentType, Assignments, ConcealedData, ConcealedState, ConfidentialState, - ExposedSeal, ExposedState, Extension, ExtensionType, Ffv, Genesis, GlobalState, - GlobalStateType, Redeemed, SchemaId, SecretSeal, Transition, TransitionType, TypedAssigns, - XChain, LIB_NAME_RGB, + Assign, AssignmentType, Assignments, ConcealedAttach, ConcealedData, ConcealedState, + ConfidentialState, ExposedSeal, ExposedState, Extension, ExtensionType, Ffv, Genesis, + GlobalState, GlobalStateType, Operation, PedersenCommitment, Redeemed, SchemaId, SecretSeal, + Transition, TransitionType, TypedAssigns, XChain, LIB_NAME_RGB, }; /// Unique contract identifier equivalent to the contract genesis commitment @@ -175,6 +175,31 @@ impl DiscloseHash { } } +#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] +#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB)] +pub struct AssignmentIndex { + pub ty: AssignmentType, + pub pos: u16, +} + +impl AssignmentIndex { + pub fn new(ty: AssignmentType, pos: u16) -> Self { AssignmentIndex { ty, pos } } +} + +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = DiscloseHash)] +pub struct OpDisclose { + pub id: OpId, + pub seals: MediumOrdMap>, + pub fungible: MediumOrdMap, + pub data: MediumOrdMap, + pub attach: MediumOrdMap, +} + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] @@ -232,6 +257,8 @@ impl Genesis { valencies: self.valencies.commit_id(), } } + + pub fn disclose_hash(&self) -> DiscloseHash { self.disclose().commit_id() } } impl Transition { diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 49c4f1b2..2a9520b8 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -43,8 +43,8 @@ pub use assignments::{ pub use attachment::{AttachId, ConcealedAttach, RevealedAttach}; pub use bundle::{BundleId, InputMap, TransitionBundle, Vin}; pub use commit::{ - AssignmentCommitment, BaseCommitment, ContractId, DiscloseHash, GlobalCommitment, OpCommitment, - OpId, TypeCommitment, + AssignmentCommitment, AssignmentIndex, BaseCommitment, ContractId, DiscloseHash, + GlobalCommitment, OpCommitment, OpDisclose, OpId, TypeCommitment, }; pub use contract::{ AssignmentWitness, ContractHistory, ContractState, GlobalOrd, KnownState, Opout, diff --git a/src/contract/operations.rs b/src/contract/operations.rs index e64aba41..24797ac6 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -20,10 +20,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::collections::{btree_map, btree_set}; +use std::collections::{btree_map, btree_set, BTreeMap}; use std::iter; -use amplify::confinement::{SmallBlob, TinyOrdMap, TinyOrdSet}; +use amplify::confinement::{Confined, SmallBlob, TinyOrdMap, TinyOrdSet}; use amplify::Wrapper; use commit_verify::{ CommitEncode, CommitEngine, CommitId, Conceal, MerkleHash, MerkleLeaves, StrictHash, @@ -32,8 +32,10 @@ use strict_encoding::{StrictDeserialize, StrictEncode, StrictSerialize}; use crate::schema::{self, ExtensionType, OpFullType, OpType, SchemaId, TransitionType}; use crate::{ - AltLayer1Set, AssignmentType, Assignments, AssignmentsRef, ContractId, Ffv, GenesisSeal, - GlobalState, GraphSeal, OpId, Opout, ReservedBytes, TypedAssigns, LIB_NAME_RGB, + AltLayer1Set, Assign, AssignmentIndex, AssignmentType, Assignments, AssignmentsRef, + ConcealedAttach, ConcealedData, ConcealedValue, ContractId, ExposedState, Ffv, GenesisSeal, + GlobalState, GraphSeal, OpDisclose, OpId, Opout, ReservedBytes, SecretSeal, TypedAssigns, + VoidState, XChain, LIB_NAME_RGB, }; #[derive(Wrapper, WrapperMut, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Default, From)] @@ -191,6 +193,57 @@ pub trait Operation { /// While public state extension do have parent nodes, they do not contain /// indexed rights. fn inputs(&self) -> Inputs; + + /// Provides summary about parts of the operation which are revealed. + fn disclose(&self) -> OpDisclose { + fn proc_seals( + ty: AssignmentType, + a: &[Assign], + seals: &mut BTreeMap>, + state: &mut BTreeMap, + ) { + for (index, assignment) in a.iter().enumerate() { + if let Some(seal) = assignment.revealed_seal() { + seals.insert(AssignmentIndex::new(ty, index as u16), seal.to_secret_seal()); + } + if let Some(revealed) = assignment.as_revealed_state() { + state.insert(AssignmentIndex::new(ty, index as u16), revealed.conceal()); + } + } + } + + let mut seals: BTreeMap> = bmap!(); + let mut void: BTreeMap = bmap!(); + let mut fungible: BTreeMap = bmap!(); + let mut data: BTreeMap = bmap!(); + let mut attach: BTreeMap = bmap!(); + for (ty, assigns) in self.assignments().flat() { + match assigns { + TypedAssigns::Declarative(a) => { + proc_seals(ty, &a, &mut seals, &mut void); + } + TypedAssigns::Fungible(a) => { + proc_seals(ty, &a, &mut seals, &mut fungible); + } + TypedAssigns::Structured(a) => { + proc_seals(ty, &a, &mut seals, &mut data); + } + TypedAssigns::Attachment(a) => { + proc_seals(ty, &a, &mut seals, &mut attach); + } + } + } + + OpDisclose { + id: self.id(), + seals: Confined::from_collection_unsafe(seals), + fungible: Confined::from_iter_unsafe( + fungible.into_iter().map(|(k, s)| (k, s.commitment)), + ), + data: Confined::from_collection_unsafe(data), + attach: Confined::from_collection_unsafe(attach), + } + } } #[derive(Clone, PartialEq, Eq, Hash, Debug)] From 29307f00a57bdb5ab2ed6255ff5bcd4809c7150b Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 11:33:17 +0100 Subject: [PATCH 04/11] contract: implement BundleDisclosure --- src/contract/bundle.rs | 6 +++--- src/contract/commit.rs | 42 +++++++++++++++++++++++++++++++++++--- src/contract/mod.rs | 4 ++-- src/contract/operations.rs | 8 +++++--- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/src/contract/bundle.rs b/src/contract/bundle.rs index d12918dc..8148cc40 100644 --- a/src/contract/bundle.rs +++ b/src/contract/bundle.rs @@ -22,7 +22,7 @@ use std::collections::{btree_map, BTreeMap}; -use amplify::confinement::{Confined, U16}; +use amplify::confinement::{Confined, U16 as U16MAX}; use amplify::{Bytes32, Wrapper}; use bp::Vout; use commit_verify::{mpc, CommitEncode, CommitEngine, CommitId, CommitmentId, DigestExt, Sha256}; @@ -75,7 +75,7 @@ impl From for BundleId { derive(Serialize, Deserialize), serde(crate = "serde_crate", transparent) )] -pub struct InputMap(Confined, 1, U16>); +pub struct InputMap(Confined, 1, U16MAX>); impl StrictDumb for InputMap { fn strict_dumb() -> Self { Self(confined_bmap!(strict_dumb!() => strict_dumb!())) } @@ -109,7 +109,7 @@ impl<'a> IntoIterator for &'a InputMap { )] pub struct TransitionBundle { pub input_map: InputMap, - pub known_transitions: Confined, 1, U16>, + pub known_transitions: Confined, 1, U16MAX>, } impl CommitEncode for TransitionBundle { diff --git a/src/contract/commit.rs b/src/contract/commit.rs index 38ee2148..462408fe 100644 --- a/src/contract/commit.rs +++ b/src/contract/commit.rs @@ -20,11 +20,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::collections::BTreeSet; use std::fmt::{Display, Formatter}; use std::str::FromStr; use std::{fmt, vec}; -use amplify::confinement::MediumOrdMap; +use amplify::confinement::{Confined, MediumOrdMap, U16 as U16MAX}; use amplify::hex::{FromHex, ToHex}; use amplify::num::u256; use amplify::{hex, ByteArray, Bytes32, FromSliceError, Wrapper}; @@ -33,12 +34,13 @@ use commit_verify::{ mpc, CommitEncode, CommitEngine, CommitId, CommitmentId, Conceal, DigestExt, MerkleHash, MerkleLeaves, Sha256, StrictHash, }; +use strict_encoding::StrictDumb; use crate::{ - Assign, AssignmentType, Assignments, ConcealedAttach, ConcealedData, ConcealedState, + Assign, AssignmentType, Assignments, BundleId, ConcealedAttach, ConcealedData, ConcealedState, ConfidentialState, ExposedSeal, ExposedState, Extension, ExtensionType, Ffv, Genesis, GlobalState, GlobalStateType, Operation, PedersenCommitment, Redeemed, SchemaId, SecretSeal, - Transition, TransitionType, TypedAssigns, XChain, LIB_NAME_RGB, + Transition, TransitionBundle, TransitionType, TypedAssigns, XChain, LIB_NAME_RGB, }; /// Unique contract identifier equivalent to the contract genesis commitment @@ -200,6 +202,40 @@ pub struct OpDisclose { pub attach: MediumOrdMap, } +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +#[derive(StrictType, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = DiscloseHash)] +pub struct BundleDisclosure { + pub id: BundleId, + pub known_transitions: Confined, 1, U16MAX>, +} + +impl StrictDumb for BundleDisclosure { + fn strict_dumb() -> Self { + Self { + id: strict_dumb!(), + known_transitions: confined_bset! { strict_dumb!() }, + } + } +} + +impl TransitionBundle { + /// Provides summary about parts of the bundle which are revealed. + pub fn disclose(&self) -> BundleDisclosure { + BundleDisclosure { + id: self.bundle_id(), + known_transitions: Confined::from_iter_unsafe( + self.known_transitions.values().map(|t| t.disclose_hash()), + ), + } + } + + /// Returns commitment to the bundle plus revealed data within it. + pub fn disclose_hash(&self) -> DiscloseHash { self.disclose().commit_id() } +} + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 2a9520b8..e3ee2f67 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -43,8 +43,8 @@ pub use assignments::{ pub use attachment::{AttachId, ConcealedAttach, RevealedAttach}; pub use bundle::{BundleId, InputMap, TransitionBundle, Vin}; pub use commit::{ - AssignmentCommitment, AssignmentIndex, BaseCommitment, ContractId, DiscloseHash, - GlobalCommitment, OpCommitment, OpDisclose, OpId, TypeCommitment, + AssignmentCommitment, AssignmentIndex, BaseCommitment, BundleDisclosure, ContractId, + DiscloseHash, GlobalCommitment, OpCommitment, OpDisclose, OpId, TypeCommitment, }; pub use contract::{ AssignmentWitness, ContractHistory, ContractState, GlobalOrd, KnownState, Opout, diff --git a/src/contract/operations.rs b/src/contract/operations.rs index 24797ac6..ab583330 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -33,9 +33,9 @@ use strict_encoding::{StrictDeserialize, StrictEncode, StrictSerialize}; use crate::schema::{self, ExtensionType, OpFullType, OpType, SchemaId, TransitionType}; use crate::{ AltLayer1Set, Assign, AssignmentIndex, AssignmentType, Assignments, AssignmentsRef, - ConcealedAttach, ConcealedData, ConcealedValue, ContractId, ExposedState, Ffv, GenesisSeal, - GlobalState, GraphSeal, OpDisclose, OpId, Opout, ReservedBytes, SecretSeal, TypedAssigns, - VoidState, XChain, LIB_NAME_RGB, + ConcealedAttach, ConcealedData, ConcealedValue, ContractId, DiscloseHash, ExposedState, Ffv, + GenesisSeal, GlobalState, GraphSeal, OpDisclose, OpId, Opout, ReservedBytes, SecretSeal, + TypedAssigns, VoidState, XChain, LIB_NAME_RGB, }; #[derive(Wrapper, WrapperMut, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Default, From)] @@ -244,6 +244,8 @@ pub trait Operation { attach: Confined::from_collection_unsafe(attach), } } + + fn disclose_hash(&self) -> DiscloseHash { self.disclose().commit_id() } } #[derive(Clone, PartialEq, Eq, Hash, Debug)] From 8fd8c8c20b9981c95d7f3e816304d040e26fb020 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 13:30:49 +0100 Subject: [PATCH 05/11] contract: implement XChain::transpose --- src/contract/xchain.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/contract/xchain.rs b/src/contract/xchain.rs index 51c696b4..362267be 100644 --- a/src/contract/xchain.rs +++ b/src/contract/xchain.rs @@ -288,6 +288,15 @@ impl XChain { } } +impl XChain> { + pub fn transpose(self) -> Option> { + match self { + XChain::Bitcoin(inner) => inner.map(XChain::Bitcoin), + XChain::Liquid(inner) => inner.map(XChain::Liquid), + } + } +} + impl Iterator for XChain { type Item = XChain<::Item>; From 250b44fc82d8d7480cd8391267ca0f8fcdab41d2 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 13:42:06 +0100 Subject: [PATCH 06/11] contract: implement XChain::cloned and copied --- src/contract/xchain.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/contract/xchain.rs b/src/contract/xchain.rs index 362267be..62232d6f 100644 --- a/src/contract/xchain.rs +++ b/src/contract/xchain.rs @@ -288,6 +288,14 @@ impl XChain { } } +impl<'a, T: Copy> XChain<&'a T> { + pub fn copied(self) -> XChain { self.map(|t| *t) } +} + +impl<'a, T: Clone> XChain<&'a T> { + pub fn cloned(self) -> XChain { self.map(T::clone) } +} + impl XChain> { pub fn transpose(self) -> Option> { match self { From e53663fc9d32dadd6a466644f3692f0ee01e6d92 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 14:45:07 +0100 Subject: [PATCH 07/11] conctract: implement ordering for AnchoredBundles and operations --- src/contract/anchor.rs | 8 ++++++++ src/contract/operations.rs | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/contract/anchor.rs b/src/contract/anchor.rs index 5a201620..fc459e1f 100644 --- a/src/contract/anchor.rs +++ b/src/contract/anchor.rs @@ -49,6 +49,14 @@ impl AnchoredBundle { pub fn bundle_id(&self) -> BundleId { self.bundle.bundle_id() } } +impl Ord for AnchoredBundle { + fn cmp(&self, other: &Self) -> Ordering { self.bundle_id().cmp(&other.bundle_id()) } +} + +impl PartialOrd for AnchoredBundle { + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } +} + pub type XAnchor

= XChain>; impl XAnchor

{ diff --git a/src/contract/operations.rs b/src/contract/operations.rs index ab583330..426a620f 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -20,6 +20,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::cmp::Ordering; use std::collections::{btree_map, btree_set, BTreeMap}; use std::iter; @@ -292,6 +293,14 @@ pub struct Extension { impl StrictSerialize for Extension {} impl StrictDeserialize for Extension {} +impl Ord for Extension { + fn cmp(&self, other: &Self) -> Ordering { self.id().cmp(&other.id()) } +} + +impl PartialOrd for Extension { + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } +} + #[derive(Clone, PartialEq, Eq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] @@ -314,6 +323,14 @@ pub struct Transition { impl StrictSerialize for Transition {} impl StrictDeserialize for Transition {} +impl Ord for Transition { + fn cmp(&self, other: &Self) -> Ordering { self.id().cmp(&other.id()) } +} + +impl PartialOrd for Transition { + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } +} + impl Conceal for Genesis { type Concealed = Self; fn conceal(&self) -> Self::Concealed { From 452930248f5c0144f22a74f73f40df703fdcdaca Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 16:27:53 +0100 Subject: [PATCH 08/11] chore: update dependencies --- Cargo.lock | 114 ++++++------- Cargo.toml | 11 +- src/contract/seal.rs | 2 +- src/schema/state.rs | 4 +- src/stl.rs | 2 +- stl/AnchoredBundle.vesper | 2 +- stl/MerkleNode.vesper | 2 +- stl/RGB@0.1.0.sta | 331 +++++++++++++++++++------------------- stl/RGB@0.1.0.stl | Bin 16578 -> 16622 bytes stl/RGB@0.1.0.sty | 29 ++-- 10 files changed, 238 insertions(+), 259 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73018156..b83f44f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,8 +4,9 @@ version = 3 [[package]] name = "aluvm" -version = "0.11.0-beta.2" -source = "git+https://github.com/AluVM/rust-aluvm?branch=v0.11#d218e9a770618db53187ec2ef02b7b4ace72c54a" +version = "0.11.0-beta.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60bd5631720ae3b92182387baa647e34a45b56ea3e359fa756866a95a64e48f4" dependencies = [ "amplify", "baid58", @@ -22,9 +23,9 @@ dependencies = [ [[package]] name = "amplify" -version = "4.5.1" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd50780fa78a67bae725dd164bc993500656112815a9301fd8b797e9006803" +checksum = "9e711289a6cb28171b4f0e6c8019c69ff9476050508dc082167575d458ff74d0" dependencies = [ "amplify_apfloat", "amplify_derive", @@ -33,21 +34,19 @@ dependencies = [ "ascii", "rand", "serde", - "serde_json", - "serde_yaml", "stringly_conversions", - "toml 0.7.8", "wasm-bindgen", ] [[package]] name = "amplify_apfloat" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5b7f29fad2a3def5dfbfed0da85b886eb927a18fe0296c06e39880b7a96db05" +checksum = "72e23f5ede99065fa6957a633498d2728d51016d61dae23b69c866112b7c61ee" dependencies = [ "amplify_num", "bitflags", + "wasm-bindgen", ] [[package]] @@ -64,9 +63,9 @@ dependencies = [ [[package]] name = "amplify_num" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9681187211554ab98f138ba159e90861b136c20afc680dcff2ba82d020721e27" +checksum = "04c009c5c4de814911b177e2ea59e4930bb918978ed3cce4900d846a6ceb0838" dependencies = [ "serde", "wasm-bindgen", @@ -160,9 +159,9 @@ checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "blake3" @@ -189,7 +188,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#19cf59adea068dbda7a617a1c514b544c008b10d" dependencies = [ "amplify", "chrono", @@ -203,7 +202,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#19cf59adea068dbda7a617a1c514b544c008b10d" dependencies = [ "amplify", "bp-consensus", @@ -221,7 +220,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#19cf59adea068dbda7a617a1c514b544c008b10d" dependencies = [ "amplify", "base85", @@ -235,7 +234,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#19cf59adea068dbda7a617a1c514b544c008b10d" dependencies = [ "amplify", "baid58", @@ -250,9 +249,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" [[package]] name = "byteorder" @@ -292,7 +291,7 @@ dependencies = [ [[package]] name = "commit_encoding_derive" version = "0.11.0-beta.3" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#9562563e1fde21fe7ae6a6a9d36c0115f654a59e" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#5359d8437f5e63289ad0a63ecb66a3bd7d42f816" dependencies = [ "amplify", "amplify_syn", @@ -304,7 +303,7 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.3" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#9562563e1fde21fe7ae6a6a9d36c0115f654a59e" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#5359d8437f5e63289ad0a63ecb66a3bd7d42f816" dependencies = [ "amplify", "commit_encoding_derive", @@ -689,7 +688,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -757,8 +756,9 @@ dependencies = [ [[package]] name = "strict_encoding" -version = "2.7.0" -source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#bdd35d550369590a3e6a86439a55e0b2f2d06766" +version = "2.7.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12eaa6985afa31deacc86cdc4935a36960ae09131a1f4e1db430127ebc4f05d" dependencies = [ "amplify", "half", @@ -768,8 +768,9 @@ dependencies = [ [[package]] name = "strict_encoding_derive" -version = "2.7.0" -source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#bdd35d550369590a3e6a86439a55e0b2f2d06766" +version = "2.7.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1b064a62618a785e6d8f4df13d905dc335b56400d48f9b4f8b12dcba82b260" dependencies = [ "amplify_syn", "heck", @@ -780,8 +781,9 @@ dependencies = [ [[package]] name = "strict_types" -version = "2.7.0" -source = "git+https://github.com/strict-types/strict-types?branch=refactor/io#abc6133b6cfdb9699714c493e5f62175d99fd752" +version = "2.7.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66de5cdf197b68e13fcac9fad7ed288f44052a319a3df3abbaba9c6e52f735b" dependencies = [ "amplify", "baid58", @@ -793,8 +795,8 @@ dependencies = [ "serde_yaml", "sha2", "strict_encoding", - "toml 0.8.10", - "vesper", + "toml", + "vesper-lang", ] [[package]] @@ -820,9 +822,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" dependencies = [ "proc-macro2", "quote", @@ -846,19 +848,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", -] - -[[package]] -name = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", + "syn 2.0.49", ] [[package]] @@ -870,7 +860,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.4", + "toml_edit", ] [[package]] @@ -884,22 +874,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ "indexmap", "serde", @@ -933,9 +910,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "vesper" +name = "vesper-lang" version = "0.1.0" -source = "git+https://github.com/UBIDECO/vesper#18107cbbdffeb91d992dc7c76da0640aea152e8f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f72ebd3b32f16ee8ace2bd3058c2bfa0f4820992bd4ea86e73ba228bb13dd2b0" dependencies = [ "amplify", "strict_encoding", @@ -968,7 +946,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-shared", ] @@ -1002,7 +980,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1035,7 +1013,7 @@ checksum = "a5211b7550606857312bba1d978a8ec75692eae187becc5e680444fffc5e6f89" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1116,9 +1094,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.39" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "d90f4e0f530c4c69f62b80d839e9ef3855edc9cba471a160c4d692deed62b401" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index e8016958..4285c234 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,10 +22,10 @@ name = "rgbcore-stl" required-features = ["stl"] [dependencies] -amplify = { version = "~4.5.1", features = ["rand"] } -strict_encoding = "~2.7.0" -strict_types = "~2.7.0" -aluvm = { version = "~0.11.0-beta.2", features = ["std"] } +amplify = { version = "~4.6.0", features = ["rand"] } +strict_encoding = "~2.7.0-beta.1" +strict_types = "~2.7.0-beta.1" +aluvm = { version = "~0.11.0-beta.3", features = ["std"] } commit_verify = { version = "~0.11.0-beta.3", features = ["rand", "derive"] } single_use_seals = "~0.11.0-beta.3" bp-core = { version = "~0.11.0-beta.3" } @@ -62,11 +62,8 @@ wasm-bindgen-test = "0.3" features = [ "all" ] [patch.crates-io] -strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "refactor/io" } -strict_types = { git = "https://github.com/strict-types/strict-types", branch = "refactor/io" } commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "v0.11" } bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } -aluvm = { git = "https://github.com/AluVM/rust-aluvm", branch = "v0.11" } diff --git a/src/contract/seal.rs b/src/contract/seal.rs index cb2670e7..599ae1fd 100644 --- a/src/contract/seal.rs +++ b/src/contract/seal.rs @@ -301,7 +301,7 @@ mod test { let secret = reveal.to_secret_seal(); assert_eq!( secret.to_string(), - "bc:utxob:MEtUtHY-Nk2QBNbkL-vnV1aAHcx-eYAwSr16Q-qGa5tKND8-MR3WG6" + "bc:utxob:28Hk9S1-nBLPw4u9j-Zwaftwz8s-k5Y6G7bug-qvoeGn5BF-GPEJoY3" ); assert_eq!(reveal.to_secret_seal(), reveal.conceal()) } diff --git a/src/schema/state.rs b/src/schema/state.rs index 9d1752b0..68f6788e 100644 --- a/src/schema/state.rs +++ b/src/schema/state.rs @@ -20,7 +20,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use strict_encoding::constants::U64; +use strict_encoding::Primitive; use strict_types::SemId; use crate::{StateType, LIB_NAME_RGB}; @@ -96,7 +96,7 @@ impl StateSchema { pub enum FungibleType { #[default] #[display("64bit")] - Unsigned64Bit = U64.into_code(), + Unsigned64Bit = Primitive::U64.into_code(), } #[derive(Clone, PartialEq, Eq, Hash, Debug)] diff --git a/src/stl.rs b/src/stl.rs index 2efc4628..6f73da44 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -34,7 +34,7 @@ use crate::{ /// Strict types id for the library providing data types for RGB consensus. pub const LIB_ID_RGB: &str = - "urn:ubideco:stl:GBpCZWjW6YyuTB8tGMi856t1iATppxNGTr7GPzZxgSpU#helium-cinema-contact"; + "urn:ubideco:stl:Hzv1xPBtQfqcGYeisvS2V9DPj1VRC5WyYfME2RtmuRpu#blitz-english-eric"; fn _rgb_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_RGB), tiny_bset! { diff --git a/stl/AnchoredBundle.vesper b/stl/AnchoredBundle.vesper index f6567e95..fe574b57 100644 --- a/stl/AnchoredBundle.vesper +++ b/stl/AnchoredBundle.vesper @@ -85,7 +85,7 @@ AnchoredBundle rec element bytes len=32 aka=MerkleHash dbcProof is Unit aka=OpretProof bundle rec -- TransitionBundle - inputMap map len=1..MAX16 + inputMap map len=1..MAX16 aka=InputMap key is U32 aka=Vout value bytes len=32 aka=OpId knownTransitions map len=1..MAX16 diff --git a/stl/MerkleNode.vesper b/stl/MerkleNode.vesper index 2833e69d..379982c4 100644 --- a/stl/MerkleNode.vesper +++ b/stl/MerkleNode.vesper @@ -1,6 +1,6 @@ MerkleNode rec branching enum void=0 single=1 branch=2 -- NodeBranching depth is U8 - width is U16 + width is U256 node1 bytes len=32 aka=MerkleHash node2 bytes len=32 aka=MerkleHash diff --git a/stl/RGB@0.1.0.sta b/stl/RGB@0.1.0.sta index 4a3ece7d..41c0b588 100644 --- a/stl/RGB@0.1.0.sta +++ b/stl/RGB@0.1.0.sta @@ -1,19 +1,19 @@ -----BEGIN STRICT TYPE LIB----- -Id: 35cF57bXFVGRrGsPBW7D9wh49BeAZpBgSwBGQxSXDFDH#station-product-conduct +Id: Hzv1xPBtQfqcGYeisvS2V9DPj1VRC5WyYfME2RtmuRpu#blitz-english-eric Name: RGB Dependencies: - 55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray, - 698cwwfCJw4pzQicV8jBaQJ2rLLphub4qJGYbMndqC2C#bless-rebel-panic, - BADMWBVQ6sMJGfELP13cjeZPNutGuLzZtNNZirJQsz9e#tower-monaco-corona, + c8Tnib31q1p7szyPukEGDoQzJQ5qJwPCn5uZCHUXzB9#cupid-metro-warning, + 57sPvZcwQaziec3ux249XoCMhziQpKB8Yw99U5oRwfqW#deluxe-safari-random, + 5teCJyjMWaxbQK8vdga2soWh2U7waERS3ev8KHShJcgv#trumpet-scratch-pelican, DVtm25LRKU4TjbyZmVxPhvCmctZ6vKkPKqfpU2QsDNUo#exodus-axiom-tommy, - DYafq9UACuYbTpduhcqywBGH97wHYtSUNPiXh5v2Zub9#drama-imagine-extreme, + DzTvt9gGhPUKD8Dkkjk9PDBhkJ4gtWxXWQjxnmUYLNrs#voyage-kimono-disco, HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9#speed-atlanta-trilogy -15!sq20WlIl)irWX>_w$=T0||rb~=^wLEBVElH>^WZ$C<90OByWK3VOVyJ>)-~Jq -P0Bi1wm|eR!zENQG)*(g{ztd-@(7Qj*#dIYmM#Fm4Hd2n4`=jR6GnrZ*6U9bXH|@X -=Zu#Y!hN5_Bp3Y36tDMM#=e#tGI($UA5U3KNx<*C>ja}LTPkkZ)t7@1wm|eR!sr` +15!sq1_=Md_Ce;SSLEx{oG{4aHr^2iyiLDUBh#^}_A@_Ma0Wt9LvM0rJux=&4zPT +b9*IMFYW>~BZ&yS~-fAwW*(Pc?@Ubg}3`1{iZE18?WpZg|c}S^j?8_As^WnPDotH +zo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*Qn-1E#x!<|L&MvY}Q1a zd8X!mY=m=AK9hnDBU?^pVQFRx11lrpZ1mpNnXst_%p{r$)G&FUof=`21MEpOIl$h5 Ru&EpDb%;@Z7832Q_xX%Cp delta 1369 zcmaFY$atucv7R}|-HFX+f&P?zbw4soHb*}9Gw)yK-BY#ICL>?hbA^7&{lz>o%)uoo zKJlB9Rx~Bv|0h$-w0@RA=F$(Pk2as5%Ue=9KjX!{u#Id^0nYhFsnb3R^j{2L^m6-= zuty~m7xSv+1pMPPnQ(euf%ex)3sQ@BZf2j@p{%zt#ae})9j3)n`d+QF)9#p z(qv99ZNiG)a4AeK;SwaQkdsS6oi)FpD7A!%pv`Z%5*0$Fj_thu_?8;)(H*fN(#wT6 z)b-uje%d9yV#($kN>kO!Hs^9L=2IXP_LB{ybQA~$(c}s03Y+Ihy<|}!6#kPP&1*I* zDokP|#$xTs{}i7QXJmtNAtPaxf~xm6=czF<65}CF!ip3%6g1c}^9o8!ikS!ok)nn! zQ6^6A)8Hbk5E$UvoMnkQsd>qnsYKWgiXdgpY3u~UX!A{j155-}P2OpIgP@|#8%@qK zGBI#XPIOS5EUOkcdA?Z_VNH(ad2EC;!+BdB!iw^l6ee5SDHB#`z^pKNo*fTy3SZf& e5uwnY2=^J-D@>kauRz$eJH(iF2WXmy!!iKF ^ 1.. OpId} + @mnemonic(puzzle-guru-oregano) data Inputs : {Input ^ ..0xff} @@ -381,8 +384,8 @@ data Transition : ffv Ffv , assignments AssignmentsBlindSealTxPtr , valencies Valencies -@mnemonic(boxer-nadia-alias) -data TransitionBundle : inputMap {Bitcoin.Vout -> ^ 1.. OpId}, knownTransitions {OpId -> ^ 1.. Transition} +@mnemonic(museum-result-logic) +data TransitionBundle : inputMap InputMap, knownTransitions {OpId -> ^ 1.. Transition} @mnemonic(fiction-caramel-fractal) data TransitionSchema : metadata StrictTypes.SemId#cargo-plasma-catalog From 50fa8452824464ec0a28c8129210f18f84aa6451 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 18:47:06 +0100 Subject: [PATCH 09/11] schema: manually implement commitments --- src/schema/schema.rs | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/schema/schema.rs b/src/schema/schema.rs index ca057592..2a904cc9 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -27,7 +27,7 @@ use std::str::FromStr; use amplify::confinement::{TinyOrdMap, TinyOrdSet}; use amplify::{ByteArray, Bytes32}; use baid58::{Baid58ParseError, Chunking, FromBaid58, ToBaid58, CHUNKING_32}; -use commit_verify::{CommitId, CommitmentId, DigestExt, Sha256}; +use commit_verify::{CommitEncode, CommitEngine, CommitId, CommitmentId, DigestExt, Sha256}; use strict_encoding::{StrictDecode, StrictDeserialize, StrictEncode, StrictSerialize, StrictType}; use strict_types::TypeSystem; @@ -141,17 +141,21 @@ impl SchemaId { pub fn to_mnemonic(&self) -> String { self.to_baid58().mnemonic() } } -pub trait SchemaRoot: Clone + Eq + StrictType + StrictEncode + StrictDecode + Default {} -impl SchemaRoot for () {} -impl SchemaRoot for RootSchema {} +pub trait SchemaRoot: Clone + Eq + StrictType + StrictEncode + StrictDecode + Default { + fn schema_id(&self) -> SchemaId; +} +impl SchemaRoot for () { + fn schema_id(&self) -> SchemaId { SchemaId::from_byte_array([0u8; 32]) } +} +impl SchemaRoot for RootSchema { + fn schema_id(&self) -> SchemaId { self.schema_id() } +} pub type RootSchema = Schema<()>; pub type SubSchema = Schema; #[derive(Clone, Eq, Default, Debug)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict, id = SchemaId)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -169,12 +173,30 @@ pub struct Schema { pub transitions: TinyOrdMap, /// Type system - // TODO: Commit to type system id, not the type system itself pub type_system: TypeSystem, /// Validation code. pub script: Script, } +impl CommitEncode for Schema { + type CommitmentId = SchemaId; + + fn commit_encode(&self, e: &mut CommitEngine) { + e.commit_to(&self.ffv); + e.commit_to(&self.subset_of.as_ref().map(Root::schema_id)); + + e.commit_to(&self.global_types); + e.commit_to(&self.owned_types); + e.commit_to(&self.valency_types); + e.commit_to(&self.genesis); + e.commit_to(&self.extensions); + e.commit_to(&self.transitions); + + e.commit_to(&self.type_system.id()); + e.commit_to(&self.script); + } +} + impl PartialEq for Schema { fn eq(&self, other: &Self) -> bool { self.schema_id() == other.schema_id() } } From 63acdc55274ad92f094e7955f85ee4748d6c9542 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 18 Feb 2024 20:57:15 +0100 Subject: [PATCH 10/11] chore: update to new commitments --- Cargo.lock | 8 ++++---- Cargo.toml | 3 ++- src/contract/bundle.rs | 2 +- src/contract/commit.rs | 14 +++++++------- src/contract/operations.rs | 6 +++--- src/schema/schema.rs | 20 ++++++++++---------- 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b83f44f0..29748c30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "commit_encoding_derive" version = "0.11.0-beta.3" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#5359d8437f5e63289ad0a63ecb66a3bd7d42f816" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=layouts#49345a16d6125af5aab58b2b4e83f3bfd222b097" dependencies = [ "amplify", "amplify_syn", @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.3" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#5359d8437f5e63289ad0a63ecb66a3bd7d42f816" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=layouts#49345a16d6125af5aab58b2b4e83f3bfd222b097" dependencies = [ "amplify", "commit_encoding_derive", @@ -313,6 +313,7 @@ dependencies = [ "sha2", "strict_encoding", "strict_types", + "vesper-lang", ] [[package]] @@ -782,8 +783,7 @@ dependencies = [ [[package]] name = "strict_types" version = "2.7.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66de5cdf197b68e13fcac9fad7ed288f44052a319a3df3abbaba9c6e52f735b" +source = "git+https://github.com/strict-types/strict-types?branch=vesper#266f2d8b6e015522e9e7e72af663af9c9d3c7d2c" dependencies = [ "amplify", "baid58", diff --git a/Cargo.toml b/Cargo.toml index 4285c234..187dd164 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,8 @@ wasm-bindgen-test = "0.3" features = [ "all" ] [patch.crates-io] -commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "v0.11" } +strict_types = { git = "https://github.com/strict-types/strict-types", branch = "vesper" } +commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "layouts" } bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } diff --git a/src/contract/bundle.rs b/src/contract/bundle.rs index 8148cc40..bfb4582e 100644 --- a/src/contract/bundle.rs +++ b/src/contract/bundle.rs @@ -115,7 +115,7 @@ pub struct TransitionBundle { impl CommitEncode for TransitionBundle { type CommitmentId = BundleId; - fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.input_map); } + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to_serialized(&self.input_map); } } impl StrictDumb for TransitionBundle { diff --git a/src/contract/commit.rs b/src/contract/commit.rs index 462408fe..796615e4 100644 --- a/src/contract/commit.rs +++ b/src/contract/commit.rs @@ -331,9 +331,9 @@ impl ConcealedState { fn commit_encode(&self, e: &mut CommitEngine) { match self { ConcealedState::Void => {} - ConcealedState::Fungible(val) => e.commit_to(&val.commitment), - ConcealedState::Structured(dat) => e.commit_to(dat), - ConcealedState::Attachment(att) => e.commit_to(att), + ConcealedState::Fungible(val) => e.commit_to_serialized(&val.commitment), + ConcealedState::Structured(dat) => e.commit_to_serialized(dat), + ConcealedState::Attachment(att) => e.commit_to_serialized(att), } } } @@ -349,9 +349,9 @@ impl CommitEncode for AssignmentCommitment { type CommitmentId = MerkleHash; fn commit_encode(&self, e: &mut CommitEngine) { - e.commit_to(&self.ty); + e.commit_to_serialized(&self.ty); self.state.commit_encode(e); - e.commit_to(&self.seal); + e.commit_to_serialized(&self.seal); e.set_finished(); } } @@ -407,8 +407,8 @@ impl CommitEncode for GlobalCommitment { type CommitmentId = MerkleHash; fn commit_encode(&self, e: &mut CommitEngine) { - e.commit_to(&self.ty); - e.commit_to(&self.state); + e.commit_to_serialized(&self.ty); + e.commit_to_serialized(&self.state); e.set_finished(); } } diff --git a/src/contract/operations.rs b/src/contract/operations.rs index 426a620f..0d0eb58a 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -369,17 +369,17 @@ impl Conceal for Extension { impl CommitEncode for Genesis { type CommitmentId = OpId; - fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.commit()) } + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to_serialized(&self.commit()) } } impl CommitEncode for Transition { type CommitmentId = OpId; - fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.commit()) } + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to_serialized(&self.commit()) } } impl CommitEncode for Extension { type CommitmentId = OpId; - fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.commit()) } + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to_serialized(&self.commit()) } } impl Transition { diff --git a/src/schema/schema.rs b/src/schema/schema.rs index 2a904cc9..dfc4630c 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -182,18 +182,18 @@ impl CommitEncode for Schema { type CommitmentId = SchemaId; fn commit_encode(&self, e: &mut CommitEngine) { - e.commit_to(&self.ffv); - e.commit_to(&self.subset_of.as_ref().map(Root::schema_id)); + e.commit_to_serialized(&self.ffv); + e.commit_to_serialized(&self.subset_of.as_ref().map(Root::schema_id)); - e.commit_to(&self.global_types); - e.commit_to(&self.owned_types); - e.commit_to(&self.valency_types); - e.commit_to(&self.genesis); - e.commit_to(&self.extensions); - e.commit_to(&self.transitions); + e.commit_to_map(&self.global_types); + e.commit_to_map(&self.owned_types); + e.commit_to_set(&self.valency_types); + e.commit_to_serialized(&self.genesis); + e.commit_to_map(&self.extensions); + e.commit_to_map(&self.transitions); - e.commit_to(&self.type_system.id()); - e.commit_to(&self.script); + e.commit_to_serialized(&self.type_system.id()); + e.commit_to_serialized(&self.script); } } From cb66775f3a586adc124503fb3ea89b34fbcceadb Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 18 Feb 2024 21:08:19 +0100 Subject: [PATCH 11/11] stl: update vesper descriptions --- Cargo.lock | 4 +- src/bin/rgbcore-stl.rs | 43 ++++++- src/schema/schema.rs | 2 +- stl/AnchoredBundle.vesper | 234 +++++++++++++++++++------------------- stl/MerkleNode.vesper | 2 +- stl/Schema.vesper | 69 +++++++---- stl/Transition.vesper | 193 ++++++++++++++++++------------- 7 files changed, 324 insertions(+), 223 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29748c30..b0e27dd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "commit_encoding_derive" version = "0.11.0-beta.3" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=layouts#49345a16d6125af5aab58b2b4e83f3bfd222b097" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=layouts#d81288a7df7d52e5dfc4b2a17ad43780d6107cc4" dependencies = [ "amplify", "amplify_syn", @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.3" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=layouts#49345a16d6125af5aab58b2b4e83f3bfd222b097" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=layouts#d81288a7df7d52e5dfc4b2a17ad43780d6107cc4" dependencies = [ "amplify", "commit_encoding_derive", diff --git a/src/bin/rgbcore-stl.rs b/src/bin/rgbcore-stl.rs index cb000bf6..b3ecb9d5 100644 --- a/src/bin/rgbcore-stl.rs +++ b/src/bin/rgbcore-stl.rs @@ -21,11 +21,14 @@ // limitations under the License. use std::fs; +use std::io::Write; use aluvm::stl::aluvm_stl; use bp::stl::bp_core_stl; use commit_verify::stl::commit_verify_stl; +use commit_verify::CommitmentLayout; use rgb::stl::bp_tx_stl; +use rgb::{SubSchema, Transition}; use strict_types::stl::{std_stl, strict_types_stl}; use strict_types::typelib::parse_args; use strict_types::SystemBuilder; @@ -76,11 +79,45 @@ fn main() { let dir = dir.unwrap_or_else(|| ".".to_owned()); - let tt = sys.type_tree("RGB.Transition").unwrap(); - fs::write(format!("{dir}/Transition.vesper",), format!("{tt}")).unwrap(); + let mut file = fs::File::create(format!("{dir}/Schema.vesper")).unwrap(); + writeln!( + file, + "{{- + Description: RGB Schema + Author: Dr Maxim Orlovsky + Copyright (C) 2024 LNP/BP Standards Association. All rights reserved. + License: Apache-2.0 +-}} +Seals vesper lexicon=types+commitments +" + ) + .unwrap(); + let layout = SubSchema::commitment_layout(); + writeln!(file, "{layout}").unwrap(); let tt = sys.type_tree("RGB.Schema").unwrap(); - fs::write(format!("{dir}/Schema.vesper",), format!("{tt}")).unwrap(); + writeln!(file, "{tt}").unwrap(); + + let mut file = fs::File::create(format!("{dir}/Transition.vesper")).unwrap(); + writeln!( + file, + "{{- + Description: RGB Transition + Author: Dr Maxim Orlovsky + Copyright (C) 2024 LNP/BP Standards Association. All rights reserved. + License: Apache-2.0 +-}} + +Seals vesper lexicon=types+commitments +" + ) + .unwrap(); + let layout = Transition::commitment_layout(); + writeln!(file, "{layout}").unwrap(); + let tt = sys.type_tree("RGB.OpCommitment").unwrap(); + writeln!(file, "{tt}").unwrap(); + let tt = sys.type_tree("RGB.Transition").unwrap(); + writeln!(file, "{tt}").unwrap(); let tt = sys.type_tree("RGB.AnchoredBundle").unwrap(); fs::write(format!("{dir}/AnchoredBundle.vesper",), format!("{tt}")).unwrap(); diff --git a/src/schema/schema.rs b/src/schema/schema.rs index dfc4630c..cbd609dc 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -183,7 +183,7 @@ impl CommitEncode for Schema { fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to_serialized(&self.ffv); - e.commit_to_serialized(&self.subset_of.as_ref().map(Root::schema_id)); + e.commit_to_option(&self.subset_of.as_ref().map(Root::schema_id)); e.commit_to_map(&self.global_types); e.commit_to_map(&self.owned_types); diff --git a/stl/AnchoredBundle.vesper b/stl/AnchoredBundle.vesper index fe574b57..f03c04ea 100644 --- a/stl/AnchoredBundle.vesper +++ b/stl/AnchoredBundle.vesper @@ -1,96 +1,96 @@ AnchoredBundle rec - anchor union -- XChainAnchorSet - bitcoin union wrapped tag=0 -- AnchorSet - tapret rec wrapped tag=0 -- AnchorMerkleProofTapretProof + anchor union XChainAnchorSet + bitcoin union AnchorSet wrapped tag=0 + tapret rec AnchorMerkleProofTapretProof wrapped tag=0 txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash - dbcProof rec -- TapretProof - pathProof rec -- TapretPathProof - some union option wrapped tag=1 -- TapretNodePartner - rightBranch rec wrapped tag=2 -- TapretRightBranch + dbcProof rec TapretProof + pathProof rec TapretPathProof + some union TapretNodePartner option wrapped tag=1 + rightBranch rec TapretRightBranch wrapped tag=2 nonce is U8 - opret rec wrapped tag=1 -- AnchorMerkleProofOpretProof + opret rec AnchorMerkleProofOpretProof wrapped tag=1 txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash dbcProof is Unit aka=OpretProof dual rec tag=2 - tapret rec -- AnchorMerkleProofTapretProof + tapret rec AnchorMerkleProofTapretProof txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash - dbcProof rec -- TapretProof - pathProof rec -- TapretPathProof - some union option wrapped tag=1 -- TapretNodePartner - rightBranch rec wrapped tag=2 -- TapretRightBranch + dbcProof rec TapretProof + pathProof rec TapretPathProof + some union TapretNodePartner option wrapped tag=1 + rightBranch rec TapretRightBranch wrapped tag=2 nonce is U8 - opret rec -- AnchorMerkleProofOpretProof + opret rec AnchorMerkleProofOpretProof txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash dbcProof is Unit aka=OpretProof - liquid union wrapped tag=1 -- AnchorSet - tapret rec wrapped tag=0 -- AnchorMerkleProofTapretProof + liquid union AnchorSet wrapped tag=1 + tapret rec AnchorMerkleProofTapretProof wrapped tag=0 txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash - dbcProof rec -- TapretProof - pathProof rec -- TapretPathProof - some union option wrapped tag=1 -- TapretNodePartner - rightBranch rec wrapped tag=2 -- TapretRightBranch + dbcProof rec TapretProof + pathProof rec TapretPathProof + some union TapretNodePartner option wrapped tag=1 + rightBranch rec TapretRightBranch wrapped tag=2 nonce is U8 - opret rec wrapped tag=1 -- AnchorMerkleProofOpretProof + opret rec AnchorMerkleProofOpretProof wrapped tag=1 txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash dbcProof is Unit aka=OpretProof dual rec tag=2 - tapret rec -- AnchorMerkleProofTapretProof + tapret rec AnchorMerkleProofTapretProof txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash - dbcProof rec -- TapretProof - pathProof rec -- TapretPathProof - some union option wrapped tag=1 -- TapretNodePartner - rightBranch rec wrapped tag=2 -- TapretRightBranch + dbcProof rec TapretProof + pathProof rec TapretPathProof + some union TapretNodePartner option wrapped tag=1 + rightBranch rec TapretRightBranch wrapped tag=2 nonce is U8 - opret rec -- AnchorMerkleProofOpretProof + opret rec AnchorMerkleProofOpretProof txid bytes len=32 aka=Txid - mpcProof rec -- MerkleProof + mpcProof rec MerkleProof pos is U32 cofactor is U16 path list len=0..32 element bytes len=32 aka=MerkleHash dbcProof is Unit aka=OpretProof - bundle rec -- TransitionBundle + bundle rec TransitionBundle inputMap map len=1..MAX16 aka=InputMap key is U32 aka=Vout value bytes len=32 aka=OpId knownTransitions map len=1..MAX16 key bytes len=32 aka=OpId - Transition rec -- mapped to + value rec Transition ffv is U16 aka=Ffv contractId bytes len=32 aka=ContractId transitionType is U16 aka=TransitionType @@ -103,55 +103,55 @@ AnchoredBundle rec salt is U128 inputs set len=0..MAX8 aka=Inputs Input rec - prevOut rec -- Opout + prevOut rec Opout op bytes len=32 aka=OpId ty is U16 aka=AssignmentType no is U16 reserved bytes len=2 aka=ReservedBytes2 assignments map len=0..MAX8 aka=AssignmentsBlindSealTxPtr key is U16 aka=AssignmentType - TypedAssignsBlindSealTxPtr union -- mapped to + value union TypedAssignsBlindSealTxPtr declarative list len=0..MAX16 wrapped tag=0 AssignVoidStateBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state is Unit aka=VoidState confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 state is Unit aka=VoidState confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state is Unit aka=VoidState revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout @@ -160,164 +160,164 @@ AnchoredBundle rec fungible list len=0..MAX16 wrapped tag=1 AssignRevealedValueBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- ConcealedFungible + state rec ConcealedFungible commitment bytes len=33 aka=PedersenCommitment - rangeProof union -- RangeProof + rangeProof union RangeProof placeholder bytes len=512 wrapped aka=NoiseDumb tag=0 confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- ConcealedFungible + state rec ConcealedFungible commitment bytes len=33 aka=PedersenCommitment - rangeProof union -- RangeProof + rangeProof union RangeProof placeholder bytes len=512 wrapped aka=NoiseDumb tag=0 confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- RevealedFungible - value union -- FungibleState + state rec RevealedFungible + value union FungibleState bits64 is U64 wrapped tag=0 blinding bytes len=32 aka=BlindingFactor tag bytes len=32 aka=AssetTag revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- RevealedFungible - value union -- FungibleState + state rec RevealedFungible + value union FungibleState bits64 is U64 wrapped tag=0 blinding bytes len=32 aka=BlindingFactor tag bytes len=32 aka=AssetTag structured list len=0..MAX16 wrapped tag=2 AssignRevealedDataBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state bytes len=32 aka=ConcealedData confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 state bytes len=32 aka=ConcealedData confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- RevealedData + state rec RevealedData value bytes len=0..MAX16 aka=DataState salt is U128 revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- RevealedData + state rec RevealedData value bytes len=0..MAX16 aka=DataState salt is U128 attachment list len=0..MAX16 wrapped tag=3 AssignRevealedAttachBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state bytes len=32 aka=ConcealedAttach confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 state bytes len=32 aka=ConcealedAttach confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- RevealedAttach + state rec RevealedAttach id bytes len=32 aka=AttachId - mediaType enum any=255 -- MediaType + mediaType enum MediaType any=255 salt is U64 revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- RevealedAttach + state rec RevealedAttach id bytes len=32 aka=AttachId - mediaType enum any=255 -- MediaType + mediaType enum MediaType any=255 salt is U64 valencies set len=0..MAX8 aka=Valencies element is U16 aka=ValencyType diff --git a/stl/MerkleNode.vesper b/stl/MerkleNode.vesper index 379982c4..e6b28b01 100644 --- a/stl/MerkleNode.vesper +++ b/stl/MerkleNode.vesper @@ -1,5 +1,5 @@ MerkleNode rec - branching enum void=0 single=1 branch=2 -- NodeBranching + branching enum NodeBranching void=0 single=1 branch=2 depth is U8 width is U256 node1 bytes len=32 aka=MerkleHash diff --git a/stl/Schema.vesper b/stl/Schema.vesper index c5824b93..bd1b90e0 100644 --- a/stl/Schema.vesper +++ b/stl/Schema.vesper @@ -1,76 +1,106 @@ +{- + Description: RGB Schema + Author: Dr Maxim Orlovsky + Copyright (C) 2024 LNP/BP Standards Association. All rights reserved. + License: Apache-2.0 +-} + +Seals vesper lexicon=types+commitments + +SchemaId commitment hasher=SHA256 tagged=urn:lnp-bp:rgb:schema#2024-02-03 + Ffv serialized + SchemaId serialized + GlobalStateSchema map len=0..MAX8 + GlobalStateType mapKey + GlobalStateSchema mapValue + StateSchema map len=0..MAX8 + AssignmentType mapKey + StateSchema mapValue + ValencyType set len=0..MAX8 + ValencyType element + GenesisSchema serialized + ExtensionSchema map len=0..MAX8 + ExtensionType mapKey + ExtensionSchema mapValue + TransitionSchema map len=0..MAX8 + TransitionType mapKey + TransitionSchema mapValue + TypeSysId serialized + Script serialized + Schema rec ffv is U16 aka=Ffv some is Unit option wrapped tag=1 globalTypes map len=0..MAX8 key is U16 aka=GlobalStateType - GlobalStateSchema rec -- mapped to + value rec GlobalStateSchema semId bytes len=32 aka=SemId maxItems is U16 ownedTypes map len=0..MAX8 key is U16 aka=AssignmentType - StateSchema union -- mapped to + value union StateSchema declarative is Unit tag=0 - fungible enum wrapped unsigned64Bit=8 tag=1 -- FungibleType + fungible enum FungibleType wrapped unsigned64Bit=8 tag=1 structured bytes len=32 wrapped aka=SemId tag=2 - attachment enum wrapped any=255 tag=3 -- MediaType + attachment enum MediaType wrapped any=255 tag=3 valencyTypes set len=0..MAX8 element is U16 aka=ValencyType - genesis rec -- GenesisSchema + genesis rec GenesisSchema metadata bytes len=32 aka=SemId globals map len=0..MAX8 key is U16 aka=GlobalStateType - Occurrences rec -- mapped to + value rec Occurrences min is U16 max is U16 assignments map len=0..MAX8 key is U16 aka=AssignmentType - Occurrences rec -- mapped to + value rec Occurrences min is U16 max is U16 valencies set len=0..MAX8 element is U16 aka=ValencyType extensions map len=0..MAX8 key is U16 aka=ExtensionType - ExtensionSchema rec -- mapped to + value rec ExtensionSchema metadata bytes len=32 aka=SemId globals map len=0..MAX8 key is U16 aka=GlobalStateType - Occurrences rec -- mapped to + value rec Occurrences min is U16 max is U16 redeems set len=0..MAX8 element is U16 aka=ValencyType assignments map len=0..MAX8 key is U16 aka=AssignmentType - Occurrences rec -- mapped to + value rec Occurrences min is U16 max is U16 valencies set len=0..MAX8 element is U16 aka=ValencyType transitions map len=0..MAX8 key is U16 aka=TransitionType - TransitionSchema rec -- mapped to + value rec TransitionSchema metadata bytes len=32 aka=SemId globals map len=0..MAX8 key is U16 aka=GlobalStateType - Occurrences rec -- mapped to + value rec Occurrences min is U16 max is U16 inputs map len=0..MAX8 key is U16 aka=AssignmentType - Occurrences rec -- mapped to + value rec Occurrences min is U16 max is U16 assignments map len=0..MAX8 key is U16 aka=AssignmentType - Occurrences rec -- mapped to + value rec Occurrences min is U16 max is U16 valencies set len=0..MAX8 element is U16 aka=ValencyType typeSystem map len=0..MAX24 aka=TypeSystem key bytes len=32 aka=SemId - TySemId union -- mapped to + value union TySemId primitive is U8 wrapped aka=Primitive tag=0 unicode is Unit tag=1 enum set len=1..MAX8 wrapped aka=EnumVariants tag=2 @@ -79,7 +109,7 @@ Schema rec tag is U8 union map len=0..MAX8 wrapped aka=UnionVariantsSemId tag=3 key is U8 - VariantInfoSemId rec -- mapped to + value rec VariantInfoSemId name ascii len=1..100 aka=VariantName aka=Ident charset=AlphaNumLodash ty bytes len=32 aka=SemId tuple list len=1..MAX8 wrapped aka=UnnamedFieldsSemId tag=4 @@ -107,13 +137,14 @@ Schema rec Sizing rec min is U64 max is U64 - script union -- Script - aluVm rec wrapped tag=0 -- AluScript + script union Script + aluVm rec AluScript wrapped tag=0 libs map len=0..MAX8 key bytes len=32 aka=LibId value bytes len=0..MAX16 entryPoints map len=0..MAX16 key bytes len=3 - LibSite rec -- mapped to + value rec LibSite lib bytes len=32 aka=LibId pos is U16 + diff --git a/stl/Transition.vesper b/stl/Transition.vesper index 5c3f3d1b..faab95a2 100644 --- a/stl/Transition.vesper +++ b/stl/Transition.vesper @@ -1,3 +1,35 @@ +{- + Description: RGB Transition + Author: Dr Maxim Orlovsky + Copyright (C) 2024 LNP/BP Standards Association. All rights reserved. + License: Apache-2.0 +-} + +Seals vesper lexicon=types+commitments + +OpId commitment hasher=SHA256 tagged=urn:lnp-bp:rgb:operation#2024-02-03 + OpCommitment serialized + +OpCommitment rec + ffv is U16 aka=Ffv + opType union TypeCommitment + genesis rec BaseCommitment wrapped tag=0 + schemaId bytes len=32 aka=SchemaId + testnet enum Bool false=0 true=1 + altLayers1 bytes len=32 aka=StrictHash + transition tuple tag=1 + _ bytes len=32 aka=ContractId + _ is U16 aka=TransitionType + extension tuple tag=2 + _ bytes len=32 aka=ContractId + _ is U16 aka=ExtensionType + metadata bytes len=32 aka=StrictHash + globals bytes len=32 aka=MerkleHash + inputs bytes len=32 aka=MerkleHash + assignments bytes len=32 aka=MerkleHash + redeemed bytes len=32 aka=StrictHash + valencies bytes len=32 aka=StrictHash + Transition rec ffv is U16 aka=Ffv contractId bytes len=32 aka=ContractId @@ -11,55 +43,55 @@ Transition rec salt is U128 inputs set len=0..MAX8 aka=Inputs Input rec - prevOut rec -- Opout + prevOut rec Opout op bytes len=32 aka=OpId ty is U16 aka=AssignmentType no is U16 reserved bytes len=2 aka=ReservedBytes2 assignments map len=0..MAX8 aka=AssignmentsBlindSealTxPtr key is U16 aka=AssignmentType - TypedAssignsBlindSealTxPtr union -- mapped to + value union TypedAssignsBlindSealTxPtr declarative list len=0..MAX16 wrapped tag=0 AssignVoidStateBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state is Unit aka=VoidState confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 state is Unit aka=VoidState confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state is Unit aka=VoidState revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout @@ -68,164 +100,165 @@ Transition rec fungible list len=0..MAX16 wrapped tag=1 AssignRevealedValueBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- ConcealedFungible + state rec ConcealedFungible commitment bytes len=33 aka=PedersenCommitment - rangeProof union -- RangeProof + rangeProof union RangeProof placeholder bytes len=512 wrapped aka=NoiseDumb tag=0 confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- ConcealedFungible + state rec ConcealedFungible commitment bytes len=33 aka=PedersenCommitment - rangeProof union -- RangeProof + rangeProof union RangeProof placeholder bytes len=512 wrapped aka=NoiseDumb tag=0 confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- RevealedFungible - value union -- FungibleState + state rec RevealedFungible + value union FungibleState bits64 is U64 wrapped tag=0 blinding bytes len=32 aka=BlindingFactor tag bytes len=32 aka=AssetTag revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- RevealedFungible - value union -- FungibleState + state rec RevealedFungible + value union FungibleState bits64 is U64 wrapped tag=0 blinding bytes len=32 aka=BlindingFactor tag bytes len=32 aka=AssetTag structured list len=0..MAX16 wrapped tag=2 AssignRevealedDataBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state bytes len=32 aka=ConcealedData confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 state bytes len=32 aka=ConcealedData confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- RevealedData + state rec RevealedData value bytes len=0..MAX16 aka=DataState salt is U128 revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- RevealedData + state rec RevealedData value bytes len=0..MAX16 aka=DataState salt is U128 attachment list len=0..MAX16 wrapped tag=3 AssignRevealedAttachBlindSealTxPtr union confidential rec tag=0 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 state bytes len=32 aka=ConcealedAttach confidentialState rec tag=1 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 state bytes len=32 aka=ConcealedAttach confidentialSeal rec tag=2 - seal union -- XChainSecretSeal + seal union XChainSecretSeal bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 liquid bytes len=32 wrapped aka=SecretSeal tag=1 - state rec -- RevealedAttach + state rec RevealedAttach id bytes len=32 aka=AttachId - mediaType enum any=255 -- MediaType + mediaType enum MediaType any=255 salt is U64 revealed rec tag=3 - seal union -- XChainBlindSealTxPtr - bitcoin rec wrapped tag=0 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + seal union XChainBlindSealTxPtr + bitcoin rec BlindSealTxPtr wrapped tag=0 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - liquid rec wrapped tag=1 -- BlindSealTxPtr - method enum opretFirst=0 tapretFirst=1 -- Method - txid union -- TxPtr + liquid rec BlindSealTxPtr wrapped tag=1 + method enum Method opretFirst=0 tapretFirst=1 + txid union TxPtr witnessTx is Unit tag=0 txid bytes len=32 wrapped aka=Txid tag=1 vout is U32 aka=Vout blinding is U64 - state rec -- RevealedAttach + state rec RevealedAttach id bytes len=32 aka=AttachId - mediaType enum any=255 -- MediaType + mediaType enum MediaType any=255 salt is U64 valencies set len=0..MAX8 aka=Valencies element is U16 aka=ValencyType +