From eb27dae4a056c81589c07e056beb3637e82877b6 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 2 Feb 2024 22:07:10 +0100 Subject: [PATCH 01/29] chore: update strict types --- Cargo.lock | 92 ++++++++++++++++++++++++++++-------------- Cargo.toml | 4 +- src/contract/xchain.rs | 8 ++-- src/stl.rs | 2 +- 4 files changed, 70 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e4cc761..6ac1ac7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,9 +23,9 @@ dependencies = [ [[package]] name = "amplify" -version = "4.5.0" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8629db306c0bbeb0a402e2918bdcf0026b5ddb24c46460f3bf5410b350d98710" +checksum = "f8dd50780fa78a67bae725dd164bc993500656112815a9301fd8b797e9006803" dependencies = [ "amplify_apfloat", "amplify_derive", @@ -37,7 +37,7 @@ dependencies = [ "serde_json", "serde_yaml", "stringly_conversions", - "toml", + "toml 0.7.8", "wasm-bindgen", ] @@ -457,9 +457,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown", @@ -549,18 +549,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -683,22 +683,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -733,9 +733,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.29" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15e0ef66bf939a7c890a0bf6d5a733c70202225f9888a89ed5c62298b019129" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ "indexmap", "itoa", @@ -767,8 +767,7 @@ dependencies = [ [[package]] name = "strict_encoding" version = "2.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76decc8ac190a56ba7857c023b69ed52b781ed974c5a181eac62cdbfc99521" +source = "git+https://github.com/strict-types/strict-encoding?branch=ident#8f5b071efabb531fb4a4cfd099124d33f924daf7" dependencies = [ "amplify", "half", @@ -779,8 +778,7 @@ dependencies = [ [[package]] name = "strict_encoding_derive" version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37064ec285e2a633465eb525c8698eea51373dee889fe310e0d32df8343e7f4f" +source = "git+https://github.com/strict-types/strict-encoding?branch=ident#8f5b071efabb531fb4a4cfd099124d33f924daf7" dependencies = [ "amplify_syn", "heck", @@ -792,8 +790,7 @@ dependencies = [ [[package]] name = "strict_types" version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10cc45e67d452cfe0d87d4714c3250190d97479af3502bbd823651bfe0f505f" +source = "git+https://github.com/strict-types/strict-types?branch=vesper#1d71c87a853cb66657b8b73405ba951c1dbf7cf0" dependencies = [ "amplify", "baid58", @@ -805,7 +802,8 @@ dependencies = [ "serde_yaml", "sha2", "strict_encoding", - "toml", + "toml 0.8.8", + "vesper", ] [[package]] @@ -831,9 +829,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.43" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -857,7 +855,19 @@ checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "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", ] [[package]] @@ -869,7 +879,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.21.0", ] [[package]] @@ -881,6 +891,19 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_edit" +version = "0.19.15" +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.21.0" @@ -918,6 +941,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vesper" +version = "0.1.0" +source = "git+https://github.com/UBIDECO/vesper#18107cbbdffeb91d992dc7c76da0640aea152e8f" +dependencies = [ + "amplify", + "strict_encoding", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -945,7 +977,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -979,7 +1011,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1012,7 +1044,7 @@ checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d573d49c..719f81a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ name = "rgbcore-stl" required-features = ["stl"] [dependencies] -amplify = { version = "~4.5.0", features = ["rand"] } +amplify = { version = "~4.5.1", features = ["rand"] } strict_encoding = "~2.6.2" strict_types = "~1.6.3" aluvm = { version = "~0.11.0-beta.2", features = ["std"] } @@ -62,4 +62,6 @@ wasm-bindgen-test = "0.3" features = [ "all" ] [patch.crates-io] +strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "ident" } +strict_types = { git = "https://github.com/strict-types/strict-types", branch = "vesper" } bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" } diff --git a/src/contract/xchain.rs b/src/contract/xchain.rs index 4510f0eb..d0e4aec4 100644 --- a/src/contract/xchain.rs +++ b/src/contract/xchain.rs @@ -161,12 +161,12 @@ where T: StrictDumb + StrictEncode fn strict_encode(&self, writer: W) -> io::Result { writer.write_union::(|w| { let w = w - .define_newtype::(fname!(Self::ALL_VARIANTS[0].1)) - .define_newtype::(fname!(Self::ALL_VARIANTS[1].1)) + .define_newtype::(vname!(Self::ALL_VARIANTS[0].1)) + .define_newtype::(vname!(Self::ALL_VARIANTS[1].1)) .complete(); Ok(match self { - XChain::Bitcoin(t) => w.write_newtype(fname!(Self::ALL_VARIANTS[0].1), t)?, - XChain::Liquid(t) => w.write_newtype(fname!(Self::ALL_VARIANTS[1].1), t)?, + XChain::Bitcoin(t) => w.write_newtype(vname!(Self::ALL_VARIANTS[0].1), t)?, + XChain::Liquid(t) => w.write_newtype(vname!(Self::ALL_VARIANTS[1].1), t)?, } .complete()) }) diff --git a/src/stl.rs b/src/stl.rs index 4d173aa6..2432fe1d 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -32,7 +32,7 @@ use crate::{AnchoredBundle, ContractState, Extension, Genesis, SubSchema, LIB_NA /// Strict types id for the library providing data types for RGB consensus. pub const LIB_ID_RGB: &str = - "urn:ubideco:stl:141hHBYBr2mzKyskZbRuwazYC9ki5x9ZrrzQHLbgBzx#oscar-rufus-tractor"; + "urn:ubideco:stl:3oFaATCYpF47hyS8HJzVvdDRpJNJnggKo1zcqDBBLNYi#sphere-barbara-cecilia"; fn _rgb_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_RGB), tiny_bset! { From 8a63774fa36bbcbdf083988070a26f3d2308ac5c Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 3 Feb 2024 22:47:49 +0100 Subject: [PATCH 02/29] critical: update to new commitment workflows --- Cargo.lock | 161 +++++++++++++++++------------------- Cargo.toml | 2 + src/contract/assignments.rs | 84 +------------------ src/contract/attachment.rs | 4 - src/contract/bundle.rs | 25 +++--- src/contract/data.rs | 16 +--- src/contract/fungible.rs | 34 +------- src/contract/global.rs | 2 - src/contract/operations.rs | 49 +++++------ src/contract/seal.rs | 16 +--- src/contract/state.rs | 7 +- src/contract/xchain.rs | 11 +-- src/lib.rs | 2 - src/schema/schema.rs | 28 +++---- src/stl.rs | 2 +- 15 files changed, 136 insertions(+), 307 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ac1ac7f..c8a58122 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,8 +5,7 @@ version = 3 [[package]] name = "aluvm" version = "0.11.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10be187b383247e1902aa5a415f76ffc9a04f197829c46b9ccb6da3582e394f" +source = "git+https://github.com/AluVM/rust-aluvm?branch=v0.11#084d3b96dde13b666917783849c30e35bd150548" dependencies = [ "amplify", "baid58", @@ -144,12 +143,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" -[[package]] -name = "base64" -version = "0.21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" - [[package]] name = "base85" version = "2.0.0" @@ -196,7 +189,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#02b26aeccf66c1c5a92427cd05550e49fde7f5eb" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" dependencies = [ "amplify", "chrono", @@ -210,7 +203,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#02b26aeccf66c1c5a92427cd05550e49fde7f5eb" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" dependencies = [ "amplify", "bp-consensus", @@ -228,7 +221,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#02b26aeccf66c1c5a92427cd05550e49fde7f5eb" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" dependencies = [ "amplify", "base85", @@ -242,7 +235,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#02b26aeccf66c1c5a92427cd05550e49fde7f5eb" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" dependencies = [ "amplify", "baid58", @@ -284,9 +277,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", @@ -298,9 +291,8 @@ dependencies = [ [[package]] name = "commit_encoding_derive" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00033f14d67c4169d588f085ea2faeb7b610cf03a74d42ea09eeba31abef2047" +version = "0.11.0-beta.3" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#ca6866221b9cdcd9d68297753cf75af57aa7ef86" dependencies = [ "amplify", "amplify_syn", @@ -312,8 +304,7 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e001679b9be6a5df24facdae179e6ba1cffb503c875d691eac024db8d0f8d1" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#ca6866221b9cdcd9d68297753cf75af57aa7ef86" dependencies = [ "amplify", "commit_encoding_derive", @@ -349,9 +340,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -400,9 +391,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "js-sys", @@ -434,9 +425,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -473,9 +464,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -488,9 +479,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "log" @@ -640,9 +631,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "secp256k1" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f622567e3b4b38154fb8190bcf6b160d7a4301d70595a49195b48c116007a27" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "rand", "secp256k1-sys", @@ -703,9 +694,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -767,7 +758,7 @@ dependencies = [ [[package]] name = "strict_encoding" version = "2.6.2" -source = "git+https://github.com/strict-types/strict-encoding?branch=ident#8f5b071efabb531fb4a4cfd099124d33f924daf7" +source = "git+https://github.com/strict-types/strict-encoding?branch=ident#9c20b327178b449cbb24a18c7db65edeb50a9d5b" dependencies = [ "amplify", "half", @@ -778,7 +769,7 @@ dependencies = [ [[package]] name = "strict_encoding_derive" version = "2.0.1" -source = "git+https://github.com/strict-types/strict-encoding?branch=ident#8f5b071efabb531fb4a4cfd099124d33f924daf7" +source = "git+https://github.com/strict-types/strict-encoding?branch=ident#9c20b327178b449cbb24a18c7db65edeb50a9d5b" dependencies = [ "amplify_syn", "heck", @@ -790,11 +781,11 @@ dependencies = [ [[package]] name = "strict_types" version = "1.6.3" -source = "git+https://github.com/strict-types/strict-types?branch=vesper#1d71c87a853cb66657b8b73405ba951c1dbf7cf0" +source = "git+https://github.com/strict-types/strict-types?branch=vesper#b424b47eff526088417eccf85441211db4f953a1" dependencies = [ "amplify", "baid58", - "base64", + "base85", "half", "indexmap", "serde", @@ -802,7 +793,7 @@ dependencies = [ "serde_yaml", "sha2", "strict_encoding", - "toml 0.8.8", + "toml 0.8.9", "vesper", ] @@ -840,18 +831,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -872,14 +863,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.21.1", ] [[package]] @@ -906,9 +897,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "serde", @@ -958,9 +949,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -968,9 +959,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -983,9 +974,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -995,9 +986,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1005,9 +996,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -1018,15 +1009,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-bindgen-test" -version = "0.3.39" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf9242c0d27999b831eae4767b2a146feb0b27d332d553e605864acd2afd403" +checksum = "139bd73305d50e1c1c4333210c0db43d989395b64a237bd35c10ef3832a7f70c" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1038,9 +1029,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.39" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" +checksum = "70072aebfe5da66d2716002c729a14e4aec4da0e23cc2ea66323dac541c93928" dependencies = [ "proc-macro2", "quote", @@ -1049,9 +1040,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -1059,18 +1050,18 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1083,51 +1074,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.31" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 719f81a7..f59cdd98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,4 +64,6 @@ features = [ "all" ] [patch.crates-io] strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "ident" } strict_types = { git = "https://github.com/strict-types/strict-types", branch = "vesper" } +commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", 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/assignments.rs b/src/contract/assignments.rs index 77587c45..ae3e707f 100644 --- a/src/contract/assignments.rs +++ b/src/contract/assignments.rs @@ -24,12 +24,10 @@ use core::cmp::Ordering; use core::fmt::Debug; use std::collections::BTreeSet; use std::hash::{Hash, Hasher}; -use std::{io, vec}; use amplify::confinement::{Confined, SmallVec, TinyOrdMap}; -use commit_verify::merkle::{MerkleLeaves, MerkleNode}; -use commit_verify::{CommitEncode, CommitStrategy, CommitmentId, Conceal}; -use strict_encoding::{StrictDumb, StrictEncode, StrictWriter}; +use commit_verify::Conceal; +use strict_encoding::{StrictDumb, StrictEncode}; use super::ExposedState; use crate::contract::seal::GenesisSeal; @@ -231,40 +229,6 @@ where Self: Clone } } -// We do not derive here since we omit serialization of the tag: all data are -// concealed, thus no tag is needed. -impl CommitEncode for Assign -where Self: Clone -{ - fn commit_encode(&self, e: &mut impl io::Write) { - match self { - Assign::Confidential { seal, state } => { - seal.commit_encode(e); - state.commit_encode(e); - } - Assign::ConfidentialState { seal, state } => { - seal.conceal().commit_encode(e); - state.commit_encode(e); - } - Assign::Revealed { seal, state } => { - seal.conceal().commit_encode(e); - state.commit_encode(e); - } - Assign::ConfidentialSeal { seal, state } => { - seal.commit_encode(e); - state.commit_encode(e); - } - } - } -} - -impl CommitmentId for Assign -where Self: Clone -{ - const TAG: [u8; 32] = *b"urn:lnpbp:rgb:owned-state:v1#23A"; - type Id = MerkleNode; -} - impl Assign { pub fn transmutate_seals(&self) -> Assign { match self { @@ -553,38 +517,6 @@ impl TypedAssigns { } } -impl CommitStrategy for TypedAssigns { - type Strategy = - commit_verify::strategies::Merklize<{ u128::from_be_bytes(*b"rgb:state:owned*") }>; -} - -impl MerkleLeaves for TypedAssigns { - type Leaf = MerkleNode; - type LeafIter<'tmp> = vec::IntoIter where Self: 'tmp; - - fn merkle_leaves(&self) -> Self::LeafIter<'_> { - match self { - TypedAssigns::Declarative(vec) => vec - .iter() - .map(AssignRights::commitment_id) - .collect::>(), - TypedAssigns::Fungible(vec) => vec - .iter() - .map(AssignFungible::commitment_id) - .collect::>(), - TypedAssigns::Structured(vec) => vec - .iter() - .map(AssignData::commitment_id) - .collect::>(), - TypedAssigns::Attachment(vec) => vec - .iter() - .map(AssignAttach::commitment_id) - .collect::>(), - } - .into_iter() - } -} - impl TypedAssigns { pub fn transmutate_seals(&self) -> TypedAssigns { match self { @@ -629,18 +561,6 @@ impl Default for Assignments { fn default() -> Self { Self(empty!()) } } -impl CommitEncode for Assignments { - fn commit_encode(&self, mut e: &mut impl io::Write) { - let w = StrictWriter::with(u32::MAX as usize, &mut e); - self.0.len_u8().strict_encode(w).ok(); - for (ty, state) in &self.0 { - let w = StrictWriter::with(u32::MAX as usize, &mut e); - ty.strict_encode(w).ok(); - state.commit_encode(e); - } - } -} - impl Assignments { pub fn transmutate_seals(&self) -> Assignments { Assignments( diff --git a/src/contract/attachment.rs b/src/contract/attachment.rs index 248a3244..e50eaaf9 100644 --- a/src/contract/attachment.rs +++ b/src/contract/attachment.rs @@ -67,8 +67,6 @@ impl AttachId { #[derive(Clone, PartialOrd, Ord, PartialEq, Eq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(conceal, strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -128,8 +126,6 @@ impl Conceal for RevealedAttach { #[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), diff --git a/src/contract/bundle.rs b/src/contract/bundle.rs index 0da66199..d708424a 100644 --- a/src/contract/bundle.rs +++ b/src/contract/bundle.rs @@ -21,13 +21,12 @@ // limitations under the License. use std::collections::BTreeMap; -use std::io::Write; use amplify::confinement::{Confined, U16}; use amplify::{Bytes32, Wrapper}; use bp::Vout; -use commit_verify::{mpc, CommitEncode, CommitmentId}; -use strict_encoding::{StrictDumb, StrictEncode, StrictWriter}; +use commit_verify::{mpc, CommitEncode, CommitEngine, CommitId, CommitmentId, DigestExt, Sha256}; +use strict_encoding::{StrictDumb, StrictEncode}; use super::OpId; use crate::{Transition, LIB_NAME_RGB}; @@ -51,6 +50,14 @@ pub struct BundleId( Bytes32, ); +impl From for BundleId { + fn from(hasher: Sha256) -> Self { hasher.finish().into() } +} + +impl CommitmentId for BundleId { + const TAG: &'static str = "urn:lnpbp:rgb:bundle#2024-02-03"; +} + impl From for mpc::Message { fn from(id: BundleId) -> Self { mpc::Message::from_inner(id.into_inner()) } } @@ -73,15 +80,9 @@ pub struct TransitionBundle { } impl CommitEncode for TransitionBundle { - fn commit_encode(&self, e: &mut impl Write) { - let w = StrictWriter::with(u32::MAX as usize, e); - self.input_map.strict_encode(w).ok(); - } -} + type CommitmentId = BundleId; -impl CommitmentId for TransitionBundle { - const TAG: [u8; 32] = *b"urn:lnpbp:rgb:bundle:v1#20230306"; - type Id = BundleId; + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.input_map); } } impl StrictDumb for TransitionBundle { @@ -94,5 +95,5 @@ impl StrictDumb for TransitionBundle { } impl TransitionBundle { - pub fn bundle_id(&self) -> BundleId { self.commitment_id() } + pub fn bundle_id(&self) -> BundleId { self.commit_id() } } diff --git a/src/contract/data.rs b/src/contract/data.rs index a4eed1d5..b3750339 100644 --- a/src/contract/data.rs +++ b/src/contract/data.rs @@ -22,13 +22,12 @@ use core::fmt::{self, Debug, Formatter}; use std::cmp::Ordering; -use std::io::Write; use amplify::confinement::SmallBlob; use amplify::hex::ToHex; use amplify::{Bytes32, Wrapper}; use bp::secp256k1::rand::{random, Rng, RngCore}; -use commit_verify::{CommitEncode, CommitVerify, Conceal, StrictEncodedProtocol}; +use commit_verify::{CommitVerify, Conceal, StrictEncodedProtocol}; use strict_encoding::{StrictSerialize, StrictType}; use super::{ConfidentialState, ExposedState}; @@ -39,8 +38,6 @@ use crate::{StateCommitment, StateData, StateType, LIB_NAME_RGB}; #[display("void")] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] pub struct VoidState(()); @@ -65,8 +62,6 @@ impl Conceal for VoidState { #[wrapper(Deref, AsSlice, BorrowSlice, Hex)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] pub struct DataState(SmallBlob); impl StrictSerialize for DataState {} @@ -116,13 +111,6 @@ impl Conceal for RevealedData { fn conceal(&self) -> Self::Concealed { ConcealedData::commit(self) } } -impl CommitEncode for RevealedData { - fn commit_encode(&self, e: &mut impl Write) { - e.write_all(&self.value).ok(); - e.write_all(&self.salt.to_le_bytes()).ok(); - } -} - impl PartialOrd for RevealedData { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } @@ -154,8 +142,6 @@ impl Debug for RevealedData { #[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB, rename = "ConcealedData")] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), diff --git a/src/contract/fungible.rs b/src/contract/fungible.rs index c3571e67..cf89a7f0 100644 --- a/src/contract/fungible.rs +++ b/src/contract/fungible.rs @@ -36,7 +36,6 @@ use core::num::ParseIntError; use core::ops::Deref; use core::str::FromStr; use std::io; -use std::io::Write; use amplify::confinement::U8; use amplify::hex::ToHex; @@ -46,7 +45,7 @@ use amplify::{hex, Array, Bytes32, Wrapper}; use bp::secp256k1::rand::thread_rng; use chrono::{DateTime, Utc}; use commit_verify::{ - CommitEncode, CommitVerify, CommitmentProtocol, Conceal, DigestExt, Sha256, UntaggedProtocol, + CommitVerify, CommitmentProtocol, Conceal, DigestExt, Sha256, UntaggedProtocol, }; use secp256k1_zkp::rand::{Rng, RngCore}; use secp256k1_zkp::SECP256K1; @@ -337,15 +336,6 @@ impl Conceal for RevealedValue { fn conceal(&self) -> Self::Concealed { ConcealedValue::commit(self) } } -// We need this manual implementation while conceal procedure is inaccessible -// w/o bulletproofs operational -impl CommitEncode for RevealedValue { - fn commit_encode(&self, e: &mut impl Write) { - let commitment = PedersenCommitment::commit(self); - commitment.commit_encode(e); - } -} - impl PartialOrd for RevealedValue { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } @@ -364,8 +354,6 @@ impl Ord for RevealedValue { #[wrapper(Deref, FromStr, Display, LowerHex)] #[derive(StrictType)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -468,7 +456,6 @@ impl CommitmentProtocol for PedersenProtocol {} #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB, rename = "ConcealedFungible")] -#[derive(CommitEncode)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -478,7 +465,6 @@ pub struct ConcealedValue { /// Pedersen commitment to the original [`FungibleState`]. pub commitment: PedersenCommitment, /// Range proof for the [`FungibleState`] not exceeding type boundaries. - #[commit_encode(skip)] pub range_proof: RangeProof, } @@ -534,28 +520,10 @@ impl ConcealedValue { #[cfg(test)] mod test { - use std::collections::HashSet; - use amplify::ByteArray; use super::*; - #[test] - fn commitments_determinism() { - let tag = AssetTag::from_byte_array([1u8; 32]); - - let value = RevealedValue::with_rng(15, &mut thread_rng(), tag); - - let generators = (0..10) - .map(|_| { - let mut val = vec![]; - value.commit_encode(&mut val); - val - }) - .collect::>(); - assert_eq!(generators.len(), 1); - } - #[test] fn pedersen_blinding_mismatch() { let mut r = thread_rng(); diff --git a/src/contract/global.rs b/src/contract/global.rs index 1cf4f4c1..c0119fc4 100644 --- a/src/contract/global.rs +++ b/src/contract/global.rs @@ -61,8 +61,6 @@ impl IntoIterator for GlobalValues { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), diff --git a/src/contract/operations.rs b/src/contract/operations.rs index 38e0c027..83fd4261 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -29,7 +29,7 @@ use amplify::confinement::{SmallBlob, TinyOrdMap, TinyOrdSet}; use amplify::hex::{FromHex, ToHex}; use amplify::{hex, ByteArray, Bytes32, FromSliceError, Wrapper}; use baid58::{Baid58ParseError, Chunking, FromBaid58, ToBaid58, CHUNKING_32CHECKSUM}; -use commit_verify::{mpc, CommitmentId, Conceal}; +use commit_verify::{mpc, CommitId, CommitmentId, Conceal, DigestExt, Sha256}; use strict_encoding::{StrictDeserialize, StrictEncode, StrictSerialize}; use crate::schema::{self, ExtensionType, OpFullType, OpType, SchemaId, TransitionType}; @@ -43,8 +43,6 @@ use crate::{ #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -64,8 +62,6 @@ impl<'a> IntoIterator for &'a Valencies { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -85,8 +81,6 @@ impl<'a> IntoIterator for &'a Redeemed { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -142,6 +136,14 @@ pub struct OpId( Bytes32, ); +impl From for OpId { + fn from(hasher: Sha256) -> Self { hasher.finish().into() } +} + +impl CommitmentId for OpId { + const TAG: &'static str = "urn:lnpbp:rgb:operation#2024-02-03"; +} + impl FromStr for OpId { type Err = hex::Error; fn from_str(s: &str) -> Result { Self::from_hex(s) } @@ -266,6 +268,7 @@ pub trait Operation { #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] #[derive(CommitEncode)] +#[commit_encode(strategy = conceal, id = OpId)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -278,6 +281,7 @@ pub struct Genesis { pub alt_layers1: AltLayer1Set, pub metadata: SmallBlob, pub globals: GlobalState, + // TODO: Merklize assignments for the commitment pub assignments: Assignments, pub valencies: Valencies, } @@ -289,6 +293,7 @@ impl StrictDeserialize for Genesis {} #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] #[derive(CommitEncode)] +#[commit_encode(strategy = conceal, id = OpId)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -300,6 +305,7 @@ pub struct Extension { pub extension_type: ExtensionType, pub metadata: SmallBlob, pub globals: GlobalState, + // TODO: Merklize assignments for the commitment pub assignments: Assignments, pub redeemed: Redeemed, pub valencies: Valencies, @@ -312,6 +318,7 @@ impl StrictDeserialize for Extension {} #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] #[derive(CommitEncode)] +#[commit_encode(strategy = conceal, id = OpId)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -324,6 +331,7 @@ pub struct Transition { pub metadata: SmallBlob, pub globals: GlobalState, pub inputs: Inputs, + // TODO: Merklize assignments for the commitment pub assignments: Assignments, pub valencies: Valencies, } @@ -332,7 +340,7 @@ impl StrictSerialize for Transition {} impl StrictDeserialize for Transition {} impl Conceal for Genesis { - type Concealed = Genesis; + type Concealed = Self; fn conceal(&self) -> Self::Concealed { let mut concealed = self.clone(); concealed @@ -343,13 +351,8 @@ impl Conceal for Genesis { } } -impl CommitmentId for Genesis { - const TAG: [u8; 32] = *b"urn:lnpbp:rgb:genesis:v02#202304"; - type Id = ContractId; -} - impl Conceal for Transition { - type Concealed = Transition; + type Concealed = Self; fn conceal(&self) -> Self::Concealed { let mut concealed = self.clone(); concealed @@ -360,13 +363,8 @@ impl Conceal for Transition { } } -impl CommitmentId for Transition { - const TAG: [u8; 32] = *b"urn:lnpbp:rgb:transition:v02#23B"; - type Id = OpId; -} - impl Conceal for Extension { - type Concealed = Extension; + type Concealed = Self; fn conceal(&self) -> Self::Concealed { let mut concealed = self.clone(); concealed @@ -377,11 +375,6 @@ impl Conceal for Extension { } } -impl CommitmentId for Extension { - const TAG: [u8; 32] = *b"urn:lnpbp:rgb:extension:v02#2304"; - type Id = OpId; -} - impl Transition { /// Returns reference to information about the owned rights in form of /// [`Inputs`] wrapper structure which this operation updates with @@ -406,7 +399,7 @@ impl Operation for Genesis { fn full_type(&self) -> OpFullType { OpFullType::Genesis } #[inline] - fn id(&self) -> OpId { OpId(self.commitment_id().into_inner()) } + fn id(&self) -> OpId { OpId(self.commit_id().into_inner()) } #[inline] fn contract_id(&self) -> ContractId { ContractId::from_inner(self.id().into_inner()) } @@ -448,7 +441,7 @@ impl Operation for Extension { fn full_type(&self) -> OpFullType { OpFullType::StateExtension(self.extension_type) } #[inline] - fn id(&self) -> OpId { self.commitment_id() } + fn id(&self) -> OpId { self.commit_id() } #[inline] fn contract_id(&self) -> ContractId { self.contract_id } @@ -490,7 +483,7 @@ impl Operation for Transition { fn full_type(&self) -> OpFullType { OpFullType::StateTransition(self.transition_type) } #[inline] - fn id(&self) -> OpId { self.commitment_id() } + fn id(&self) -> OpId { self.commit_id() } #[inline] fn contract_id(&self) -> ContractId { self.contract_id } diff --git a/src/contract/seal.rs b/src/contract/seal.rs index 3bb0c6a2..c5720074 100644 --- a/src/contract/seal.rs +++ b/src/contract/seal.rs @@ -23,7 +23,6 @@ use core::fmt::Debug; use std::cmp::Ordering; use std::hash::Hash; -use std::io::Write; use std::num::NonZeroU32; use bp::dbc::Method; @@ -32,7 +31,7 @@ pub use bp::seals::txout::TxoSeal; use bp::seals::txout::{BlindSeal, CloseMethod, ExplicitSeal, SealTxid, VerifyError, Witness}; pub use bp::seals::SecretSeal; use bp::{dbc, Outpoint, Tx, Txid, Vout}; -use commit_verify::{mpc, strategies, CommitEncode, CommitStrategy, Conceal}; +use commit_verify::{mpc, Conceal}; use single_use_seals::SealWitness; use strict_encoding::{StrictDecode, StrictDumb, StrictEncode, StrictType}; @@ -275,23 +274,12 @@ impl SealWitness for XWitness { } } -impl CommitStrategy for XChain> { - type Strategy = strategies::Strict; -} - impl XChain> { /// Converts revealed seal into concealed. #[inline] pub fn to_secret_seal(&self) -> XChain { self.conceal() } } -impl CommitEncode for XChain { - fn commit_encode(&self, e: &mut impl Write) { - e.write_all(&[self.layer1() as u8]).ok(); - self.as_reduced_unsafe().commit_encode(e); - } -} - #[cfg(test)] mod test { use amplify::hex::FromHex; @@ -313,7 +301,7 @@ mod test { let secret = reveal.to_secret_seal(); assert_eq!( secret.to_string(), - "bc:utxob:6JZb8te-bSUsZzCJk-op9E4D8zf-SHTDu2t4W-T21NaPNnb-58DFM9" + "bc:utxob:MEtUtHY-Nk2QBNbkL-vnV1aAHcx-eYAwSr16Q-qGa5tKND8-MR3WG6" ); assert_eq!(reveal.to_secret_seal(), reveal.conceal()) } diff --git a/src/contract/state.rs b/src/contract/state.rs index 82b60c34..911dcbd9 100644 --- a/src/contract/state.rs +++ b/src/contract/state.rs @@ -23,7 +23,7 @@ use core::fmt::Debug; use core::hash::Hash; -use commit_verify::{CommitEncode, Conceal}; +use commit_verify::Conceal; use strict_encoding::{StrictDecode, StrictDumb, StrictEncode}; use crate::{ @@ -34,7 +34,7 @@ use crate::{ /// Marker trait for types of state which are just a commitment to the actual /// state data. pub trait ConfidentialState: - Debug + Hash + StrictDumb + StrictEncode + StrictDecode + CommitEncode + Eq + Copy + Debug + Hash + StrictDumb + StrictEncode + StrictDecode + Eq + Copy { fn state_type(&self) -> StateType; fn state_commitment(&self) -> StateCommitment; @@ -47,7 +47,6 @@ pub trait ExposedState: + StrictEncode + StrictDecode + Conceal - + CommitEncode + Eq + Ord + Clone @@ -84,7 +83,6 @@ pub enum StateType { #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB, tags = custom)] -#[derive(CommitEncode)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -129,7 +127,6 @@ impl Conceal for StateData { #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB, tags = custom)] -#[derive(CommitEncode)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), diff --git a/src/contract/xchain.rs b/src/contract/xchain.rs index d0e4aec4..560f74ca 100644 --- a/src/contract/xchain.rs +++ b/src/contract/xchain.rs @@ -22,13 +22,12 @@ use std::cmp::Ordering; use std::fmt::{Debug, Display, Formatter}; -use std::io::Write; use std::str::FromStr; use std::{fmt, io}; use amplify::confinement::TinyOrdSet; use bp::{Bp, Outpoint}; -use commit_verify::{CommitEncode, Conceal}; +use commit_verify::Conceal; use strict_encoding::{ DecodeError, DefineUnion, ReadTuple, ReadUnion, StrictDecode, StrictDumb, StrictEncode, StrictSum, StrictType, StrictUnion, TypedRead, TypedWrite, WriteUnion, @@ -89,14 +88,6 @@ impl AltLayer1 { )] pub struct AltLayer1Set(TinyOrdSet); -impl CommitEncode for AltLayer1Set { - fn commit_encode(&self, e: &mut impl Write) { - for c in self.iter() { - e.write_all(&[*c as u8]).ok(); - } - } -} - #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] #[cfg_attr( feature = "serde", diff --git a/src/lib.rs b/src/lib.rs index 8062fdca..769dfb6c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -101,8 +101,6 @@ mod _reserved { #[display("RGB/1.{0}")] #[derive(StrictType, StrictEncode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = strict)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), diff --git a/src/schema/schema.rs b/src/schema/schema.rs index b5440d8e..398a1bd7 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::{CommitStrategy, CommitmentId}; +use commit_verify::{CommitId, CommitmentId, DigestExt, Sha256}; use strict_encoding::{StrictDecode, StrictDeserialize, StrictEncode, StrictSerialize, StrictType}; use strict_types::TypeSystem; @@ -57,7 +57,6 @@ impl GlobalStateType { #[display("0x{0:04X}")] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -73,7 +72,6 @@ impl ExtensionType { #[display("0x{0:04X}")] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -90,7 +88,7 @@ impl TransitionType { /// Schema identifier. /// -/// Schema identifier commits to all of the schema data. +/// Schema identifier commits to all the schema data. #[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)] #[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] @@ -106,6 +104,14 @@ pub struct SchemaId( Bytes32, ); +impl From for SchemaId { + fn from(hasher: Sha256) -> Self { hasher.finish().into() } +} + +impl CommitmentId for SchemaId { + const TAG: &'static str = "urn:lnpbp:rgb:schema#2024-02-03"; +} + impl ToBaid58<32> for SchemaId { const HRI: &'static str = "sc"; const CHUNKING: Option = CHUNKING_32; @@ -144,6 +150,8 @@ 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), @@ -161,6 +169,7 @@ 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, @@ -178,21 +187,12 @@ impl PartialOrd for Schema { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } -impl CommitStrategy for Schema { - type Strategy = commit_verify::strategies::Strict; -} - -impl CommitmentId for Schema { - const TAG: [u8; 32] = *b"urn:lnpbp:rgb:schema:v01#202302A"; - type Id = SchemaId; -} - impl StrictSerialize for Schema {} impl StrictDeserialize for Schema {} impl Schema { #[inline] - pub fn schema_id(&self) -> SchemaId { self.commitment_id() } + pub fn schema_id(&self) -> SchemaId { self.commit_id() } pub fn blank_transition(&self) -> TransitionSchema { let mut schema = TransitionSchema::default(); diff --git a/src/stl.rs b/src/stl.rs index 2432fe1d..f1c9c4ca 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -32,7 +32,7 @@ use crate::{AnchoredBundle, ContractState, Extension, Genesis, SubSchema, LIB_NA /// Strict types id for the library providing data types for RGB consensus. pub const LIB_ID_RGB: &str = - "urn:ubideco:stl:3oFaATCYpF47hyS8HJzVvdDRpJNJnggKo1zcqDBBLNYi#sphere-barbara-cecilia"; + "urn:ubideco:stl:ENn5cEDW7QUStLzY6HBXjZFARAbrGHv3tXmdQ3QGzoU3#option-data-mimosa"; fn _rgb_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_RGB), tiny_bset! { From b732f048afb9bab18a0267ad4417878cc5a3deb6 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 3 Feb 2024 22:47:57 +0100 Subject: [PATCH 03/29] stl: update to new syntax --- stl/RGB@0.1.0.sta | 638 ++++++++++++++++++++++------------------------ stl/RGB@0.1.0.stl | Bin 15398 -> 15493 bytes stl/RGB@0.1.0.sty | 561 +++++++++++++++++++++++----------------- 3 files changed, 631 insertions(+), 568 deletions(-) diff --git a/stl/RGB@0.1.0.sta b/stl/RGB@0.1.0.sta index 58498c6d..e7be7c35 100644 --- a/stl/RGB@0.1.0.sta +++ b/stl/RGB@0.1.0.sta @@ -1,335 +1,317 @@ -----BEGIN STRICT TYPE LIB----- -Id: urn:ubideco:stl:2PcZtrPrfQCu27qw8b4Wz4cEqUn2PpgSkDHwF4qVyyrq +Id: ENn5cEDW7QUStLzY6HBXjZFARAbrGHv3tXmdQ3QGzoU3#option-data-mimosa Name: RGB Dependencies: - urn:ubideco:stl:ZtHaBzu9ojbDahaGKEXe5v9DfSDxLERbLkEB23R6Q6V, - urn:ubideco:stl:5XLKQ1sNryZm9bdFKU2kBY3MPYdZXhchVdQKBbHA3gby, - urn:ubideco:stl:8wHziC7Bxa3BwctUh6EVBanosrvRHecCTPUjkZT4btNd, - urn:ubideco:stl:9KALDYR8Nyjq4FdMW6kYoL7vdkWnqPqNuFnmE9qHpNjZ, - urn:ubideco:stl:DVtm25LRKU4TjbyZmVxPhvCmctZ6vKkPKqfpU2QsDNUo, - urn:ubideco:stl:HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9 + 4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner, + 55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray, + 6HFQ83t33zW6PgG2pWpXM3HuEUFXAgUjheYiQa2Jdb9c#jester-lorenzo-address, + BADMWBVQ6sMJGfELP13cjeZPNutGuLzZtNNZirJQsz9e#tower-monaco-corona, + DVtm25LRKU4TjbyZ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o$A%pVy5kpFM+aV0K9EKD`h|Rxaip7ftc*O zMo2|aOLL5u5~t_~o+|9q8-QeJ-uM7{Tx}D0?#$r5{a&gi^*LIVXKTM`@@^VgggPyV zorf@EGuJkTgJx~ruz_7#=Z`QBU|}kfHk$39lW;`x&(3~nf8m9lbxR?wNtkzQ_04+w zD9vIDnHT~zj?A@R9@iM5wPJ|hxW_#h4Y!UA&!yk|%4afXse+*b%yqQjOofwHqq**1 z&$XEuq>n`r7H~$kqpcm|ThzU5(p#J(QrnBC=vAE>qo6swhoc*|FBO?zr+HW*z#OaY3z zh~Ek8?n$bDujtS+j{b;t^E$TB*X&MC>DJ2OI*+XezXZxN1p-bCH-XI+3Lx^sakW@m z<$n=YkR6m}%Tsg7kv*9mw?_%Ik(V<^52yh}ViJs&Ct!w@ifHMTK`>fMfD9QJJcWb) z&ms#+?x-S>8PW*|_MoMmB0h^%h*;uT)OPS554Q(C&o46mw%nsu()D#jEkMYos8nzE z3j?BoHR_BYNd}V;IA*Q}N;F_d2V61K0KjM$6>V(rpL2vJ+y|Gu7cQzPH4 z{N(6XmDM|Xb^pHbs-{IyNHPVvR-G{8mH+3tzd4+BRk{#JRLwUeJ*MT&s*8NR`?{)~ zJM0|5XV&H)A}tlMrhN~=ZPAss=03g?`Q+<&SCeIb(G#AU7|forx4GhL>qAff5mB*~ zg5YPTS5{lydVi>MyVsH2c{bXj^ZbV252hwv^9W%lhK*q{G5FpGt=G!oi!i&NY;Fa1ZbP}(3x8|e ^ ..0xff [Byte]}, entryPoints {[Byte ^ 3] -> AluVM.LibSite {- urn:ubideco:semid:8Q9NNyK2PCcjZ7U7rDGUJBhk8q37hAnWLgSizGLmr56g#mission-papa-mercy -}} --- urn:ubideco:semid:4GL38RVDhs4JkL5phqyF6pguwL6Av8qTUWCVNfGeWdUg#history-joel-ivory -data AnchorSet :: tapret:1 BPCore.AnchorMerkleProofTapretProof {- urn:ubideco:semid:2RRuXmkGM51gpruJzNCL6mSFm7nQFrP6zXm6CmNr77uE#arcade-modest-fossil -} - | opret BPCore.AnchorMerkleProofOpretProof {- urn:ubideco:semid:7mkYAw62Vi8BuyQ16qGg3bgFw8WVtTXUkJoYBv1qoNg4#tape-mental-legacy -} - | dual (tapret BPCore.AnchorMerkleProofTapretProof {- urn:ubideco:semid:2RRuXmkGM51gpruJzNCL6mSFm7nQFrP6zXm6CmNr77uE#arcade-modest-fossil -}, opret BPCore.AnchorMerkleProofOpretProof {- urn:ubideco:semid:7mkYAw62Vi8BuyQ16qGg3bgFw8WVtTXUkJoYBv1qoNg4#tape-mental-legacy -}) --- urn:ubideco:semid:8N8sQGRwEmmxKLwUiE4GQ89ziPzgBi7BfSjaNz9ozRKv#verbal-slow-lemon -data AnchoredBundle :: anchor XChainAnchorSet, bundle TransitionBundle --- urn:ubideco:semid:EZoxBpGenvb9UVze1zuwuEHqQJAqw2m3T8za5gbX1JZk#buzzer-pattern-craft -data AssetTag :: [Byte ^ 32] --- urn:ubideco:semid:86oEReUQtpkBF5ag57qt8QYeRoADcnsYVWUhd1hZYF9B#police-castle-fractal -data AssignRevealedAttachBlindSealTxPtr :: confidential (seal XChainSecretSeal, state ConcealedAttach) +import CommitVerify#4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner + use MerkleHash#culture-metro-modular + use MerkleProof#labor-hilton-magenta + +import Std#55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray + use Bool#laser-madam-maxwell + use AlphaNumLodash#north-sound-salsa + +import BPCore#6HFQ83t33zW6PgG2pWpXM3HuEUFXAgUjheYiQa2Jdb9c#jester-lorenzo-address + use TapretNodePartner#iceberg-poker-active + use ExplicitSealTxid#antenna-darwin-emotion + use TapretProof#forum-paint-tunnel + use TapretPathProof#stage-element-update + use Method#trilogy-tahiti-valid + use TapretRightBranch#basket-prelude-bridge + use BlindSealTxPtr#austria-icon-waiter + use OpretProof#segment-ambient-totem + use SecretSeal#santana-domingo-needle + use AnchorMerkleProofOpretProof#mammal-ethnic-crown + use BlindSealTxid#kimono-golf-price + use TxPtr#strange-source-father + use AnchorMerkleProofTapretProof#forward-chemist-panda + +import StrictTypes#BADMWBVQ6sMJGfELP13cjeZPNutGuLzZtNNZirJQsz9e#tower-monaco-corona + use VariantName#snow-gray-extreme + use Primitive#hobby-cable-puzzle + use VariantInfoSemId#clone-panama-guru + use UnnamedFieldsSemId#hippie-world-sandra + use NamedFieldsSemId#jordan-kiwi-nickel + use FieldSemId#speed-patriot-gallery + use SemId#cargo-plasma-catalog + use Ident#connect-fragile-exile + use Sizing#canoe-gordon-amazon + use EnumVariants#correct-dream-albert + use TypeSystem#panel-data-lazarus + use FieldName#orient-spell-talent + use TySemId#kimono-catalog-mango + use Variant#textile-cowboy-dragon + use UnionVariantsSemId#iceberg-road-crack + +import AluVM#DVtm25LRKU4TjbyZmVxPhvCmctZ6vKkPKqfpU2QsDNUo#exodus-axiom-tommy + use LibSite#mission-papa-mercy + use LibId#rebel-factor-rodeo + +import Bitcoin#HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9#speed-atlanta-trilogy + use Vout#chrome-robin-gallop + use ScriptBytes#maestro-source-jackson + use TapNodeHash#crash-culture-jamaica + use LeafScript#brenda-round-micro + use Txid#cowboy-diego-betty + use InternalPk#meter-nerve-chicken + use LeafVer#tunnel-lagoon-cowboy + use XOnlyPk#evident-finance-promo + + +@mnemonic(banana-mouse-plaster) +data AltLayer1 : liquid#1 + + +@mnemonic(salmon-taxi-ohio) +data AltLayer1Set : {AltLayer1 ^ ..0xff} + +@mnemonic(soviet-arsenal-complex) +data AluScript : libs {AluVM.LibId -> ^ ..0xff [Byte]}, entryPoints {[Byte ^ 3] -> AluVM.LibSite#mission-papa-mercy} + +@mnemonic(aurora-blast-brown) +data AnchorSet : tapret#1 BPCore.AnchorMerkleProofTapretProof#forward-chemist-panda + | opret BPCore.AnchorMerkleProofOpretProof#mammal-ethnic-crown + | dual (tapret BPCore.AnchorMerkleProofTapretProof#forward-chemist-panda, opret BPCore.AnchorMerkleProofOpretProof#mammal-ethnic-crown) + +@mnemonic(verbal-slow-lemon) +data AnchoredBundle : anchor XChainAnchorSet, bundle TransitionBundle + +@mnemonic(buzzer-pattern-craft) +data AssetTag : [Byte ^ 32] + +@mnemonic(police-castle-fractal) +data AssignRevealedAttachBlindSealTxPtr : confidential (seal XChainSecretSeal, state ConcealedAttach) | confidentialState (seal XChainBlindSealTxPtr, state ConcealedAttach) | confidentialSeal (seal XChainSecretSeal, state RevealedAttach) | revealed (seal XChainBlindSealTxPtr, state RevealedAttach) --- urn:ubideco:semid:GMetkMHmE6pvWF7v4cVkh5FQW1cBWSb4F38oge4Le8wG#parker-locate-madrid -data AssignRevealedAttachBlindSealTxid :: confidential (seal XChainSecretSeal, state ConcealedAttach) + +@mnemonic(parker-locate-madrid) +data AssignRevealedAttachBlindSealTxid : confidential (seal XChainSecretSeal, state ConcealedAttach) | confidentialState (seal XChainBlindSealTxid, state ConcealedAttach) | confidentialSeal (seal XChainSecretSeal, state RevealedAttach) | revealed (seal XChainBlindSealTxid, state RevealedAttach) --- urn:ubideco:semid:AbqXzWbeC4QTe3RGDg1tgZoq8Cg79wPfgxC418mbLZWc#fabric-exotic-road -data AssignRevealedDataBlindSealTxPtr :: confidential (seal XChainSecretSeal, state ConcealedData) + +@mnemonic(fabric-exotic-road) +data AssignRevealedDataBlindSealTxPtr : confidential (seal XChainSecretSeal, state ConcealedData) | confidentialState (seal XChainBlindSealTxPtr, state ConcealedData) | confidentialSeal (seal XChainSecretSeal, state RevealedData) | revealed (seal XChainBlindSealTxPtr, state RevealedData) --- urn:ubideco:semid:8DRTcwcPXjALBUhs8QSutcQj4KyxejP6nVGpmSPcma5s#iron-design-king -data AssignRevealedDataBlindSealTxid :: confidential (seal XChainSecretSeal, state ConcealedData) + +@mnemonic(iron-design-king) +data AssignRevealedDataBlindSealTxid : confidential (seal XChainSecretSeal, state ConcealedData) | confidentialState (seal XChainBlindSealTxid, state ConcealedData) | confidentialSeal (seal XChainSecretSeal, state RevealedData) | revealed (seal XChainBlindSealTxid, state RevealedData) --- urn:ubideco:semid:HpDAZ3iWVWNFP5oUrXNSifNop1wHGmfK7csUXkWbf3jE#avatar-house-ammonia -data AssignRevealedValueBlindSealTxPtr :: confidential (seal XChainSecretSeal, state ConcealedFungible) + +@mnemonic(avatar-house-ammonia) +data AssignRevealedValueBlindSealTxPtr : confidential (seal XChainSecretSeal, state ConcealedFungible) | confidentialState (seal XChainBlindSealTxPtr, state ConcealedFungible) | confidentialSeal (seal XChainSecretSeal, state RevealedFungible) | revealed (seal XChainBlindSealTxPtr, state RevealedFungible) --- urn:ubideco:semid:DFdcr9izr4NmVJJojKFXWPPYnWVM3RNU2K6oxMhDZmYx#popular-vista-urgent -data AssignRevealedValueBlindSealTxid :: confidential (seal XChainSecretSeal, state ConcealedFungible) + +@mnemonic(popular-vista-urgent) +data AssignRevealedValueBlindSealTxid : confidential (seal XChainSecretSeal, state ConcealedFungible) | confidentialState (seal XChainBlindSealTxid, state ConcealedFungible) | confidentialSeal (seal XChainSecretSeal, state RevealedFungible) | revealed (seal XChainBlindSealTxid, state RevealedFungible) --- urn:ubideco:semid:6Nr3ZJAAV8ukSmVJHChmUkbGFzdAbCjzXbmoxrDNcmwc#slogan-change-green -data AssignVoidStateBlindSealTxPtr :: confidential (seal XChainSecretSeal, state VoidState) + +@mnemonic(slogan-change-green) +data AssignVoidStateBlindSealTxPtr : confidential (seal XChainSecretSeal, state VoidState) | confidentialState (seal XChainBlindSealTxPtr, state VoidState) | confidentialSeal (seal XChainSecretSeal, state VoidState) | revealed (seal XChainBlindSealTxPtr, state VoidState) --- urn:ubideco:semid:BqQbSTu2tdDVLMnTx2rpKFYF47oEwrc2fGrTZGzDrueV#classic-cubic-ingrid -data AssignVoidStateBlindSealTxid :: confidential (seal XChainSecretSeal, state VoidState) + +@mnemonic(classic-cubic-ingrid) +data AssignVoidStateBlindSealTxid : confidential (seal XChainSecretSeal, state VoidState) | confidentialState (seal XChainBlindSealTxid, state VoidState) | confidentialSeal (seal XChainSecretSeal, state VoidState) | revealed (seal XChainBlindSealTxid, state VoidState) --- urn:ubideco:semid:A9sThAqgwKPfuJcR4GDfTQHUAbbS5sbEXG5XVk7FZHEg#hunter-hello-retro -data AssignmentType :: U16 --- urn:ubideco:semid:Bu8iXz4MmJnuUMW6AFAepa8BAa4DXLVAMdrNrkLh3S7a#granite-history-canvas -data AssignmentsBlindSealTxPtr :: {AssignmentType -> ^ ..0xff TypedAssignsBlindSealTxPtr} --- urn:ubideco:semid:7ZGXPWXsK641fCB8nipeDy4ZR9BTQ9Q8c9E2vj2ufNq5#center-nevada-promise -data AssignmentsBlindSealTxid :: {AssignmentType -> ^ ..0xff TypedAssignsBlindSealTxid} --- urn:ubideco:semid:9uzoSojhudYvNZYgTmJ5sMwwxzLtdLnfUeudT6Ro8i23#delta-member-agenda -data AttachId :: [Byte ^ 32] --- urn:ubideco:semid:9zzp5XyDaLvZSGhCEWtey1Y7xdD1soEYdGaimjyZexyf#agenda-ivory-blast -data BlindingFactor :: [Byte ^ 32] --- urn:ubideco:semid:HyVyGxhRswAZ3BHJqx6PKmcEGCUSHaL1Rc7qxxi811qE#pizza-natural-cyclone -data ConcealedAttach :: [Byte ^ 32] --- urn:ubideco:semid:8YQWVpKJBaYsAwrXvuLDNEDEKRZxfoQJpu1G7X2ZN1tL#mirage-invite-newton -data ConcealedData :: [Byte ^ 32] --- urn:ubideco:semid:5UUVzBtqMkymxQmDry4ay4aoXLLojTQQyHGrdSWis3Jt#window-basket-actor -data ConcealedFungible :: commitment PedersenCommitment, rangeProof RangeProof --- urn:ubideco:semid:AKAMGBAMmu7DZ9kMpwqSfDepEJf5PUB6BsufJ4zz88QB#beast-korea-perfect -data ContractHistory :: schemaId SchemaId + +@mnemonic(hunter-hello-retro) +data AssignmentType : U16 + +@mnemonic(explain-nato-passage) +data AssignmentWitness : absent () + | present XChainTxid + +@mnemonic(granite-history-canvas) +data AssignmentsBlindSealTxPtr : {AssignmentType -> ^ ..0xff TypedAssignsBlindSealTxPtr} + +@mnemonic(center-nevada-promise) +data AssignmentsBlindSealTxid : {AssignmentType -> ^ ..0xff TypedAssignsBlindSealTxid} + +@mnemonic(delta-member-agenda) +data AttachId : [Byte ^ 32] + +@mnemonic(agenda-ivory-blast) +data BlindingFactor : [Byte ^ 32] + +@mnemonic(pizza-natural-cyclone) +data ConcealedAttach : [Byte ^ 32] + +@mnemonic(mirage-invite-newton) +data ConcealedData : [Byte ^ 32] + +@mnemonic(window-basket-actor) +data ConcealedFungible : commitment PedersenCommitment, rangeProof RangeProof + +@mnemonic(beast-korea-perfect) +data ContractHistory : schemaId SchemaId , rootSchemaId SchemaId? , contractId ContractId , global {GlobalStateType -> ^ ..0xff {GlobalOrd -> ^ ..0xffffffff RevealedData}} @@ -151,12 +172,18 @@ data ContractHistory :: schemaId SchemaId , fungibles {OutputAssignmentRevealedValue ^ ..0xffffffff} , data {OutputAssignmentRevealedData ^ ..0xffffffff} , attach {OutputAssignmentRevealedAttach ^ ..0xffffffff} --- urn:ubideco:semid:Bho42Xw8wPy2nWxgz6H51rNdBBusaPyrVQT8VypvpZ3w#alarm-danube-vampire -data ContractId :: [Byte ^ 32] --- urn:ubideco:semid:AGRkqu4XCz7HJnTiG3DbE6xvMrU1D9vwH2gtJiuHtAyQ#client-major-stamp -data ContractState :: schema SchemaSchema, history ContractHistory --- urn:ubideco:semid:4wCasNtcxRnicsUakyXzzRdzemmUk8deBzrCqyRLiesL#deluxe-history-acrobat -data Extension :: ffv Ffv + +@mnemonic(alarm-danube-vampire) +data ContractId : [Byte ^ 32] + +@mnemonic(client-major-stamp) +data ContractState : schema SchemaSchema, history ContractHistory + +@mnemonic(diana-archive-liquid) +data DataState : [Byte] + +@mnemonic(deluxe-history-acrobat) +data Extension : ffv Ffv , contractId ContractId , extensionType ExtensionType , metadata [Byte] @@ -164,102 +191,133 @@ data Extension :: ffv Ffv , assignments AssignmentsBlindSealTxid , redeemed Redeemed , valencies Valencies --- urn:ubideco:semid:5EA8tZw7MhL13SCX33m98QLykB6iZFJ3ynukkiCqnh6U#peace-tiger-elastic -data ExtensionSchema :: metadata StrictTypes.SemId {- urn:ubideco:semid:8Ckj2p3GLKina636pSKJkj7GB6ft8XeoP4jfGkRUNwtp#cargo-plasma-catalog -} + +@mnemonic(peace-tiger-elastic) +data ExtensionSchema : metadata StrictTypes.SemId#cargo-plasma-catalog , globals {GlobalStateType -> ^ ..0xff Occurrences} , redeems {ValencyType ^ ..0xff} , assignments {AssignmentType -> ^ ..0xff Occurrences} , valencies {ValencyType ^ ..0xff} --- urn:ubideco:semid:7m9MHRdHSXnhYiheDeXybxnHAxPRgs84USnVELFH98Cd#mission-salsa-parole -data ExtensionType :: U16 --- urn:ubideco:semid:FiMEyh3t5FKEsUqVTgQFYJ5XfJF9m2RwKMN9NckympSG#silence-motel-toronto -data Ffv :: U16 --- urn:ubideco:semid:CD8fR4UCdn4ZE6Y6bNPFkDpXdMCMH1Y8nVPx7NGqqYHB#natasha-profit-winter -data FungibleState :: bits64:8 U64 --- urn:ubideco:semid:HpiuYTT7BuhCmoNs2GrwNrHNUx3i3yf6GjDiFphLKeQV#profit-bazooka-present -data FungibleType :: unsigned64Bit:8 - --- urn:ubideco:semid:F7ZK3wjiiBY57d8tMRbXW6nsDb86Lnjbq1GXRvbGv34c#relax-emotion-nitro -data Genesis :: ffv Ffv + +@mnemonic(mission-salsa-parole) +data ExtensionType : U16 + +@mnemonic(silence-motel-toronto) +data Ffv : U16 + +@mnemonic(natasha-profit-winter) +data FungibleState : bits64#8 U64 + +@mnemonic(profit-bazooka-present) +data FungibleType : unsigned64Bit#8 + + +@mnemonic(relax-emotion-nitro) +data Genesis : ffv Ffv , schemaId SchemaId - , testnet Std.Bool {- urn:ubideco:semid:7ZhBHGSJm9ixmm8Z9vCX7i5Ga7j5xrW8t11nsb1Cgpnx#laser-madam-maxwell -} + , testnet Std.Bool#laser-madam-maxwell , altLayers1 AltLayer1Set , metadata [Byte] , globals GlobalState , assignments AssignmentsBlindSealTxid , valencies Valencies --- urn:ubideco:semid:7vb54CDdNg8xJtKZjnbYReqaxHAdmbfoFezH8CsLQWsS#andrea-amigo-grid -data GenesisSchema :: metadata StrictTypes.SemId {- urn:ubideco:semid:8Ckj2p3GLKina636pSKJkj7GB6ft8XeoP4jfGkRUNwtp#cargo-plasma-catalog -} + +@mnemonic(andrea-amigo-grid) +data GenesisSchema : metadata StrictTypes.SemId#cargo-plasma-catalog , globals {GlobalStateType -> ^ ..0xff Occurrences} , assignments {AssignmentType -> ^ ..0xff Occurrences} , valencies {ValencyType ^ ..0xff} --- urn:ubideco:semid:9UUjMhuGNyLiWhT9hC2wCVfzBfABUHMtqcEqVykQTTBm#north-llama-empire -data GlobalOrd :: witnessAnchor WitnessAnchor?, idx U16 --- urn:ubideco:semid:Ekg4cNmYPqSZn14jQ4GD2tStBFX6S6aUk5bmLDRTaap8#ranger-middle-roman -data GlobalState :: {GlobalStateType -> ^ ..0xff GlobalValues} --- urn:ubideco:semid:ES98zed1FQ1XHZJptvv3ecWF6XFCdQsG1NvtkADYkugP#night-mixer-monaco -data GlobalStateSchema :: semId StrictTypes.SemId {- urn:ubideco:semid:8Ckj2p3GLKina636pSKJkj7GB6ft8XeoP4jfGkRUNwtp#cargo-plasma-catalog -}, maxItems U16 --- urn:ubideco:semid:FQ6qHu9gQzjZu3i7dasU7T1PGi4qZi1a4goxJbHxHkbU#seminar-major-tape -data GlobalStateType :: U16 --- urn:ubideco:semid:AnBpS97EbffL9PYZLfHKESeLoNeosEbLinQM9VqGeG2x#bicycle-europe-shampoo -data GlobalValues :: [RevealedData ^ 1..] --- urn:ubideco:semid:MXcKv35FafL8vRPoxfaZaG96L3bLiNsTtfsJiCLwc23#classic-chariot-domino -data Input :: prevOut Opout, reserved ReservedByte --- urn:ubideco:semid:4Pv4CN7nfHbbKyoEBvRVrnihhv7uP8y6QNi6FNRCNjUq#puzzle-guru-oregano -data Inputs :: {Input ^ ..0xff} --- urn:ubideco:semid:5TNhPhpZzE6iDWXaUpdsTAwVsCZj5e9Z8AqFU1ii6HHa#light-nelson-brain -data MediaType :: any:255 - --- urn:ubideco:semid:33ug4TwTBFQxz7D3YdFmwpKET415dv5zQRh5CkavC5fL#deal-orca-aztec -data NoiseDumb :: [Byte ^ 512] --- urn:ubideco:semid:4gjtVBchJQ5f1aAzoyxYWeGp6qZi9dPudJCbWKYKhw1a#unicorn-empire-mama -data Occurrences :: min U16, max U16 --- urn:ubideco:semid:B5hRc3ekuQsCAgsk8dmPVfytVDbvECJ3g2ANqrwSLE2p#slow-samuel-ceramic -data OpId :: [Byte ^ 32] --- urn:ubideco:semid:8EYQPboNCwpv9Nt9FQ47idjzNwCFBtDzRUmAuYEheahW#shallow-match-tokyo -data Opout :: op OpId + +@mnemonic(north-llama-empire) +data GlobalOrd : witnessAnchor WitnessAnchor?, idx U16 + +@mnemonic(ranger-middle-roman) +data GlobalState : {GlobalStateType -> ^ ..0xff GlobalValues} + +@mnemonic(night-mixer-monaco) +data GlobalStateSchema : semId StrictTypes.SemId#cargo-plasma-catalog, maxItems U16 + +@mnemonic(seminar-major-tape) +data GlobalStateType : U16 + +@mnemonic(bicycle-europe-shampoo) +data GlobalValues : [RevealedData ^ 1..] + +@mnemonic(classic-chariot-domino) +data Input : prevOut Opout, reserved ReservedByte + +@mnemonic(puzzle-guru-oregano) +data Inputs : {Input ^ ..0xff} + +@mnemonic(light-nelson-brain) +data MediaType : any#255 + + +@mnemonic(deal-orca-aztec) +data NoiseDumb : [Byte ^ 512] + +@mnemonic(unicorn-empire-mama) +data Occurrences : min U16, max U16 + +@mnemonic(slow-samuel-ceramic) +data OpId : [Byte ^ 32] + +@mnemonic(shallow-match-tokyo) +data Opout : op OpId , ty AssignmentType , no U16 --- urn:ubideco:semid:6D7oEZGP4eHYSgfJeP1Dyc6Qgc4ph4budoDSuFmtJ5zj#jungle-quota-front -data OutputAssignmentRevealedAttach :: opout Opout + +@mnemonic(think-record-medusa) +data OutputAssignmentRevealedAttach : opout Opout , seal XChainExplicitSealTxid , state RevealedAttach - , witness XChainTxid? --- urn:ubideco:semid:7eRgyX7MZuLw9bdqGZRMJezC36u53CQ8vUsrwpuU3ATz#shake-vega-snow -data OutputAssignmentRevealedData :: opout Opout + , witness AssignmentWitness + +@mnemonic(nectar-nectar-capsule) +data OutputAssignmentRevealedData : opout Opout , seal XChainExplicitSealTxid , state RevealedData - , witness XChainTxid? --- urn:ubideco:semid:4SNmowDSb3dv7WASKKpiRRWsmr9t5VjULSmYRPV3CcyC#burma-plate-degree -data OutputAssignmentRevealedValue :: opout Opout + , witness AssignmentWitness + +@mnemonic(control-boris-motif) +data OutputAssignmentRevealedValue : opout Opout , seal XChainExplicitSealTxid , state RevealedFungible - , witness XChainTxid? --- urn:ubideco:semid:3EAtrfNu9ptxdaoZkCzj2UvzUMSwDci52kkgJoYBWuz3#garden-eagle-bagel -data OutputAssignmentVoidState :: opout Opout + , witness AssignmentWitness + +@mnemonic(avatar-beatles-protein) +data OutputAssignmentVoidState : opout Opout , seal XChainExplicitSealTxid , state VoidState - , witness XChainTxid? --- urn:ubideco:semid:5twbh2U5hyaowidwum1iRNCqebBLxTuZTuNPt3SaRT13#nepal-delta-earth -data PedersenCommitment :: [Byte ^ 33] --- urn:ubideco:semid:73TpZuiyRWAuV9GRSj9H7tDf3JXwVvmT4teTXhKxdue1#invent-stock-result -data RangeProof :: placeholder:255 NoiseDumb --- urn:ubideco:semid:9gee8HH6yNbqyLe9tA3N5zcCTReMDe6y2yfcybWyYApm#scoop-press-scuba -data Redeemed :: {ValencyType -> ^ ..0xff OpId} --- urn:ubideco:semid:5ezr9uJrSdzez89fTCRWvKwGv6coMmQeXizK371oYdZ2#balloon-justin-place -data ReservedByte :: U8 --- urn:ubideco:semid:2odg1kiUEtjxBa9MzQmkyDPxKe2hdt6aASEGQTEHAJYU#cigar-network-event -data RevealedAttach :: id AttachId + , witness AssignmentWitness + +@mnemonic(nepal-delta-earth) +data PedersenCommitment : [Byte ^ 33] + +@mnemonic(invent-stock-result) +data RangeProof : placeholder#255 NoiseDumb + +@mnemonic(scoop-press-scuba) +data Redeemed : {ValencyType -> ^ ..0xff OpId} + +@mnemonic(balloon-justin-place) +data ReservedByte : U8 + +@mnemonic(cigar-network-event) +data RevealedAttach : id AttachId , mediaType MediaType , salt U64 --- urn:ubideco:semid:3DcMJ3YRokNwKN8Cce1ZqsYpiTEuto7EY1szCMEDH97A#velvet-david-manual -data RevealedData :: [Byte] --- urn:ubideco:semid:5rdcWxUW6LxoRQKrPs2EszvTTPrjmKKWPzHeZi1FjWhX#canal-pagoda-ralph -data RevealedFungible :: value FungibleState + +@mnemonic(ivory-bogart-stock) +data RevealedData : value DataState, salt U128 + +@mnemonic(canal-pagoda-ralph) +data RevealedFungible : value FungibleState , blinding BlindingFactor , tag AssetTag --- urn:ubideco:semid:Df1oP2CtYZ1aULEoV5oicwQkNVgGkaFuqW3dktV847k5#margo-mission-virus -data Schema :: ffv Ffv + +@mnemonic(fresh-beatles-empire) +data Schema : ffv Ffv , subsetOf ()? , globalTypes {GlobalStateType -> ^ ..0xff GlobalStateSchema} , ownedTypes {AssignmentType -> ^ ..0xff StateSchema} @@ -267,12 +325,14 @@ data Schema :: ffv Ffv , genesis GenesisSchema , extensions {ExtensionType -> ^ ..0xff ExtensionSchema} , transitions {TransitionType -> ^ ..0xff TransitionSchema} - , typeSystem StrictTypes.TypeSystem {- urn:ubideco:semid:47es12nMYaA5M7zMejQHAydsRPW6juta8ensLigXMBDP#linda-yellow-rival -} + , typeSystem StrictTypes.TypeSystem#panel-data-lazarus , script Script --- urn:ubideco:semid:AyzbMn4ux89LLU8ho1L4pQa5TXsmRdHd79oh6SXdrCmd#garcia-smoke-ozone -data SchemaId :: [Byte ^ 32] --- urn:ubideco:semid:AjnKkNbkCAtjJaTJUW2F36wcPEApCtTWCzm6RUWBVQzB#tourist-monday-exile -data SchemaSchema :: ffv Ffv + +@mnemonic(garcia-smoke-ozone) +data SchemaId : [Byte ^ 32] + +@mnemonic(heaven-object-august) +data SchemaSchema : ffv Ffv , subsetOf Schema? , globalTypes {GlobalStateType -> ^ ..0xff GlobalStateSchema} , ownedTypes {AssignmentType -> ^ ..0xff StateSchema} @@ -280,17 +340,20 @@ data SchemaSchema :: ffv Ffv , genesis GenesisSchema , extensions {ExtensionType -> ^ ..0xff ExtensionSchema} , transitions {TransitionType -> ^ ..0xff TransitionSchema} - , typeSystem StrictTypes.TypeSystem {- urn:ubideco:semid:47es12nMYaA5M7zMejQHAydsRPW6juta8ensLigXMBDP#linda-yellow-rival -} + , typeSystem StrictTypes.TypeSystem#panel-data-lazarus , script Script --- urn:ubideco:semid:HyVVQCc7o1wnC3oo1VTHzcpMuVsvzFBTnSFe6xVSiDAV#process-media-second -data Script :: aluVm AluScript --- urn:ubideco:semid:tECDKfnyyGZgwoorc1VynUBq9unv34u9WvRBUTduoRK#report-agatha-level -data StateSchema :: declarative () + +@mnemonic(process-media-second) +data Script : aluVm AluScript + +@mnemonic(report-agatha-level) +data StateSchema : declarative () | fungible FungibleType - | structured StrictTypes.SemId {- urn:ubideco:semid:8Ckj2p3GLKina636pSKJkj7GB6ft8XeoP4jfGkRUNwtp#cargo-plasma-catalog -} + | structured StrictTypes.SemId#cargo-plasma-catalog | attachment MediaType --- urn:ubideco:semid:GLm25xw5WvH5UBJHQw6FVyZbAHYVjXtS1HtkYVPJ1FjT#folio-barbara-guru -data Transition :: ffv Ffv + +@mnemonic(folio-barbara-guru) +data Transition : ffv Ffv , contractId ContractId , transitionType TransitionType , metadata [Byte] @@ -298,55 +361,73 @@ data Transition :: ffv Ffv , inputs Inputs , assignments AssignmentsBlindSealTxPtr , valencies Valencies --- urn:ubideco:semid:LnohmzqG7bkCL7hAjWd2tUrvEP1Pe5C6oiv5r5KjF2G#boxer-nadia-alias -data TransitionBundle :: inputMap {Bitcoin.Vout -> ^ 1.. OpId}, knownTransitions {OpId -> ^ 1.. Transition} --- urn:ubideco:semid:4d7FmcvNey5X175gyggcn4wftcf7mtGyn6N4r6Ek4roX#fiction-caramel-fractal -data TransitionSchema :: metadata StrictTypes.SemId {- urn:ubideco:semid:8Ckj2p3GLKina636pSKJkj7GB6ft8XeoP4jfGkRUNwtp#cargo-plasma-catalog -} + +@mnemonic(boxer-nadia-alias) +data TransitionBundle : inputMap {Bitcoin.Vout -> ^ 1.. OpId}, knownTransitions {OpId -> ^ 1.. Transition} + +@mnemonic(fiction-caramel-fractal) +data TransitionSchema : metadata StrictTypes.SemId#cargo-plasma-catalog , globals {GlobalStateType -> ^ ..0xff Occurrences} , inputs {AssignmentType -> ^ ..0xff Occurrences} , assignments {AssignmentType -> ^ ..0xff Occurrences} , valencies {ValencyType ^ ..0xff} --- urn:ubideco:semid:4XEmzMLZTXc4XB3njvemMq5qdMmx5EKJPAXpJaBPrqCb#puma-joshua-evita -data TransitionType :: U16 --- urn:ubideco:semid:Gbg8NjDV5x6NnhVzmqksPgAc2hgYzMNcgiu4iHggmQcB#orchid-season-bishop -data TypedAssignsBlindSealTxPtr :: declarative [AssignVoidStateBlindSealTxPtr] + +@mnemonic(puma-joshua-evita) +data TransitionType : U16 + +@mnemonic(orchid-season-bishop) +data TypedAssignsBlindSealTxPtr : declarative [AssignVoidStateBlindSealTxPtr] | fungible [AssignRevealedValueBlindSealTxPtr] | structured [AssignRevealedDataBlindSealTxPtr] - | attachment:255 [AssignRevealedAttachBlindSealTxPtr] --- urn:ubideco:semid:5X4gpjBJD2jiYSSTYrmEb3QZPxHRFDo4TwgUhuZjLVW4#rondo-roman-expand -data TypedAssignsBlindSealTxid :: declarative [AssignVoidStateBlindSealTxid] + | attachment#255 [AssignRevealedAttachBlindSealTxPtr] + +@mnemonic(rondo-roman-expand) +data TypedAssignsBlindSealTxid : declarative [AssignVoidStateBlindSealTxid] | fungible [AssignRevealedValueBlindSealTxid] | structured [AssignRevealedDataBlindSealTxid] - | attachment:255 [AssignRevealedAttachBlindSealTxid] --- urn:ubideco:semid:FXixNMTaiMJMqp5qQCyb67oPrzryjAXxsk6kvsFQoHTi#andy-mango-brother -data Valencies :: {ValencyType ^ ..0xff} --- urn:ubideco:semid:5mswXMrudHpJEnuoLA86YY2VHN5iL56hmKcmh5k1h3e5#palma-exit-pupil -data ValencyType :: U16 --- urn:ubideco:semid:49HkbZvGaJE3phHjLBMQCR3NK1sGA462HJr5BkqQ6YQr#nectar-ceramic-driver -data VoidState :: () --- urn:ubideco:semid:HtyS3FW8duiA8o1TV13jiK5BUJtebY1JvghTkz9sVuNM#henry-prepare-company -data WitnessAnchor :: witnessOrd WitnessOrd, witnessId XChainTxid --- urn:ubideco:semid:JAhqqYxn4oDEDefAeAHFcAtNQJqQBHo6q5xqbviV3L3q#jacket-fiction-sound -data WitnessOrd :: onChain WitnessPos + | attachment#255 [AssignRevealedAttachBlindSealTxid] + +@mnemonic(andy-mango-brother) +data Valencies : {ValencyType ^ ..0xff} + +@mnemonic(palma-exit-pupil) +data ValencyType : U16 + +@mnemonic(nectar-ceramic-driver) +data VoidState : () + +@mnemonic(henry-prepare-company) +data WitnessAnchor : witnessOrd WitnessOrd, witnessId XChainTxid + +@mnemonic(jacket-fiction-sound) +data WitnessOrd : onChain WitnessPos | offChain () --- urn:ubideco:semid:zaGYZruf2pxiZqk1bjmoivxK8DkFycoyjQB52uHYhGL#robert-average-artist -data WitnessPos :: height U32, timestamp I64 --- urn:ubideco:semid:7ypgzk2JFQpQQbtUFua1uyGu6N7aUxkiXokmjrJDNQnq#floor-emotion-riviera -data XChainAnchorSet :: bitcoin AnchorSet + +@mnemonic(robert-average-artist) +data WitnessPos : height U32, timestamp I64 + +@mnemonic(floor-emotion-riviera) +data XChainAnchorSet : bitcoin AnchorSet | liquid AnchorSet --- urn:ubideco:semid:Ag5MktqPQsAWFoJEaUfNw6AvjYtLFXMwupw9chdEwEKE#prime-loyal-escort -data XChainBlindSealTxPtr :: bitcoin BPCore.BlindSealTxPtr {- urn:ubideco:semid:5ircUcbD1UjEKsAKMcvdfjS9UcVCEcs47BWAZ5UDqYdr#austria-icon-waiter -} - | liquid BPCore.BlindSealTxPtr {- urn:ubideco:semid:5ircUcbD1UjEKsAKMcvdfjS9UcVCEcs47BWAZ5UDqYdr#austria-icon-waiter -} --- urn:ubideco:semid:9kefL6S8Tr5a7hMTPg6M8Ruh9Da7s3LV6L4HJDQH69vJ#biology-domain-domain -data XChainBlindSealTxid :: bitcoin BPCore.BlindSealTxid {- urn:ubideco:semid:Cu4G4njDjd2mgmz4FsvFAwRKwBpksmZ9CB9AJhSNx5dk#kimono-golf-price -} - | liquid BPCore.BlindSealTxid {- urn:ubideco:semid:Cu4G4njDjd2mgmz4FsvFAwRKwBpksmZ9CB9AJhSNx5dk#kimono-golf-price -} --- urn:ubideco:semid:F6RPJgZMGop2K5QBdWK1bP57ifXo5g76Jet1fEtbi3Wh#ozone-quick-hippie -data XChainExplicitSealTxid :: bitcoin BPCore.ExplicitSealTxid {- urn:ubideco:semid:FxnQvXfa6koZmm6uyZCPwnGrMi3UzY588kKN9ipN72L#antenna-darwin-emotion -} - | liquid BPCore.ExplicitSealTxid {- urn:ubideco:semid:FxnQvXfa6koZmm6uyZCPwnGrMi3UzY588kKN9ipN72L#antenna-darwin-emotion -} --- urn:ubideco:semid:FmzeQkRM31bz3UNNTZTV2DWDyCMVSabzQWcdb1PpL2Ao#palace-random-taxi -data XChainSecretSeal :: bitcoin BPCore.SecretSeal {- urn:ubideco:semid:81NKrdc9pBoBjsKaGBVN9wXLG4tKjkK4f8DLj7TNMZxh#santana-domingo-needle -} - | liquid BPCore.SecretSeal {- urn:ubideco:semid:81NKrdc9pBoBjsKaGBVN9wXLG4tKjkK4f8DLj7TNMZxh#santana-domingo-needle -} --- urn:ubideco:semid:AFRnr7FmAC7DtKDQZj9eCzuf9Tp8E6UckpVouwDmwq5S#cubic-museum-lemon -data XChainTxid :: bitcoin Bitcoin.Txid {- urn:ubideco:semid:C1GfCrG7AXu2sFhRBspd7KpJK2YgyTkVy6pty5rZynRs#cowboy-diego-betty -} - | liquid Bitcoin.Txid {- urn:ubideco:semid:C1GfCrG7AXu2sFhRBspd7KpJK2YgyTkVy6pty5rZynRs#cowboy-diego-betty -} + +@mnemonic(prime-loyal-escort) +data XChainBlindSealTxPtr : bitcoin BPCore.BlindSealTxPtr#austria-icon-waiter + | liquid BPCore.BlindSealTxPtr#austria-icon-waiter + +@mnemonic(biology-domain-domain) +data XChainBlindSealTxid : bitcoin BPCore.BlindSealTxid#kimono-golf-price + | liquid BPCore.BlindSealTxid#kimono-golf-price + +@mnemonic(ozone-quick-hippie) +data XChainExplicitSealTxid : bitcoin BPCore.ExplicitSealTxid#antenna-darwin-emotion + | liquid BPCore.ExplicitSealTxid#antenna-darwin-emotion + +@mnemonic(palace-random-taxi) +data XChainSecretSeal : bitcoin BPCore.SecretSeal#santana-domingo-needle + | liquid BPCore.SecretSeal#santana-domingo-needle + +@mnemonic(cubic-museum-lemon) +data XChainTxid : bitcoin Bitcoin.Txid#cowboy-diego-betty + | liquid Bitcoin.Txid#cowboy-diego-betty + From d510e903ecde2056b21490ff331c723355472e53 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 3 Feb 2024 22:45:00 +0100 Subject: [PATCH 04/29] stl: add Vesper support --- src/bin/rgbcore-stl.rs | 65 ++++++-- stl/AnchoredBundle.vesper | 323 ++++++++++++++++++++++++++++++++++++++ stl/Schema.vesper | 119 ++++++++++++++ stl/Transition.vesper | 231 +++++++++++++++++++++++++++ 4 files changed, 728 insertions(+), 10 deletions(-) create mode 100644 stl/AnchoredBundle.vesper create mode 100644 stl/Schema.vesper create mode 100644 stl/Transition.vesper diff --git a/src/bin/rgbcore-stl.rs b/src/bin/rgbcore-stl.rs index 39402a1c..fd5a8d90 100644 --- a/src/bin/rgbcore-stl.rs +++ b/src/bin/rgbcore-stl.rs @@ -20,23 +20,68 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::fs; + +use aluvm::stl::aluvm_stl; +use bp::stl::bp_core_stl; +use commit_verify::stl::commit_verify_stl; +use rgb::stl::bp_tx_stl; +use strict_types::stl::{std_stl, strict_types_stl}; use strict_types::typelib::parse_args; +use strict_types::SystemBuilder; fn main() { let (format, dir) = parse_args(); - rgb::stl::rgb_core_stl() - .serialize( - format, - dir, - "0.1.0", - Some( - " + let rgb = rgb::stl::rgb_core_stl(); + + rgb.serialize( + format, + dir.as_ref(), + "0.1.0", + Some( + " Description: Consensus layer for RGB smart contracts Author: Dr Maxim Orlovsky Copyright (C) 2023 LNP/BP Standards Association. All rights reserved. License: Apache-2.0", - ), - ) - .expect("unable to write to the file"); + ), + ) + .expect("unable to write to the file"); + + let std = std_stl(); + let tx = bp_tx_stl(); + let bp = bp_core_stl(); + let cv = commit_verify_stl(); + let st = strict_types_stl(); + let vm = aluvm_stl(); + + let sys = SystemBuilder::new() + .import(rgb) + .unwrap() + .import(vm) + .unwrap() + .import(bp) + .unwrap() + .import(tx) + .unwrap() + .import(cv) + .unwrap() + .import(st) + .unwrap() + .import(std) + .unwrap() + .finalize() + .expect("not all libraries present"); + + 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 tt = sys.type_tree("RGB.Schema").unwrap(); + fs::write(format!("{dir}/Schema.vesper",), format!("{tt}")).unwrap(); + + let tt = sys.type_tree("RGB.AnchoredBundle").unwrap(); + fs::write(format!("{dir}/AnchoredBundle.vesper",), format!("{tt}")).unwrap(); } diff --git a/stl/AnchoredBundle.vesper b/stl/AnchoredBundle.vesper new file mode 100644 index 00000000..f736001b --- /dev/null +++ b/stl/AnchoredBundle.vesper @@ -0,0 +1,323 @@ +AnchoredBundle rec + anchor union -- XChainAnchorSet + bitcoin union wrapped tag=0 -- AnchorSet + tapret rec wrapped tag=0 -- AnchorMerkleProofTapretProof + txid bytes len=32 aka=Txid + 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 + nonce is U8 + opret rec wrapped tag=1 -- AnchorMerkleProofOpretProof + txid bytes len=32 aka=Txid + 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 + txid bytes len=32 aka=Txid + 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 + nonce is U8 + opret rec -- AnchorMerkleProofOpretProof + txid bytes len=32 aka=Txid + 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 + txid bytes len=32 aka=Txid + 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 + nonce is U8 + opret rec wrapped tag=1 -- AnchorMerkleProofOpretProof + txid bytes len=32 aka=Txid + 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 + txid bytes len=32 aka=Txid + 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 + nonce is U8 + opret rec -- AnchorMerkleProofOpretProof + txid bytes len=32 aka=Txid + 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 + inputMap map len=1..MAX16 + 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 + ffv is U16 aka=Ffv + contractId bytes len=32 aka=ContractId + transitionType is U16 aka=TransitionType + metadata bytes len=0..MAX16 + globals map len=0..MAX8 aka=GlobalState + key is U16 aka=GlobalStateType + value list len=1..MAX16 aka=GlobalValues + RevealedData rec + value bytes len=0..MAX16 aka=DataState + salt is U128 + inputs set len=0..MAX8 aka=Inputs + Input rec + prevOut rec -- Opout + op bytes len=32 aka=OpId + ty is U16 aka=AssignmentType + no is U16 + reserved is U8 aka=ReservedByte + assignments map len=0..MAX8 aka=AssignmentsBlindSealTxPtr + key is U16 aka=AssignmentType + TypedAssignsBlindSealTxPtr union -- mapped to + declarative list len=0..MAX16 wrapped tag=0 + AssignVoidStateBlindSealTxPtr union + confidential rec tag=0 + 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 + 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 + 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 + 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 + 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 + 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 + fungible list len=0..MAX16 wrapped tag=1 + AssignRevealedValueBlindSealTxPtr union + confidential rec tag=0 + seal union -- XChainSecretSeal + bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 + liquid bytes len=32 wrapped aka=SecretSeal tag=1 + state rec -- ConcealedFungible + commitment bytes len=33 aka=PedersenCommitment + 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 + 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 + 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 + commitment bytes len=33 aka=PedersenCommitment + rangeProof union -- RangeProof + placeholder bytes len=512 wrapped aka=NoiseDumb tag=0 + confidentialSeal rec tag=2 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 + liquid bytes len=32 wrapped aka=SecretSeal tag=1 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 + liquid bytes len=32 wrapped aka=SecretSeal tag=1 + state rec -- RevealedAttach + id bytes len=32 aka=AttachId + mediaType enum any=255 -- MediaType + 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 + 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 + 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 + id bytes len=32 aka=AttachId + mediaType enum any=255 -- MediaType + salt is U64 + valencies set len=0..MAX8 aka=Valencies + element is U16 aka=ValencyType diff --git a/stl/Schema.vesper b/stl/Schema.vesper new file mode 100644 index 00000000..c5824b93 --- /dev/null +++ b/stl/Schema.vesper @@ -0,0 +1,119 @@ +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 + semId bytes len=32 aka=SemId + maxItems is U16 + ownedTypes map len=0..MAX8 + key is U16 aka=AssignmentType + StateSchema union -- mapped to + declarative is Unit tag=0 + fungible enum wrapped unsigned64Bit=8 tag=1 -- FungibleType + structured bytes len=32 wrapped aka=SemId tag=2 + attachment enum wrapped any=255 tag=3 -- MediaType + valencyTypes set len=0..MAX8 + element is U16 aka=ValencyType + genesis rec -- GenesisSchema + metadata bytes len=32 aka=SemId + globals map len=0..MAX8 + key is U16 aka=GlobalStateType + Occurrences rec -- mapped to + min is U16 + max is U16 + assignments map len=0..MAX8 + key is U16 aka=AssignmentType + Occurrences rec -- mapped to + 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 + metadata bytes len=32 aka=SemId + globals map len=0..MAX8 + key is U16 aka=GlobalStateType + Occurrences rec -- mapped to + 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 + 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 + metadata bytes len=32 aka=SemId + globals map len=0..MAX8 + key is U16 aka=GlobalStateType + Occurrences rec -- mapped to + min is U16 + max is U16 + inputs map len=0..MAX8 + key is U16 aka=AssignmentType + Occurrences rec -- mapped to + min is U16 + max is U16 + assignments map len=0..MAX8 + key is U16 aka=AssignmentType + Occurrences rec -- mapped to + 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 + primitive is U8 wrapped aka=Primitive tag=0 + unicode is Unit tag=1 + enum set len=1..MAX8 wrapped aka=EnumVariants tag=2 + Variant rec + name ascii len=1..100 aka=VariantName aka=Ident charset=AlphaNumLodash + tag is U8 + union map len=0..MAX8 wrapped aka=UnionVariantsSemId tag=3 + key is U8 + VariantInfoSemId rec -- mapped to + 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 + element bytes len=32 aka=SemId + struct list len=1..MAX8 wrapped aka=NamedFieldsSemId tag=5 + FieldSemId rec + name ascii len=1..100 aka=FieldName aka=Ident charset=AlphaNumLodash + ty bytes len=32 aka=SemId + array tuple tag=6 + _ bytes len=32 aka=SemId + _ is U16 + list tuple tag=7 + _ bytes len=32 aka=SemId + Sizing rec + min is U64 + max is U64 + set tuple tag=8 + _ bytes len=32 aka=SemId + Sizing rec + min is U64 + max is U64 + map tuple tag=9 + _ bytes len=32 aka=SemId + _ bytes len=32 aka=SemId + Sizing rec + min is U64 + max is U64 + script union -- Script + aluVm rec wrapped tag=0 -- AluScript + 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 + lib bytes len=32 aka=LibId + pos is U16 diff --git a/stl/Transition.vesper b/stl/Transition.vesper new file mode 100644 index 00000000..6b26324c --- /dev/null +++ b/stl/Transition.vesper @@ -0,0 +1,231 @@ +Transition rec + ffv is U16 aka=Ffv + contractId bytes len=32 aka=ContractId + transitionType is U16 aka=TransitionType + metadata bytes len=0..MAX16 + globals map len=0..MAX8 aka=GlobalState + key is U16 aka=GlobalStateType + value list len=1..MAX16 aka=GlobalValues + RevealedData rec + value bytes len=0..MAX16 aka=DataState + salt is U128 + inputs set len=0..MAX8 aka=Inputs + Input rec + prevOut rec -- Opout + op bytes len=32 aka=OpId + ty is U16 aka=AssignmentType + no is U16 + reserved is U8 aka=ReservedByte + assignments map len=0..MAX8 aka=AssignmentsBlindSealTxPtr + key is U16 aka=AssignmentType + TypedAssignsBlindSealTxPtr union -- mapped to + declarative list len=0..MAX16 wrapped tag=0 + AssignVoidStateBlindSealTxPtr union + confidential rec tag=0 + 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 + 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 + 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 + 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 + 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 + 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 + fungible list len=0..MAX16 wrapped tag=1 + AssignRevealedValueBlindSealTxPtr union + confidential rec tag=0 + seal union -- XChainSecretSeal + bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 + liquid bytes len=32 wrapped aka=SecretSeal tag=1 + state rec -- ConcealedFungible + commitment bytes len=33 aka=PedersenCommitment + 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 + 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 + 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 + commitment bytes len=33 aka=PedersenCommitment + rangeProof union -- RangeProof + placeholder bytes len=512 wrapped aka=NoiseDumb tag=0 + confidentialSeal rec tag=2 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 + liquid bytes len=32 wrapped aka=SecretSeal tag=1 + 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 + 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 + 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 + 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 + 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 + 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 + 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 + bitcoin bytes len=32 wrapped aka=SecretSeal tag=0 + liquid bytes len=32 wrapped aka=SecretSeal tag=1 + state rec -- RevealedAttach + id bytes len=32 aka=AttachId + mediaType enum any=255 -- MediaType + 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 + 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 + 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 + id bytes len=32 aka=AttachId + mediaType enum any=255 -- MediaType + salt is U64 + valencies set len=0..MAX8 aka=Valencies + element is U16 aka=ValencyType From c9cdb2484e8049ed94e4cbc375c87b9e4016ae8c Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 4 Feb 2024 13:39:54 +0100 Subject: [PATCH 05/29] chore: update dependencies --- Cargo.lock | 26 +++++++++++++------------- Cargo.toml | 11 +++++++---- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c8a58122..ad01b86e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "aluvm" version = "0.11.0-beta.2" -source = "git+https://github.com/AluVM/rust-aluvm?branch=v0.11#084d3b96dde13b666917783849c30e35bd150548" +source = "git+https://github.com/AluVM/rust-aluvm?branch=v0.11#d218e9a770618db53187ec2ef02b7b4ace72c54a" dependencies = [ "amplify", "baid58", @@ -189,7 +189,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" dependencies = [ "amplify", "chrono", @@ -203,7 +203,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" dependencies = [ "amplify", "bp-consensus", @@ -221,7 +221,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" dependencies = [ "amplify", "base85", @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#43c5ea00bdd538d4f2c1170a0c8fb2444c67da29" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" dependencies = [ "amplify", "baid58", @@ -292,7 +292,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#ca6866221b9cdcd9d68297753cf75af57aa7ef86" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#61b0f4969da8a69cef438de6b3085344c5626ec2" dependencies = [ "amplify", "amplify_syn", @@ -304,7 +304,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#ca6866221b9cdcd9d68297753cf75af57aa7ef86" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#61b0f4969da8a69cef438de6b3085344c5626ec2" dependencies = [ "amplify", "commit_encoding_derive", @@ -757,8 +757,8 @@ dependencies = [ [[package]] name = "strict_encoding" -version = "2.6.2" -source = "git+https://github.com/strict-types/strict-encoding?branch=ident#9c20b327178b449cbb24a18c7db65edeb50a9d5b" +version = "2.7.0" +source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#f95dbcbf8b01a4ea92dea92bd6492e9ae8c73c67" dependencies = [ "amplify", "half", @@ -768,8 +768,8 @@ dependencies = [ [[package]] name = "strict_encoding_derive" -version = "2.0.1" -source = "git+https://github.com/strict-types/strict-encoding?branch=ident#9c20b327178b449cbb24a18c7db65edeb50a9d5b" +version = "2.7.0" +source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#f95dbcbf8b01a4ea92dea92bd6492e9ae8c73c67" dependencies = [ "amplify_syn", "heck", @@ -780,8 +780,8 @@ dependencies = [ [[package]] name = "strict_types" -version = "1.6.3" -source = "git+https://github.com/strict-types/strict-types?branch=vesper#b424b47eff526088417eccf85441211db4f953a1" +version = "2.7.0" +source = "git+https://github.com/strict-types/strict-types?branch=refactor/io#ada11c04ab6e6483e769885f2fe93eae0bd42f85" dependencies = [ "amplify", "baid58", diff --git a/Cargo.toml b/Cargo.toml index f59cdd98..637affec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,8 +23,8 @@ required-features = ["stl"] [dependencies] amplify = { version = "~4.5.1", features = ["rand"] } -strict_encoding = "~2.6.2" -strict_types = "~1.6.3" +strict_encoding = "~2.7.0" +strict_types = "~2.7.0" aluvm = { version = "~0.11.0-beta.2", features = ["std"] } commit_verify = { version = "~0.11.0-beta.3", features = ["rand", "derive"] } single_use_seals = "~0.11.0-beta.3" @@ -62,8 +62,11 @@ wasm-bindgen-test = "0.3" features = [ "all" ] [patch.crates-io] -strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "ident" } -strict_types = { git = "https://github.com/strict-types/strict-types", branch = "vesper" } +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" } From d85543cc0039db1870bb6f9288b5fe15a834264a Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 10 Feb 2024 11:03:04 +0100 Subject: [PATCH 06/29] contract: refactor ids into a dedicated mod --- src/contract/id.rs | 129 +++++++++++++++++++++++++++++++++++++ src/contract/mod.rs | 5 +- src/contract/operations.rs | 116 +++------------------------------ 3 files changed, 142 insertions(+), 108 deletions(-) create mode 100644 src/contract/id.rs diff --git a/src/contract/id.rs b/src/contract/id.rs new file mode 100644 index 00000000..072b8c44 --- /dev/null +++ b/src/contract/id.rs @@ -0,0 +1,129 @@ +// RGB Core Library: consensus layer for RGB smart contracts. +// +// SPDX-License-Identifier: Apache-2.0 +// +// Written in 2019-2024 by +// Dr Maxim Orlovsky +// +// Copyright (C) 2019-2024 LNP/BP Standards Association. All rights reserved. +// Copyright (C) 2019-2024 Dr Maxim Orlovsky. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::fmt; +use std::fmt::{Display, Formatter}; +use std::str::FromStr; + +use amplify::hex::{FromHex, ToHex}; +use amplify::{hex, ByteArray, Bytes32, FromSliceError, Wrapper}; +use baid58::{Baid58ParseError, Chunking, FromBaid58, ToBaid58, CHUNKING_32CHECKSUM}; +use commit_verify::{mpc, CommitmentId, DigestExt, Sha256}; + +use crate::LIB_NAME_RGB; + +/// Unique contract identifier equivalent to the contract genesis commitment +#[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)] +#[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] +#[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 ContractId( + #[from] + #[from([u8; 32])] + Bytes32, +); + +impl PartialEq for ContractId { + fn eq(&self, other: &OpId) -> bool { self.to_byte_array() == other.to_byte_array() } +} +impl PartialEq for OpId { + fn eq(&self, other: &ContractId) -> bool { self.to_byte_array() == other.to_byte_array() } +} + +impl ContractId { + pub fn copy_from_slice(slice: impl AsRef<[u8]>) -> Result { + Bytes32::copy_from_slice(slice).map(Self) + } +} + +impl ToBaid58<32> for ContractId { + const HRI: &'static str = "rgb"; + const CHUNKING: Option = CHUNKING_32CHECKSUM; + fn to_baid58_payload(&self) -> [u8; 32] { self.to_byte_array() } + fn to_baid58_string(&self) -> String { self.to_string() } +} +impl FromBaid58<32> for ContractId {} +impl Display for ContractId { + fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { + if f.alternate() { + write!(f, "{::^}", self.to_baid58()) + } else { + write!(f, "{::^.3}", self.to_baid58()) + } + } +} +impl FromStr for ContractId { + type Err = Baid58ParseError; + fn from_str(s: &str) -> Result { + Self::from_baid58_maybe_chunked_str(s, ':', '#') + } +} + +impl From for ContractId { + fn from(id: mpc::ProtocolId) -> Self { ContractId(id.into_inner()) } +} + +impl From for mpc::ProtocolId { + fn from(id: ContractId) -> Self { mpc::ProtocolId::from_inner(id.into_inner()) } +} + +/// Unique operation (genesis, extensions & state transition) identifier +/// equivalent to the commitment hash +#[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 OpId( + #[from] + #[from([u8; 32])] + Bytes32, +); + +impl From for OpId { + fn from(hasher: Sha256) -> Self { hasher.finish().into() } +} + +impl CommitmentId for OpId { + const TAG: &'static str = "urn:lnpbp:rgb:operation#2024-02-03"; +} + +impl FromStr for OpId { + type Err = hex::Error; + fn from_str(s: &str) -> Result { Self::from_hex(s) } +} + +impl OpId { + pub fn copy_from_slice(slice: impl AsRef<[u8]>) -> Result { + Bytes32::copy_from_slice(slice).map(Self) + } +} diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 3a5ae2b3..7b1d2a33 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -33,6 +33,7 @@ mod bundle; #[allow(clippy::module_inception)] mod contract; mod xchain; +mod id; pub use anchor::{AnchorSet, AnchoredBundle, Layer1, WitnessAnchor, XAnchor}; pub use assignments::{ @@ -51,9 +52,9 @@ pub use fungible::{ InvalidFieldElement, NoiseDumb, PedersenCommitment, RangeProof, RangeProofError, RevealedValue, }; pub use global::{GlobalState, GlobalValues}; +pub use id::{ContractId, OpId}; pub use operations::{ - ContractId, Extension, Genesis, Input, Inputs, OpId, OpRef, Operation, Redeemed, Transition, - Valencies, + Extension, Genesis, Input, Inputs, OpRef, Operation, Redeemed, Transition, Valencies, }; pub use seal::{ ExposedSeal, GenesisSeal, GraphSeal, OutputSeal, SecretSeal, TxoSeal, WitnessId, WitnessOrd, diff --git a/src/contract/operations.rs b/src/contract/operations.rs index cdf80862..cf2d389f 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -21,21 +21,17 @@ // limitations under the License. use std::collections::{btree_map, btree_set}; -use std::fmt::{self, Display, Formatter}; use std::iter; -use std::str::FromStr; use amplify::confinement::{SmallBlob, TinyOrdMap, TinyOrdSet}; -use amplify::hex::{FromHex, ToHex}; -use amplify::{hex, ByteArray, Bytes32, FromSliceError, Wrapper}; -use baid58::{Baid58ParseError, Chunking, FromBaid58, ToBaid58, CHUNKING_32CHECKSUM}; -use commit_verify::{mpc, CommitId, CommitmentId, Conceal, DigestExt, Sha256}; +use amplify::Wrapper; +use commit_verify::{CommitId, Conceal}; use strict_encoding::{StrictDeserialize, StrictEncode, StrictSerialize}; use crate::schema::{self, ExtensionType, OpFullType, OpType, SchemaId, TransitionType}; use crate::{ - AltLayer1Set, AssignmentType, Assignments, AssignmentsRef, Ffv, GenesisSeal, GlobalState, - GraphSeal, Opout, ReservedByte, TypedAssigns, LIB_NAME_RGB, + AltLayer1Set, AssignmentType, Assignments, AssignmentsRef, ContractId, Ffv, GenesisSeal, + GlobalState, GraphSeal, OpId, Opout, ReservedByte, TypedAssigns, LIB_NAME_RGB, }; #[derive(Wrapper, WrapperMut, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Default, From)] @@ -118,103 +114,6 @@ impl Input { } } -/// Unique operation (genesis, extensions & state transition) identifier -/// equivalent to the commitment hash -#[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 OpId( - #[from] - #[from([u8; 32])] - Bytes32, -); - -impl From for OpId { - fn from(hasher: Sha256) -> Self { hasher.finish().into() } -} - -impl CommitmentId for OpId { - const TAG: &'static str = "urn:lnpbp:rgb:operation#2024-02-03"; -} - -impl FromStr for OpId { - type Err = hex::Error; - fn from_str(s: &str) -> Result { Self::from_hex(s) } -} - -impl OpId { - pub fn copy_from_slice(slice: impl AsRef<[u8]>) -> Result { - Bytes32::copy_from_slice(slice).map(Self) - } -} - -/// Unique contract identifier equivalent to the contract genesis commitment -#[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)] -#[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] -#[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 ContractId( - #[from] - #[from([u8; 32])] - Bytes32, -); - -impl PartialEq for ContractId { - fn eq(&self, other: &OpId) -> bool { self.to_byte_array() == other.to_byte_array() } -} -impl PartialEq for OpId { - fn eq(&self, other: &ContractId) -> bool { self.to_byte_array() == other.to_byte_array() } -} - -impl ContractId { - pub fn copy_from_slice(slice: impl AsRef<[u8]>) -> Result { - Bytes32::copy_from_slice(slice).map(Self) - } -} - -impl ToBaid58<32> for ContractId { - const HRI: &'static str = "rgb"; - const CHUNKING: Option = CHUNKING_32CHECKSUM; - fn to_baid58_payload(&self) -> [u8; 32] { self.to_byte_array() } - fn to_baid58_string(&self) -> String { self.to_string() } -} -impl FromBaid58<32> for ContractId {} -impl Display for ContractId { - fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - if f.alternate() { - write!(f, "{::^}", self.to_baid58()) - } else { - write!(f, "{::^.3}", self.to_baid58()) - } - } -} -impl FromStr for ContractId { - type Err = Baid58ParseError; - fn from_str(s: &str) -> Result { - Self::from_baid58_maybe_chunked_str(s, ':', '#') - } -} - -impl From for ContractId { - fn from(id: mpc::ProtocolId) -> Self { ContractId(id.into_inner()) } -} - -impl From for mpc::ProtocolId { - fn from(id: ContractId) -> Self { mpc::ProtocolId::from_inner(id.into_inner()) } -} - /// RGB contract operation API, defined as trait /// /// Implemented by all contract operation types (see [`OpType`]): @@ -399,7 +298,7 @@ impl Operation for Genesis { fn full_type(&self) -> OpFullType { OpFullType::Genesis } #[inline] - fn id(&self) -> OpId { OpId(self.commit_id().into_inner()) } + fn id(&self) -> OpId { self.commit_id() } #[inline] fn contract_id(&self) -> ContractId { ContractId::from_inner(self.id().into_inner()) } @@ -624,6 +523,11 @@ impl<'op> Operation for OpRef<'op> { #[cfg(test)] mod test { + use std::str::FromStr; + + use amplify::ByteArray; + use baid58::ToBaid58; + use super::*; #[test] From a7077ab5fb6a4a732c1a6b25f9a9e24205d3d405 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 10 Feb 2024 12:01:23 +0100 Subject: [PATCH 07/29] contract: make reserved bytes generic on number of bytes --- src/contract/operations.rs | 5 +++-- src/lib.rs | 19 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/contract/operations.rs b/src/contract/operations.rs index cf2d389f..fc843928 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -31,7 +31,7 @@ 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, ReservedByte, TypedAssigns, LIB_NAME_RGB, + GlobalState, GraphSeal, OpId, Opout, ReservedBytes, TypedAssigns, LIB_NAME_RGB, }; #[derive(Wrapper, WrapperMut, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Default, From)] @@ -102,7 +102,8 @@ impl<'a> IntoIterator for &'a Inputs { #[display("{prev_out}")] pub struct Input { pub prev_out: Opout, - reserved: ReservedByte, + #[cfg_attr(feature = "serde", serde(skip))] + reserved: ReservedBytes<2>, } impl Input { diff --git a/src/lib.rs b/src/lib.rs index 986d8a97..b5ad1129 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,26 +64,25 @@ pub use prelude::*; pub const LIB_NAME_RGB: &str = "RGB"; /// Reserved byte. -#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Default, Debug, Display)] +#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] #[display("reserved")] #[derive(StrictType, StrictEncode)] #[strict_type(lib = LIB_NAME_RGB)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") -)] -pub struct ReservedByte(u8); +pub struct ReservedBytes([u8; LEN]); + +impl Default for ReservedBytes { + fn default() -> Self { Self([0; LEN]) } +} mod _reserved { use strict_encoding::{DecodeError, ReadTuple, StrictDecode, TypedRead}; - use crate::ReservedByte; + use crate::ReservedBytes; - impl StrictDecode for ReservedByte { + impl StrictDecode for ReservedBytes { fn strict_decode(reader: &mut impl TypedRead) -> Result { let reserved = reader.read_tuple(|r| r.read_field().map(Self))?; - if reserved != ReservedByte::default() { + if reserved != ReservedBytes::::default() { Err(DecodeError::DataIntegrityError(format!( "unsupported reserved byte value indicating a future RGB version. Please \ update your software, or, if the problem persists, contact your vendor \ From 2308c1700cd91a54e2ea096e0890d2ad23c6f702 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 11 Feb 2024 11:01:15 +0100 Subject: [PATCH 08/29] contract: rename StateData and StateCommitment types remove their strict encoding --- src/contract/attachment.rs | 6 ++-- src/contract/data.rs | 10 +++--- src/contract/fungible.rs | 6 ++-- src/contract/mod.rs | 2 +- src/contract/state.rs | 65 +++++++++++--------------------------- src/stl.rs | 2 +- src/validation/state.rs | 22 ++++++------- 7 files changed, 42 insertions(+), 71 deletions(-) diff --git a/src/contract/attachment.rs b/src/contract/attachment.rs index b34eb1d5..69867714 100644 --- a/src/contract/attachment.rs +++ b/src/contract/attachment.rs @@ -29,7 +29,7 @@ use commit_verify::{CommitVerify, Conceal, StrictEncodedProtocol}; use strict_encoding::StrictEncode; use super::{ConfidentialState, ExposedState}; -use crate::{MediaType, StateCommitment, StateData, StateType, LIB_NAME_RGB}; +use crate::{ConcealedState, MediaType, RevealedState, StateType, LIB_NAME_RGB}; /// Unique data attachment identifier #[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, From)] @@ -110,7 +110,7 @@ impl RevealedAttach { impl ExposedState for RevealedAttach { type Confidential = ConcealedAttach; fn state_type(&self) -> StateType { StateType::Attachment } - fn state_data(&self) -> StateData { StateData::Attachment(self.clone()) } + fn state_data(&self) -> RevealedState { RevealedState::Attachment(self.clone()) } } impl Conceal for RevealedAttach { @@ -139,7 +139,7 @@ pub struct ConcealedAttach( impl ConfidentialState for ConcealedAttach { fn state_type(&self) -> StateType { StateType::Attachment } - fn state_commitment(&self) -> StateCommitment { StateCommitment::Attachment(*self) } + fn state_commitment(&self) -> ConcealedState { ConcealedState::Attachment(*self) } } impl CommitVerify for ConcealedAttach { diff --git a/src/contract/data.rs b/src/contract/data.rs index ed93def2..278f8ec3 100644 --- a/src/contract/data.rs +++ b/src/contract/data.rs @@ -31,7 +31,7 @@ use commit_verify::{CommitVerify, Conceal, StrictEncodedProtocol}; use strict_encoding::{StrictSerialize, StrictType}; use super::{ConfidentialState, ExposedState}; -use crate::{StateCommitment, StateData, StateType, LIB_NAME_RGB}; +use crate::{ConcealedState, RevealedState, StateType, LIB_NAME_RGB}; /// Struct using for storing Void (i.e. absent) state #[derive(Copy, Clone, Debug, PartialOrd, Ord, PartialEq, Eq, Hash, Display, Default)] @@ -43,13 +43,13 @@ pub struct VoidState(()); impl ConfidentialState for VoidState { fn state_type(&self) -> StateType { StateType::Void } - fn state_commitment(&self) -> StateCommitment { StateCommitment::Void } + fn state_commitment(&self) -> ConcealedState { ConcealedState::Void } } impl ExposedState for VoidState { type Confidential = VoidState; fn state_type(&self) -> StateType { StateType::Void } - fn state_data(&self) -> StateData { StateData::Void } + fn state_data(&self) -> RevealedState { RevealedState::Void } } impl Conceal for VoidState { @@ -102,7 +102,7 @@ impl RevealedData { impl ExposedState for RevealedData { type Confidential = ConcealedData; fn state_type(&self) -> StateType { StateType::Structured } - fn state_data(&self) -> StateData { StateData::Structured(self.clone()) } + fn state_data(&self) -> RevealedState { RevealedState::Structured(self.clone()) } } impl Conceal for RevealedData { @@ -155,7 +155,7 @@ pub struct ConcealedData( impl ConfidentialState for ConcealedData { fn state_type(&self) -> StateType { StateType::Structured } - fn state_commitment(&self) -> StateCommitment { StateCommitment::Structured(*self) } + fn state_commitment(&self) -> ConcealedState { ConcealedState::Structured(*self) } } impl CommitVerify for ConcealedData { diff --git a/src/contract/fungible.rs b/src/contract/fungible.rs index e6b1b155..4bc4aef6 100644 --- a/src/contract/fungible.rs +++ b/src/contract/fungible.rs @@ -55,7 +55,7 @@ use strict_encoding::{ }; use super::{ConfidentialState, ExposedState}; -use crate::{schema, AssignmentType, StateCommitment, StateData, StateType, LIB_NAME_RGB}; +use crate::{schema, AssignmentType, ConcealedState, RevealedState, StateType, LIB_NAME_RGB}; #[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)] #[wrapper(Deref, BorrowSlice, Hex, Index, RangeOps)] @@ -327,7 +327,7 @@ impl RevealedValue { impl ExposedState for RevealedValue { type Confidential = ConcealedValue; fn state_type(&self) -> StateType { StateType::Fungible } - fn state_data(&self) -> StateData { StateData::Fungible(*self) } + fn state_data(&self) -> RevealedState { RevealedState::Fungible(*self) } } impl Conceal for RevealedValue { @@ -470,7 +470,7 @@ pub struct ConcealedValue { impl ConfidentialState for ConcealedValue { fn state_type(&self) -> StateType { StateType::Fungible } - fn state_commitment(&self) -> StateCommitment { StateCommitment::Fungible(*self) } + fn state_commitment(&self) -> ConcealedState { ConcealedState::Fungible(*self) } } impl CommitVerify for ConcealedValue { diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 7b1d2a33..14945963 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -60,7 +60,7 @@ pub use seal::{ ExposedSeal, GenesisSeal, GraphSeal, OutputSeal, SecretSeal, TxoSeal, WitnessId, WitnessOrd, WitnessPos, XGenesisSeal, XGraphSeal, XOutputSeal, XPubWitness, XWitness, }; -pub use state::{ConfidentialState, ExposedState, StateCommitment, StateData, StateType}; +pub use state::{ConcealedState, ConfidentialState, ExposedState, RevealedState, StateType}; pub use xchain::{ AltLayer1, AltLayer1Set, XChain, XChainParseError, XOutpoint, XCHAIN_BITCOIN_PREFIX, XCHAIN_LIQUID_PREFIX, diff --git a/src/contract/state.rs b/src/contract/state.rs index 3054ef27..00092e14 100644 --- a/src/contract/state.rs +++ b/src/contract/state.rs @@ -28,16 +28,13 @@ use strict_encoding::{StrictDecode, StrictDumb, StrictEncode}; use crate::{ ConcealedAttach, ConcealedData, ConcealedValue, RevealedAttach, RevealedData, RevealedValue, - LIB_NAME_RGB, }; /// Marker trait for types of state which are just a commitment to the actual /// state data. -pub trait ConfidentialState: - Debug + Hash + StrictDumb + StrictEncode + StrictDecode + Eq + Copy -{ +pub trait ConfidentialState: Debug + Hash + Eq + Copy { fn state_type(&self) -> StateType; - fn state_commitment(&self) -> StateCommitment; + fn state_commitment(&self) -> ConcealedState; } /// Marker trait for types of state holding explicit state data. @@ -51,9 +48,9 @@ pub trait ExposedState: + Ord + Clone { - type Confidential: ConfidentialState; + type Confidential: ConfidentialState + StrictEncode + StrictDecode + StrictDumb; fn state_type(&self) -> StateType; - fn state_data(&self) -> StateData; + fn state_data(&self) -> RevealedState; } /// Categories of the state @@ -81,77 +78,51 @@ pub enum StateType { /// Categories of the state #[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)] -#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] -#[strict_type(lib = LIB_NAME_RGB, tags = custom)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate", rename_all = "camelCase") )] -pub enum StateData { - #[strict_type(tag = 0x00, dumb)] +pub enum RevealedState { Void, - #[strict_type(tag = 0x01)] Fungible(RevealedValue), - #[strict_type(tag = 0x02)] Structured(RevealedData), - #[strict_type(tag = 0xFF)] Attachment(RevealedAttach), } -impl ExposedState for StateData { - type Confidential = StateCommitment; - fn state_type(&self) -> StateType { - match self { - StateData::Void => StateType::Void, - StateData::Fungible(_) => StateType::Fungible, - StateData::Structured(_) => StateType::Structured, - StateData::Attachment(_) => StateType::Attachment, - } - } - fn state_data(&self) -> StateData { self.clone() } -} - -impl Conceal for StateData { - type Concealed = StateCommitment; - fn conceal(&self) -> Self::Concealed { +impl RevealedState { + pub fn state_type(&self) -> StateType { match self { - StateData::Void => StateCommitment::Void, - StateData::Fungible(value) => StateCommitment::Fungible(value.conceal()), - StateData::Structured(data) => StateCommitment::Structured(data.conceal()), - StateData::Attachment(attach) => StateCommitment::Attachment(attach.conceal()), + RevealedState::Void => StateType::Void, + RevealedState::Fungible(_) => StateType::Fungible, + RevealedState::Structured(_) => StateType::Structured, + RevealedState::Attachment(_) => StateType::Attachment, } } } #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] -#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] -#[strict_type(lib = LIB_NAME_RGB, tags = custom)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate", rename_all = "camelCase") )] #[allow(clippy::large_enum_variant)] -pub enum StateCommitment { - #[strict_type(tag = 0x00, dumb)] +pub enum ConcealedState { Void, - #[strict_type(tag = 0x01)] Fungible(ConcealedValue), - #[strict_type(tag = 0x02)] Structured(ConcealedData), - #[strict_type(tag = 0xFF)] Attachment(ConcealedAttach), } -impl ConfidentialState for StateCommitment { +impl ConfidentialState for ConcealedState { fn state_type(&self) -> StateType { match self { - StateCommitment::Void => StateType::Void, - StateCommitment::Fungible(_) => StateType::Fungible, - StateCommitment::Structured(_) => StateType::Structured, - StateCommitment::Attachment(_) => StateType::Attachment, + ConcealedState::Void => StateType::Void, + ConcealedState::Fungible(_) => StateType::Fungible, + ConcealedState::Structured(_) => StateType::Structured, + ConcealedState::Attachment(_) => StateType::Attachment, } } - fn state_commitment(&self) -> StateCommitment { *self } + fn state_commitment(&self) -> ConcealedState { *self } } diff --git a/src/stl.rs b/src/stl.rs index 5128d3e1..a016b2a2 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -32,7 +32,7 @@ use crate::{AnchoredBundle, ContractState, Extension, Genesis, SubSchema, LIB_NA /// Strict types id for the library providing data types for RGB consensus. pub const LIB_ID_RGB: &str = - "urn:ubideco:stl:ENn5cEDW7QUStLzY6HBXjZFARAbrGHv3tXmdQ3QGzoU3#option-data-mimosa"; + "urn:ubideco:stl:2YfZKdnGf9Gibvh15WcNSqe3xN7WH1143j1gCbDgecvG#axiom-detail-panther"; fn _rgb_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_RGB), tiny_bset! { diff --git a/src/validation/state.rs b/src/validation/state.rs index 586e9da6..878aa75e 100644 --- a/src/validation/state.rs +++ b/src/validation/state.rs @@ -24,8 +24,8 @@ use strict_types::TypeSystem; use crate::schema::AssignmentType; use crate::{ - validation, Assign, ConfidentialState, ExposedSeal, ExposedState, OpId, StateCommitment, - StateData, StateSchema, + validation, Assign, ConcealedState, ConfidentialState, ExposedSeal, ExposedState, OpId, + RevealedState, StateSchema, }; impl StateSchema { @@ -40,8 +40,8 @@ impl StateSchema { match data { Assign::Confidential { state, .. } | Assign::ConfidentialState { state, .. } => { match (self, state.state_commitment()) { - (StateSchema::Declarative, StateCommitment::Void) => {} - (StateSchema::Fungible(_), StateCommitment::Fungible(value)) => { + (StateSchema::Declarative, ConcealedState::Void) => {} + (StateSchema::Fungible(_), ConcealedState::Fungible(value)) => { // [SECURITY-CRITICAL]: Bulletproofs validation if let Err(err) = value.verify_range_proof() { status.add_failure(validation::Failure::BulletproofsInvalid( @@ -51,12 +51,12 @@ impl StateSchema { )); } } - (StateSchema::Structured(_), StateCommitment::Structured(_)) => { + (StateSchema::Structured(_), ConcealedState::Structured(_)) => { status.add_info(validation::Info::UncheckableConfidentialState( *opid, state_type, )); } - (StateSchema::Attachment(_), StateCommitment::Attachment(_)) => { + (StateSchema::Attachment(_), ConcealedState::Attachment(_)) => { status.add_info(validation::Info::UncheckableConfidentialState( *opid, state_type, )); @@ -74,8 +74,8 @@ impl StateSchema { } Assign::Revealed { state, .. } | Assign::ConfidentialSeal { state, .. } => { match (self, state.state_data()) { - (StateSchema::Declarative, StateData::Void) => {} - (StateSchema::Attachment(media_type), StateData::Attachment(attach)) + (StateSchema::Declarative, RevealedState::Void) => {} + (StateSchema::Attachment(media_type), RevealedState::Attachment(attach)) if !attach.media_type.conforms(media_type) => { status.add_failure(validation::Failure::MediaTypeMismatch { @@ -85,7 +85,7 @@ impl StateSchema { found: attach.media_type, }); } - (StateSchema::Fungible(schema), StateData::Fungible(v)) + (StateSchema::Fungible(schema), RevealedState::Fungible(v)) if v.value.fungible_type() != *schema => { status.add_failure(validation::Failure::FungibleTypeMismatch { @@ -95,8 +95,8 @@ impl StateSchema { found: v.value.fungible_type(), }); } - (StateSchema::Fungible(_), StateData::Fungible(_)) => {} - (StateSchema::Structured(sem_id), StateData::Structured(data)) => { + (StateSchema::Fungible(_), RevealedState::Fungible(_)) => {} + (StateSchema::Structured(sem_id), RevealedState::Structured(data)) => { if type_system .strict_deserialize_type(*sem_id, data.value.as_ref()) .is_err() From e1d9939d1b03abf2873fea8eb62c07fac472bfa9 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 11 Feb 2024 12:02:16 +0100 Subject: [PATCH 09/29] contract: solve operation commitment determinism --- Cargo.lock | 4 +- src/contract/id.rs | 208 ++++++++++++++++++++++++++++++++++++- src/contract/mod.rs | 7 +- src/contract/operations.rs | 44 ++++++-- src/contract/xchain.rs | 4 +- src/stl.rs | 7 +- 6 files changed, 254 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad01b86e..3342826e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,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#61b0f4969da8a69cef438de6b3085344c5626ec2" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#9f9057555d5d8907f3537069044f7503b81c3ee7" dependencies = [ "amplify", "amplify_syn", @@ -304,7 +304,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#61b0f4969da8a69cef438de6b3085344c5626ec2" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#9f9057555d5d8907f3537069044f7503b81c3ee7" dependencies = [ "amplify", "commit_encoding_derive", diff --git a/src/contract/id.rs b/src/contract/id.rs index 072b8c44..e7379888 100644 --- a/src/contract/id.rs +++ b/src/contract/id.rs @@ -20,16 +20,26 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::fmt; use std::fmt::{Display, Formatter}; use std::str::FromStr; +use std::{fmt, vec}; use amplify::hex::{FromHex, ToHex}; +use amplify::num::u256; use amplify::{hex, ByteArray, Bytes32, FromSliceError, Wrapper}; use baid58::{Baid58ParseError, Chunking, FromBaid58, ToBaid58, CHUNKING_32CHECKSUM}; -use commit_verify::{mpc, CommitmentId, DigestExt, Sha256}; +use commit_verify::{ + mpc, CommitEncode, CommitEngine, CommitId, CommitmentId, Conceal, DigestExt, MerkleHash, + MerkleLeaves, Sha256, StrictHash, +}; +use strict_encoding::StrictEncode; -use crate::LIB_NAME_RGB; +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, +}; /// Unique contract identifier equivalent to the contract genesis commitment #[derive(Wrapper, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)] @@ -127,3 +137,195 @@ impl OpId { 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)] +pub struct BaseCommitment { + pub schema_id: SchemaId, + pub testnet: bool, + pub alt_layers1: StrictHash, +} + +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB, tags = custom, dumb = Self::Transition(strict_dumb!(), strict_dumb!()))] +pub enum TypeCommitment { + #[strict_type(tag = 0)] + Genesis(BaseCommitment), + + #[strict_type(tag = 1)] + Transition(ContractId, TransitionType), + + #[strict_type(tag = 2)] + Extension(ContractId, ExtensionType), +} + +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = OpId)] +pub struct OpCommitment { + pub ffv: Ffv, + pub op_type: TypeCommitment, + pub metadata: StrictHash, + pub globals: MerkleHash, + pub inputs: MerkleHash, + pub assignments: MerkleHash, + pub redeemed: StrictHash, + pub valencies: StrictHash, +} + +impl Genesis { + pub fn commit(&self) -> OpCommitment { + let base = BaseCommitment { + schema_id: self.schema_id, + testnet: self.testnet, + alt_layers1: self.alt_layers1.commit_id(), + }; + OpCommitment { + ffv: self.ffv, + op_type: TypeCommitment::Genesis(base), + metadata: self.metadata.commit_id(), + globals: MerkleHash::merklize(&self.globals), + inputs: MerkleHash::void(0, u256::ZERO), + assignments: MerkleHash::merklize(&self.assignments), + redeemed: Redeemed::default().commit_id(), + valencies: self.valencies.commit_id(), + } + } +} + +impl Transition { + pub fn commit(&self) -> OpCommitment { + OpCommitment { + ffv: self.ffv, + op_type: TypeCommitment::Transition(self.contract_id, self.transition_type), + metadata: self.metadata.commit_id(), + globals: MerkleHash::merklize(&self.globals), + inputs: MerkleHash::merklize(&self.inputs), + assignments: MerkleHash::merklize(&self.assignments), + redeemed: Redeemed::default().commit_id(), + valencies: self.valencies.commit_id(), + } + } +} + +impl Extension { + pub fn commit(&self) -> OpCommitment { + OpCommitment { + ffv: self.ffv, + op_type: TypeCommitment::Extension(self.contract_id, self.extension_type), + metadata: self.metadata.commit_id(), + globals: MerkleHash::merklize(&self.globals), + inputs: MerkleHash::void(0, u256::ZERO), + assignments: MerkleHash::merklize(&self.assignments), + redeemed: self.redeemed.commit_id(), + valencies: self.valencies.commit_id(), + } + } +} + +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), + } + } +} + +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +pub struct AssignmentCommitment { + pub ty: AssignmentType, + pub state: ConcealedState, + pub seal: XChain, +} + +impl CommitEncode for AssignmentCommitment { + type CommitmentId = MerkleHash; + + fn commit_encode(&self, e: &mut CommitEngine) { + e.commit_to(&self.ty); + self.state.commit_encode(e); + e.commit_to(&self.seal); + e.set_finished(); + } +} + +impl Assign { + pub fn commitment(&self, ty: AssignmentType) -> AssignmentCommitment { + let Self::Confidential { seal, state } = self.conceal() else { + unreachable!(); + }; + AssignmentCommitment { + ty, + state: state.state_commitment(), + seal, + } + } +} + +impl MerkleLeaves for Assignments { + type Leaf = AssignmentCommitment; + type LeafIter<'tmp> = vec::IntoIter where Seal: 'tmp; + + fn merkle_leaves(&self) -> Self::LeafIter<'_> { + self.iter() + .flat_map(|(ty, a)| { + match a { + TypedAssigns::Declarative(list) => { + list.iter().map(|a| a.commitment(*ty)).collect::>() + } + TypedAssigns::Fungible(list) => { + list.iter().map(|a| a.commitment(*ty)).collect() + } + TypedAssigns::Structured(list) => { + list.iter().map(|a| a.commitment(*ty)).collect() + } + TypedAssigns::Attachment(list) => { + list.iter().map(|a| a.commitment(*ty)).collect() + } + } + .into_iter() + }) + .collect::>() + .into_iter() + } +} + +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +pub struct GlobalCommitment { + pub ty: GlobalStateType, + pub state: ConcealedData, +} + +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.set_finished(); + } +} + +impl MerkleLeaves for GlobalState { + type Leaf = GlobalCommitment; + type LeafIter<'tmp> = vec::IntoIter; + + fn merkle_leaves(&self) -> Self::LeafIter<'_> { + self.iter() + .flat_map(|(ty, list)| { + list.iter().map(|val| GlobalCommitment { + ty: *ty, + state: val.conceal(), + }) + }) + .collect::>() + .into_iter() + } +} diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 14945963..56608287 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -52,9 +52,12 @@ pub use fungible::{ InvalidFieldElement, NoiseDumb, PedersenCommitment, RangeProof, RangeProofError, RevealedValue, }; pub use global::{GlobalState, GlobalValues}; -pub use id::{ContractId, OpId}; +pub use id::{ + AssignmentCommitment, BaseCommitment, ContractId, GlobalCommitment, OpCommitment, OpId, + TypeCommitment, +}; pub use operations::{ - Extension, Genesis, Input, Inputs, OpRef, Operation, Redeemed, Transition, Valencies, + Extension, Genesis, Input, Inputs, Metadata, OpRef, Operation, Redeemed, Transition, Valencies, }; pub use seal::{ ExposedSeal, GenesisSeal, GraphSeal, OutputSeal, SecretSeal, TxoSeal, WitnessId, WitnessOrd, diff --git a/src/contract/operations.rs b/src/contract/operations.rs index fc843928..c101aa13 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -25,7 +25,7 @@ use std::iter; use amplify::confinement::{SmallBlob, TinyOrdMap, TinyOrdSet}; use amplify::Wrapper; -use commit_verify::{CommitId, Conceal}; +use commit_verify::{CommitId, Conceal, MerkleHash, MerkleLeaves, StrictHash}; use strict_encoding::{StrictDeserialize, StrictEncode, StrictSerialize}; use crate::schema::{self, ExtensionType, OpFullType, OpType, SchemaId, TransitionType}; @@ -39,10 +39,26 @@ use crate::{ #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = StrictHash)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") + serde(crate = "serde_crate", transparent) +)] +pub struct Metadata(SmallBlob); + +#[derive(Wrapper, WrapperMut, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Default, From)] +#[wrapper(Deref)] +#[wrapper_mut(DerefMut)] +#[derive(StrictType, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = StrictHash)] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate", transparent) )] pub struct Valencies(TinyOrdSet); @@ -58,10 +74,12 @@ impl<'a> IntoIterator for &'a Valencies { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = StrictHash)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") + serde(crate = "serde_crate", transparent) )] pub struct Redeemed(TinyOrdMap); @@ -80,7 +98,7 @@ impl<'a> IntoIterator for &'a Redeemed { #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), - serde(crate = "serde_crate", rename_all = "camelCase") + serde(crate = "serde_crate", transparent) )] pub struct Inputs(TinyOrdSet); @@ -91,9 +109,18 @@ impl<'a> IntoIterator for &'a Inputs { fn into_iter(self) -> Self::IntoIter { self.0.iter().copied() } } +impl MerkleLeaves for Inputs { + type Leaf = Input; + type LeafIter<'tmp> = as MerkleLeaves>::LeafIter<'tmp>; + + fn merkle_leaves(&self) -> Self::LeafIter<'_> { self.0.merkle_leaves() } +} + #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = MerkleHash)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -179,9 +206,8 @@ pub struct Genesis { pub schema_id: SchemaId, pub testnet: bool, pub alt_layers1: AltLayer1Set, - pub metadata: SmallBlob, + pub metadata: Metadata, pub globals: GlobalState, - // TODO: Merklize assignments for the commitment pub assignments: Assignments, pub valencies: Valencies, } @@ -203,9 +229,8 @@ pub struct Extension { pub ffv: Ffv, pub contract_id: ContractId, pub extension_type: ExtensionType, - pub metadata: SmallBlob, + pub metadata: Metadata, pub globals: GlobalState, - // TODO: Merklize assignments for the commitment pub assignments: Assignments, pub redeemed: Redeemed, pub valencies: Valencies, @@ -228,10 +253,9 @@ pub struct Transition { pub ffv: Ffv, pub contract_id: ContractId, pub transition_type: TransitionType, - pub metadata: SmallBlob, + pub metadata: Metadata, pub globals: GlobalState, pub inputs: Inputs, - // TODO: Merklize assignments for the commitment pub assignments: Assignments, pub valencies: Valencies, } diff --git a/src/contract/xchain.rs b/src/contract/xchain.rs index 0beb92d6..51c696b4 100644 --- a/src/contract/xchain.rs +++ b/src/contract/xchain.rs @@ -27,7 +27,7 @@ use std::{fmt, io}; use amplify::confinement::TinyOrdSet; use bp::{Bp, Outpoint}; -use commit_verify::Conceal; +use commit_verify::{Conceal, StrictHash}; use strict_encoding::{ DecodeError, DefineUnion, ReadTuple, ReadUnion, StrictDecode, StrictDumb, StrictEncode, StrictSum, StrictType, StrictUnion, TypedRead, TypedWrite, WriteUnion, @@ -81,6 +81,8 @@ impl AltLayer1 { #[wrapper_mut(DerefMut)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = StrictHash)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), diff --git a/src/stl.rs b/src/stl.rs index a016b2a2..7348a90d 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -28,11 +28,13 @@ use strict_types::stl::{std_stl, strict_types_stl}; use strict_types::typelib::LibBuilder; use strict_types::{CompileError, TypeLib}; -use crate::{AnchoredBundle, ContractState, Extension, Genesis, SubSchema, LIB_NAME_RGB}; +use crate::{ + AnchoredBundle, ContractState, Extension, Genesis, OpCommitment, SubSchema, LIB_NAME_RGB, +}; /// Strict types id for the library providing data types for RGB consensus. pub const LIB_ID_RGB: &str = - "urn:ubideco:stl:2YfZKdnGf9Gibvh15WcNSqe3xN7WH1143j1gCbDgecvG#axiom-detail-panther"; + "urn:ubideco:stl:BQugurBw6JSc3iF92RZipSMbFgsRU9M6jkYjSctpMzX2#ecology-nobel-prince"; fn _rgb_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_RGB), tiny_bset! { @@ -48,6 +50,7 @@ fn _rgb_core_stl() -> Result { .transpile::() .transpile::() .transpile::() + .transpile::() .compile() } From cd603b7da89efc1701dfb423aba71351d90d0a08 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 11 Feb 2024 12:10:22 +0100 Subject: [PATCH 10/29] stl: update --- stl/AnchoredBundle.vesper | 4 +- stl/RGB@0.1.0.sta | 579 ++++++++++++++++++++------------------ stl/RGB@0.1.0.stl | Bin 15493 -> 16578 bytes stl/RGB@0.1.0.sty | 46 ++- stl/Transition.vesper | 4 +- 5 files changed, 339 insertions(+), 294 deletions(-) diff --git a/stl/AnchoredBundle.vesper b/stl/AnchoredBundle.vesper index f736001b..f6567e95 100644 --- a/stl/AnchoredBundle.vesper +++ b/stl/AnchoredBundle.vesper @@ -94,7 +94,7 @@ AnchoredBundle rec ffv is U16 aka=Ffv contractId bytes len=32 aka=ContractId transitionType is U16 aka=TransitionType - metadata bytes len=0..MAX16 + metadata bytes len=0..MAX16 aka=Metadata globals map len=0..MAX8 aka=GlobalState key is U16 aka=GlobalStateType value list len=1..MAX16 aka=GlobalValues @@ -107,7 +107,7 @@ AnchoredBundle rec op bytes len=32 aka=OpId ty is U16 aka=AssignmentType no is U16 - reserved is U8 aka=ReservedByte + reserved bytes len=2 aka=ReservedBytes2 assignments map len=0..MAX8 aka=AssignmentsBlindSealTxPtr key is U16 aka=AssignmentType TypedAssignsBlindSealTxPtr union -- mapped to diff --git a/stl/RGB@0.1.0.sta b/stl/RGB@0.1.0.sta index e7be7c35..f0c8b0c2 100644 --- a/stl/RGB@0.1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;wMV}$S71A_c+ss>J-25Z+kSUfbJNxT9lw4#EdO?y zjVrjMC^NZavnQ(>Gh^uH0**~g3ZYWRc3yvcOO5yFj@S_C<-!~4`tEE$?UG)xWb+NB zscL1LowyVE_!Em$o%3^ZGfQ$)^Gev5Cs!)eF)~eLRZt*g<>rNwj4XQw09zU3_ z5x+ROTkx>!j0>mR7F^i>WtIB=^Lbvug6xy;7;0{QAnV9XoYKh;WOX<9C>k*PoZg{p z{Vd~iacYs;{l=9aBE{1gJv_eLi!sS4+q!%MBO{w(pR2HN%etX2@#j`+(*^Y@}=`~){OB$=QbOod@35D6Vyk|FOxy_La zH4hYAnuLOjJv}EsDKV!Qq*%jZo^zYJD655=bY#8!QIW=VKL2@IH?WC6GO61)TlA4J zTPE0VAho)L)N&^l7iXsDfuav=xE3J|97U-qsj0cCDInvu3AvlIEHNiFFF7+6Y&hXm z5uwVvbCFgP$VY%bRf;2Ewn7H1YSure}!eRm+pv*pIO-&)TY?7QmY zX0)=`FR#3H=x(DM^9Ocm1xButqQt!7%#zIfJO);#$@ircC(kuh9a%WWem> zs7-esA{VtLc*SI@vt)3Q9|gSs58P8BaPnDZORd z=bri3Us-mutKV{sJPQsVPpC zC8I86LcPr3Ani_1GV7nN9R`@R1=6uhxM($>KuW^t0MVZr&ybiutKFjCH z)jtyIt2cL>$}%dvanOpMKli-kzJ{-RpD^5CeCc_q)Y40}b?d&^@|>ITEOGM*v#X4Z PQj-^2iEo}_smBfgU3Gvu diff --git a/stl/RGB@0.1.0.sty b/stl/RGB@0.1.0.sty index 600a1e3c..6ff972bb 100644 --- a/stl/RGB@0.1.0.sty +++ b/stl/RGB@0.1.0.sty @@ -1,5 +1,5 @@ {- - Id: urn:ubideco:stl:ENn5cEDW7QUStLzY6HBXjZFARAbrGHv3tXmdQ3QGzoU3#option-data-mimosa + Id: urn:ubideco:stl:BQugurBw6JSc3iF92RZipSMbFgsRU9M6jkYjSctpMzX2#ecology-nobel-prince Name: RGB Version: 0.1.0 Description: Consensus layer for RGB smart contracts @@ -13,6 +13,7 @@ typelib RGB import CommitVerify#4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner use MerkleHash#culture-metro-modular + use StrictHash#cheese-final-locate use MerkleProof#labor-hilton-magenta import Std#55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray @@ -151,6 +152,11 @@ data AssignmentsBlindSealTxid : {AssignmentType -> ^ ..0xff TypedAssignsBlindSea @mnemonic(delta-member-agenda) data AttachId : [Byte ^ 32] +@mnemonic(goblin-accent-number) +data BaseCommitment : schemaId SchemaId + , testnet Std.Bool#laser-madam-maxwell + , altLayers1 CommitVerify.StrictHash#cheese-final-locate + @mnemonic(agenda-ivory-blast) data BlindingFactor : [Byte ^ 32] @@ -182,11 +188,11 @@ data ContractState : schema SchemaSchema, history ContractHistory @mnemonic(diana-archive-liquid) data DataState : [Byte] -@mnemonic(deluxe-history-acrobat) +@mnemonic(cubic-inca-maestro) data Extension : ffv Ffv , contractId ContractId , extensionType ExtensionType - , metadata [Byte] + , metadata Metadata , globals GlobalState , assignments AssignmentsBlindSealTxid , redeemed Redeemed @@ -212,12 +218,12 @@ data FungibleState : bits64#8 U64 data FungibleType : unsigned64Bit#8 -@mnemonic(relax-emotion-nitro) +@mnemonic(darwin-between-pilot) data Genesis : ffv Ffv , schemaId SchemaId , testnet Std.Bool#laser-madam-maxwell , altLayers1 AltLayer1Set - , metadata [Byte] + , metadata Metadata , globals GlobalState , assignments AssignmentsBlindSealTxid , valencies Valencies @@ -243,8 +249,8 @@ data GlobalStateType : U16 @mnemonic(bicycle-europe-shampoo) data GlobalValues : [RevealedData ^ 1..] -@mnemonic(classic-chariot-domino) -data Input : prevOut Opout, reserved ReservedByte +@mnemonic(joseph-price-summer) +data Input : prevOut Opout, reserved ReservedBytes2 @mnemonic(puzzle-guru-oregano) data Inputs : {Input ^ ..0xff} @@ -253,12 +259,25 @@ data Inputs : {Input ^ ..0xff} data MediaType : any#255 +@mnemonic(moment-patriot-patron) +data Metadata : [Byte] + @mnemonic(deal-orca-aztec) data NoiseDumb : [Byte ^ 512] @mnemonic(unicorn-empire-mama) data Occurrences : min U16, max U16 +@mnemonic(canyon-climax-promo) +data OpCommitment : ffv Ffv + , opType TypeCommitment + , metadata CommitVerify.StrictHash#cheese-final-locate + , globals CommitVerify.MerkleHash#culture-metro-modular + , inputs CommitVerify.MerkleHash#culture-metro-modular + , assignments CommitVerify.MerkleHash#culture-metro-modular + , redeemed CommitVerify.StrictHash#cheese-final-locate + , valencies CommitVerify.StrictHash#cheese-final-locate + @mnemonic(slow-samuel-ceramic) data OpId : [Byte ^ 32] @@ -300,8 +319,8 @@ data RangeProof : placeholder#255 NoiseDumb @mnemonic(scoop-press-scuba) data Redeemed : {ValencyType -> ^ ..0xff OpId} -@mnemonic(balloon-justin-place) -data ReservedByte : U8 +@mnemonic(pocket-habitat-soviet) +data ReservedBytes2 : [Byte ^ 2] @mnemonic(cigar-network-event) data RevealedAttach : id AttachId @@ -352,11 +371,11 @@ data StateSchema : declarative () | structured StrictTypes.SemId#cargo-plasma-catalog | attachment MediaType -@mnemonic(folio-barbara-guru) +@mnemonic(morph-romeo-float) data Transition : ffv Ffv , contractId ContractId , transitionType TransitionType - , metadata [Byte] + , metadata Metadata , globals GlobalState , inputs Inputs , assignments AssignmentsBlindSealTxPtr @@ -375,6 +394,11 @@ data TransitionSchema : metadata StrictTypes.SemId#cargo-plasma-catalog @mnemonic(puma-joshua-evita) data TransitionType : U16 +@mnemonic(medusa-amigo-reunion) +data TypeCommitment : genesis BaseCommitment + | transition (ContractId, TransitionType) + | extension (ContractId, ExtensionType) + @mnemonic(orchid-season-bishop) data TypedAssignsBlindSealTxPtr : declarative [AssignVoidStateBlindSealTxPtr] | fungible [AssignRevealedValueBlindSealTxPtr] diff --git a/stl/Transition.vesper b/stl/Transition.vesper index 6b26324c..5c3f3d1b 100644 --- a/stl/Transition.vesper +++ b/stl/Transition.vesper @@ -2,7 +2,7 @@ Transition rec ffv is U16 aka=Ffv contractId bytes len=32 aka=ContractId transitionType is U16 aka=TransitionType - metadata bytes len=0..MAX16 + metadata bytes len=0..MAX16 aka=Metadata globals map len=0..MAX8 aka=GlobalState key is U16 aka=GlobalStateType value list len=1..MAX16 aka=GlobalValues @@ -15,7 +15,7 @@ Transition rec op bytes len=32 aka=OpId ty is U16 aka=AssignmentType no is U16 - reserved is U8 aka=ReservedByte + reserved bytes len=2 aka=ReservedBytes2 assignments map len=0..MAX8 aka=AssignmentsBlindSealTxPtr key is U16 aka=AssignmentType TypedAssignsBlindSealTxPtr union -- mapped to From e8f7c2ad40ae2933ced3c9e42bf9b3b27db6455b Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 11 Feb 2024 12:30:16 +0100 Subject: [PATCH 11/29] move ReservedBytes from standard library --- src/lib.rs | 68 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b5ad1129..defc7df6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,15 +63,24 @@ pub use prelude::*; pub const LIB_NAME_RGB: &str = "RGB"; -/// Reserved byte. +// TODO: Move to amplify crate + +/// Reserved bytes. #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] #[display("reserved")] #[derive(StrictType, StrictEncode)] #[strict_type(lib = LIB_NAME_RGB)] -pub struct ReservedBytes([u8; LEN]); +pub struct ReservedBytes([u8; LEN]); -impl Default for ReservedBytes { - fn default() -> Self { Self([0; LEN]) } +impl Default for ReservedBytes { + fn default() -> Self { Self([VAL; LEN]) } +} + +impl From<[u8; LEN]> for ReservedBytes { + fn from(value: [u8; LEN]) -> Self { + assert_eq!(value, [VAL; LEN]); + Self(value) + } } mod _reserved { @@ -79,10 +88,10 @@ mod _reserved { use crate::ReservedBytes; - impl StrictDecode for ReservedBytes { + impl StrictDecode for ReservedBytes { fn strict_decode(reader: &mut impl TypedRead) -> Result { let reserved = reader.read_tuple(|r| r.read_field().map(Self))?; - if reserved != ReservedBytes::::default() { + if reserved != ReservedBytes::::default() { Err(DecodeError::DataIntegrityError(format!( "unsupported reserved byte value indicating a future RGB version. Please \ update your software, or, if the problem persists, contact your vendor \ @@ -93,6 +102,53 @@ mod _reserved { } } } + + #[cfg(feature = "serde")] + mod _serde { + use std::fmt; + + use serde_crate::de::Visitor; + use serde_crate::{de, Deserialize, Deserializer, Serialize, Serializer}; + + use super::*; + + impl Serialize for ReservedBytes { + fn serialize(&self, serializer: S) -> Result + where S: Serializer { + // Doing nothing + serializer.serialize_unit() + } + } + + impl<'de, const LEN: usize, const VAL: u8> Deserialize<'de> for ReservedBytes { + fn deserialize(deserializer: D) -> Result + where D: Deserializer<'de> { + #[derive(Default)] + pub struct UntaggedUnitVisitor; + + impl<'de> Visitor<'de> for UntaggedUnitVisitor { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "reserved unit") + } + + fn visit_none(self) -> Result<(), E> + where E: de::Error { + Ok(()) + } + + fn visit_unit(self) -> Result<(), E> + where E: de::Error { + Ok(()) + } + } + + deserializer.deserialize_unit(UntaggedUnitVisitor)?; + Ok(default!()) + } + } + } } /// Fast-forward version code From 48d55da5bfa5ae0f8139131d3ff090108529c1a9 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 11 Feb 2024 16:08:06 +0100 Subject: [PATCH 12/29] doc: write documentation on commitments --- Cargo.lock | 4 +- doc/Commitments.md | 260 +++++++++++++++++++++++++++++++++++++++++ src/bin/rgbcore-stl.rs | 3 + stl/MerkleNode.vesper | 6 + stl/RGB@0.1.0.sta | 76 ++++++------ stl/RGB@0.1.0.stl | Bin 16578 -> 16578 bytes stl/RGB@0.1.0.sty | 14 +-- 7 files changed, 316 insertions(+), 47 deletions(-) create mode 100644 doc/Commitments.md create mode 100644 stl/MerkleNode.vesper diff --git a/Cargo.lock b/Cargo.lock index 3342826e..0b41833b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,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#9f9057555d5d8907f3537069044f7503b81c3ee7" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#ce4d602e302645c9ec46e24e52a0d97b073ce744" dependencies = [ "amplify", "amplify_syn", @@ -304,7 +304,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#9f9057555d5d8907f3537069044f7503b81c3ee7" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#ce4d602e302645c9ec46e24e52a0d97b073ce744" dependencies = [ "amplify", "commit_encoding_derive", diff --git a/doc/Commitments.md b/doc/Commitments.md new file mode 100644 index 00000000..00f072f7 --- /dev/null +++ b/doc/Commitments.md @@ -0,0 +1,260 @@ +# RGB consensus commitments + +RGB commits to client-side validated data using dedicated serialization +mechanism, implemented via `CommitEncode` trait. Depending on the specific data, +the mechanism can be is partially or completely different from strict +serialization, used for data storage. For instance, all data which may be +confidential must be concealed, such that parties having no access to the +original non-confidential values still be able to generate the same +deterministic commitment value and verify single-use seals. + +Any final consensus commitment is a SHA256 tagged hash. The tagging is performed +according to BIP-340, when a commitment-specific fixed ASCII string value is +first hashed with a single SHA256 hash, and the resulting 32 bytes are feed into +a new SHA256 hasher twice before any actual data. + + +## Generating commitment id + +The commitment mechanism uses traits from [`commit_verify`] crate, specifically +its `id.rs`and `merkle.rs` modules. + +### `CommitEncode` trait + +It is the main trait which must be implemented for each type requiring a +dedicated commitment id. + +The trait implementation can be done either with derive macro +`#[derive(CommitEncode)]` or by providing a manual implementation. + +The derive macro takes two arguments: `strategy` and `id`: +- `id` must specify a resulting commitment id type, i.e. type wrapping 32-byte + tagged SHA256 hash, implementing `CommitmentId` trait (the implementation + provides a tag for the hasher - see trait details below). The type must also + provide a converting constructor from `coommit_verify::Sha256` hasher. +- `strategy` specifies a workflow used to feed the type data to the SHA256 + tagged hasher: + * `strategy = strict`: the hasher receive strict-serialized type; + * `strategy = conceal`: the type data are first concealed, and only then are + strict-serialized into the hasher. + +Manual `CommitEncode` implementation must be provided only when the commitment +procedure is custom and can't be implemented using any of the strategies, for +instance when a collection must be merklized (see on merklization below). + +NB: you should never call methods of `CommitEncode` trait directly, and instead +use `CommitId` trait, which is automatically implemented for + +### `CommitmentId` trait + +Each consensus commitment must have a dedicated Rust newtype, which wraps over +inner `Bytes32` - a 32-byte resulting tagged hash value. The type is marked as +a consensus commitment by implementing `CommitmentId` trait for it, which +requires to provide a tag string values for the tagged hash. + +The hash tags are defined using URN strings in form of +`urn:::#`, where `` stands for the organization, +`` is the name of the protocol, `` is the data type name +producing the commitment, and `` is a `YYYY-MM-DD` string for the latest +revision of the commitment layout. + +### `CommitId` trait + +This trait is automatically implemented for all types which have `CommitEncode` +implementation. You can't implement this trait manually and just need to call +its `CommitId::commit_id()` method to produce the final commitment (i.e. bytes +of the tagged hash in form of `CommitmentId`-implementing type). + +The trait also provides `CommitId::commitment_layout()` method, which can be +used for automatically generating the documentation on the commitment workflow. + +## Merklization procedure + +Merlization procedure uses traits and data types from `merkle.rs` module of +`commit_verify` crate. It commits to the tree parameters, such as number of +elements, depth of the tree, as well as depth of each node; and uses tagged +SHA256, like the rest of the commitment procedures used here. + +The main data type, related to the merklization, is `MerkleHash`: it is a tagged +hash (using `urn:lnpbp:merkle:node#2024-01-31` tag) representing node at any +position of the tree: leafs, branch nodes and merkle tree root. `MerkleHash` +can be produced in the following ways: +- as a result of merklziation procedure, when it represents Merkle tree root; +- as a root of empty Merkle tree (i.e. collection having 0 elements), by calling + `MerkleHash::void(0u8, 0u32)`, +- as a Merkle leaf, by implementing `CommitEncode` on some type and setting + commitment id to be `MerkleHash`. + +In all of the above cases the hash commits to the tree parameters, which makes +it safe to use the same type for leafs, branches and root nodes. Specifically, +it uses an intermediate structure `MerkleNode`, which is filled with information +on (see [`MerkleNode.vesper`](../stl/MerkleNode.vesper) for details): +- type of node branching (no branches, one branch or two branches), +- depth of the node, as 8-bit unsigned integer, +- width of the tree at its base, as a 256-bit LE unsigned integer, +- node hashes of the branches; if one or both branches are absent, they are + replaced with 32 bytes of repeated 0xFF value. + +A collection in form of a list (Rust `Vec`) or an ordered set of unique +non-repeating items (Rust `BTreeSet`), if wrapped into a confinement (i.e. has +type-defined bounds on the minimum or maximum number of items) can be +automatically merklized when passed as an argument to `MerkleHash::merklize()` +call. The API puts the following requirements on the collection: either +- maximum number of elements must be either 0xFF or 0xFFFF **and** each + collection element must implement `CommitEncode` trait with target id set to + `MerkleHash`, +- or there is a manual implementation of `MerkleLeafs` trait. + +```mermaid +flowchart BT + subgraph Merklization + direction LR + subgraph MerkleNode + branching + depth + width + node1 + node2 + end + MerkleNode -- encode to\ntagged hasher --> MerkleHash + end + MerkleHash ---> MerkleNode + MerkleHash === Root + Leaf -- commit_id ----> MerkleHash +``` + + +## Specific RGB consensus commitments + +Currently, RGB has three consensus commitments: schema, operation and bundle. +Operation commitment for genesis has a second representation, named contract id, +which uses reversed-byte encoding and a special string serialization, but is +generated with the same procedure as the operation commitment. + +The commitment ids can be generated with either type-specific methods +(`schema_id()` for schema, `bundle_id()` for state transition bundle and +`id()` for any operation) or `CommitId::commit_id()` method, which must provide +the equal result. + +Here are more details on each type of the commitments: + +| Commitment ID | Produced by | Procedure | Tag URN suffix | +|----------------------|--------------------------------------|------------------------------------------------------------------------------------------------|------------------------| +| `SchemaID` | `RootSchema`, `SubSchema` | strict serialization | `schema#2024-02-03` | +| `OpId`, `ContractId` | `Genesis`, `Transition`, `Extension` | nested commitments with concealing, merklization etc via intermediate `OpCommitment` structure | `operation#2024-02-03` | +| `BundleId` | `TransitionBundle` | conceal and partial strict serialization | `bundle#2024-02-03` | + +Additionally to these types there are two other commitment ids used internally +by merklization and strict encoding procedures: `MerkleHash` (discussed in the +Merklization section above) and `StrictHash` from `commit_verify` crate: + +| Commitment ID | Tag URN suffix | +|---------------|--------------------------------------------------| +| `MerkleHash` | `urn:lnpbp:merkle:node#2024-01-31` | +| `StrictHash` | `urn:ubideco:strict-types:value-hash#2024-02-10` | + +`StrictHash` can be produced as a result of serialization of any +strict-encodable data; for instance, it is used in compactifying collections +into a single hash field in the process of computing operation ids (described +below). + + +### Schema ID + +Schema id, represented by `SchemaId` data type, is produced from `Schema` type +via strict serialization of all the schema data using +`urn:lnpbp:rgb:schema#2024-02-03` hash tag. No conceal or merklization +procedures are applied; i.e. the commitment id is the same as hashing serialized +schema with the given tag. The full description of how schema data are +serialized into the hasher can be found in [`Schema.vesper`]( +../stl/Schema.vesper) file, which is automatically generated from the RGB rust +code. + +### Operation ID and Contract ID + +Operation id is represented by a `OpId` type and produced for `Genesis`, +`Transition` and `Extension` types via custom algorithm, which first creates a +dedicated `OpCommitment` structure, and strict-serializes it to hasher, +initialized with `urn:lnpbp:rgb:operation#2024-02-03` hash tag. + +The `OpCommitment` by itself consists of a sub-commitments to blocks of the +operation data, where each sub-commitment is created with a custom procedure. +For instance, operation global state, inputs and assignments are merklized, +such that a succinct proofs of some specific state or input inclusion in RGB +operation can be produced and used in smart contracts. Additionally to that, +assignments are concealed before the merklization, and range proofs are +removed from the commitment, such that an aggregation of the historical proofs +can be applied without changing the operation ids. + +To ensure succinctness, other types of collections, such as redeemed and +defined valencies and list of alternate layer 1 in genesis are not merklized +and strict-serialized producing `StrictHash`, which participates in the final +`OpCommitment` structure. + +```mermaid +flowchart LR + subgraph "Common data" + Ffv --> OpCommitment + TypeCommitment --> OpCommitment + Metadata -- StrictHash --> OpCommitment + Globals -- Merklize --> OpCommitment + Inputs -- Merklize --> OpCommitment + Assignments -- "Conceal\n + Merklize" --> OpCommitment + Redeemed -- StrictHash --> OpCommitment + Valencies -- StrictHash --> OpCommitment + end + + subgraph "Genesis" + schemaId --> BaseCommitment + testnet --> BaseCommitment + altLayers1 -- StrictHash --> BaseCommitment + end + + subgraph "Transition" + tcid[contractId] --> TypeCommitment + transitionType --> TypeCommitment + end + + subgraph "Extension" + ecid[contractId] --> TypeCommitment + extensionType --> TypeCommitment + end + + BaseCommitment --> TypeCommitment + + OpCommitment -- hash --> OpId + OpId -- "reverse bytes\n(genesis only)" --> ContractId +``` + +Additionally to `OpId`, genesis produces `ContractId`, which is made out of the +genesis `OpId` by reversing byte order and using Base58 encoding. + +### Bundle ID + +Bundle id is a unique identifier of state transition bundle, directly used in +constructing multi-protocol commitment tree. Bundle id commits to operation ids +for the participating state transitions and maps of the witness transaction +input to the operation ids. For this purpose, the commitment is created by +strict-encoding `input_map` field of `TransitionBundle` into the hasher, +initialized with tag `urn:lnpbp:rgb:bundle#2024-02-03`. Input map is serialzied +first as a 16-bit little-endian integer specifying the number of the items in +the map, followed by the sequence of pairs of input number (32-bit LE value) +and `OpId` (32-bytes). + +```mermaid +flowchart TD + subgraph Discarded + id((" ")) + end + + subgraph TransitionBundle + inputMap + knownTransitions + end + + inputMap -- encode \n hash --> BundleId + knownTransitions --x Discarded +``` + + +[`commit_verify`]: https://docs.rs/commit_verify diff --git a/src/bin/rgbcore-stl.rs b/src/bin/rgbcore-stl.rs index 33969a91..cb000bf6 100644 --- a/src/bin/rgbcore-stl.rs +++ b/src/bin/rgbcore-stl.rs @@ -84,4 +84,7 @@ fn main() { let tt = sys.type_tree("RGB.AnchoredBundle").unwrap(); fs::write(format!("{dir}/AnchoredBundle.vesper",), format!("{tt}")).unwrap(); + + let tt = sys.type_tree("CommitVerify.MerkleNode").unwrap(); + fs::write(format!("{dir}/MerkleNode.vesper",), format!("{tt}")).unwrap(); } diff --git a/stl/MerkleNode.vesper b/stl/MerkleNode.vesper new file mode 100644 index 00000000..2833e69d --- /dev/null +++ b/stl/MerkleNode.vesper @@ -0,0 +1,6 @@ +MerkleNode rec + branching enum void=0 single=1 branch=2 -- NodeBranching + depth is U8 + width is U16 + 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 f0c8b0c2..4a3ece7d 100644 --- a/stl/RGB@0.1.0.sta +++ b/stl/RGB@0.1.0.sta @@ -1,19 +1,19 @@ -----BEGIN STRICT TYPE LIB----- -Id: BQugurBw6JSc3iF92RZipSMbFgsRU9M6jkYjSctpMzX2#ecology-nobel-prince +Id: 35cF57bXFVGRrGsPBW7D9wh49BeAZpBgSwBGQxSXDFDH#station-product-conduct Name: RGB Dependencies: - 4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner, 55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray, - 6HFQ83t33zW6PgG2pWpXM3HuEUFXAgUjheYiQa2Jdb9c#jester-lorenzo-address, + 698cwwfCJw4pzQicV8jBaQJ2rLLphub4qJGYbMndqC2C#bless-rebel-panic, BADMWBVQ6sMJGfELP13cjeZPNutGuLzZtNNZirJQsz9e#tower-monaco-corona, DVtm25LRKU4TjbyZmVxPhvCmctZ6vKkPKqfpU2QsDNUo#exodus-axiom-tommy, + DYafq9UACuYbTpduhcqywBGH97wHYtSUNPiXh5v2Zub9#drama-imagine-extreme, HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9#speed-atlanta-trilogy -15!sq1~VSXp&gflt-+@~_eeBXa!cG8g3ZW4Bp*VfbYxC+0vHR+edZy`|Kv*>uVx -kpmL}Eg3U`IlNoAa7B+CXuP(yEWWtQ;}kI`46>9@qkSrR0T#xnXija}LTPkkZ)t7@1wm|eR!sr` +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($UA5U3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f8..bf2f125819689616029df90bfb681a258f727ae5 100644 GIT binary patch delta 911 zcmX@q$atuck(D{f-HC0ofRutZb8tzDPyD8&6-|lv|H%|Ht)C^3x%5Nnqs`~%@|Kj& z&vg10q3KQoV>F!DnZ2B+Nx_TDd{e$~=^i6odmEHUH($ogeMKczk zQ3z0nH&F^VFVVO!LO9&>nG|#w*>W-qOEXg#SQ!Zh{^a+z&V)@hU?$O2 hpoYo&?9>RG9AHnP$pQ8bgiYOGuS1L?g~>7w%K)fRwRQji delta 910 zcmX@q$atuc(TF+7-HFXu?&Lz*>CI~oF1P*eVG>^CeMh3{>m|?BIcX}V z*_;BL^NUg^e^gPJSYWjAycDMbAuW?RxwHu@dc&nKxr9rQutH8Q1$EZ^f}+$CCPFrE ze#2G3uRtguCJU-7Y@Q<(%0rAwO~Q)at1D=*W#$!>mJ~A)v>T{cmpiezI5RyjH#Ltq z9a@Cl0QA!2NDXeH6mDLkabJXRxaTt|=rFS7WEPfYrZBKF5)Ayw?`@q4n`*#JqNzX) gllR%F5jHu%o>UW3y1`zD7)1(`WgM0P0Fn8JApigX diff --git a/stl/RGB@0.1.0.sty b/stl/RGB@0.1.0.sty index 6ff972bb..7f14c109 100644 --- a/stl/RGB@0.1.0.sty +++ b/stl/RGB@0.1.0.sty @@ -1,5 +1,5 @@ {- - Id: urn:ubideco:stl:BQugurBw6JSc3iF92RZipSMbFgsRU9M6jkYjSctpMzX2#ecology-nobel-prince + Id: urn:ubideco:stl:35cF57bXFVGRrGsPBW7D9wh49BeAZpBgSwBGQxSXDFDH#station-product-conduct Name: RGB Version: 0.1.0 Description: Consensus layer for RGB smart contracts @@ -11,16 +11,11 @@ @context typelib RGB -import CommitVerify#4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner - use MerkleHash#culture-metro-modular - use StrictHash#cheese-final-locate - use MerkleProof#labor-hilton-magenta - import Std#55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray use Bool#laser-madam-maxwell use AlphaNumLodash#north-sound-salsa -import BPCore#6HFQ83t33zW6PgG2pWpXM3HuEUFXAgUjheYiQa2Jdb9c#jester-lorenzo-address +import BPCore#698cwwfCJw4pzQicV8jBaQJ2rLLphub4qJGYbMndqC2C#bless-rebel-panic use TapretNodePartner#iceberg-poker-active use ExplicitSealTxid#antenna-darwin-emotion use TapretProof#forum-paint-tunnel @@ -56,6 +51,11 @@ import AluVM#DVtm25LRKU4TjbyZmVxPhvCmctZ6vKkPKqfpU2QsDNUo#exodus-axiom-tommy use LibSite#mission-papa-mercy use LibId#rebel-factor-rodeo +import CommitVerify#DYafq9UACuYbTpduhcqywBGH97wHYtSUNPiXh5v2Zub9#drama-imagine-extreme + use MerkleHash#culture-metro-modular + use StrictHash#cheese-final-locate + use MerkleProof#labor-hilton-magenta + import Bitcoin#HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9#speed-atlanta-trilogy use Vout#chrome-robin-gallop use ScriptBytes#maestro-source-jackson From e410c57f64bada26821f4ae75c7ae45dd972337d Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Mon, 12 Feb 2024 17:55:29 +0100 Subject: [PATCH 13/29] contract: standardize concealed state commitments --- doc/Commitments.md | 18 +++++++++++++----- src/contract/attachment.rs | 14 ++++++++++---- src/contract/data.rs | 14 ++++++++++---- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/doc/Commitments.md b/doc/Commitments.md index 00f072f7..fa9434cd 100644 --- a/doc/Commitments.md +++ b/doc/Commitments.md @@ -138,11 +138,19 @@ the equal result. Here are more details on each type of the commitments: -| Commitment ID | Produced by | Procedure | Tag URN suffix | -|----------------------|--------------------------------------|------------------------------------------------------------------------------------------------|------------------------| -| `SchemaID` | `RootSchema`, `SubSchema` | strict serialization | `schema#2024-02-03` | -| `OpId`, `ContractId` | `Genesis`, `Transition`, `Extension` | nested commitments with concealing, merklization etc via intermediate `OpCommitment` structure | `operation#2024-02-03` | -| `BundleId` | `TransitionBundle` | conceal and partial strict serialization | `bundle#2024-02-03` | +| Commitment ID | Produced by | Procedure | Tag URN suffix(1) | +|----------------------|--------------------------------------|------------------------------------------------------------------------------------------------|---------------------------| +| `SchemaID` | `RootSchema`, `SubSchema` | strict serialization | `schema#2024-02-03` | +| `OpId`, `ContractId` | `Genesis`, `Transition`, `Extension` | nested commitments with concealing, merklization etc via intermediate `OpCommitment` structure | `operation#2024-02-03` | +| `BundleId` | `TransitionBundle` | conceal and partial strict serialization | `bundle#2024-02-03` | +| `ConcealedData` | `RevealedData` | strict serialization | `state-data#2024-02-12` | +| `ConcealedAttach` | `RevealedAttach` | strict serialization | `state-attach#2024-02-12` | + +(1): "URN suffix" is a part which follows "urn:lnpbp:rgb:" prefix. + +The last two commitments co-incede to be a concealed form for an RGB state. +They can be produced by either calling `commit_id` or `conceal` methods of +revealed state types (`RevealedData` and `RevealedAttach`). Additionally to these types there are two other commitment ids used internally by merklization and strict encoding procedures: `MerkleHash` (discussed in the diff --git a/src/contract/attachment.rs b/src/contract/attachment.rs index 69867714..b6b7268b 100644 --- a/src/contract/attachment.rs +++ b/src/contract/attachment.rs @@ -25,7 +25,7 @@ use std::str::FromStr; use amplify::{ByteArray, Bytes32}; use baid58::{Baid58ParseError, Chunking, FromBaid58, ToBaid58, CHUNKING_32}; use bp::secp256k1::rand::{random, Rng, RngCore}; -use commit_verify::{CommitVerify, Conceal, StrictEncodedProtocol}; +use commit_verify::{CommitId, CommitmentId, Conceal, DigestExt, Sha256}; use strict_encoding::StrictEncode; use super::{ConfidentialState, ExposedState}; @@ -67,6 +67,8 @@ impl AttachId { #[derive(Clone, PartialOrd, Ord, PartialEq, Eq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = ConcealedAttach)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -116,7 +118,7 @@ impl ExposedState for RevealedAttach { impl Conceal for RevealedAttach { type Concealed = ConcealedAttach; - fn conceal(&self) -> Self::Concealed { ConcealedAttach::commit(self) } + fn conceal(&self) -> Self::Concealed { self.commit_id() } } /// Confidential version of an attachment information. @@ -142,8 +144,12 @@ impl ConfidentialState for ConcealedAttach { fn state_commitment(&self) -> ConcealedState { ConcealedState::Attachment(*self) } } -impl CommitVerify for ConcealedAttach { - fn commit(revealed: &RevealedAttach) -> Self { Bytes32::commit(revealed).into() } +impl From for ConcealedAttach { + fn from(hasher: Sha256) -> Self { hasher.finish().into() } +} + +impl CommitmentId for ConcealedAttach { + const TAG: &'static str = "urn:lnpbp:rgb:state-attach#2024-02-12"; } #[cfg(test)] diff --git a/src/contract/data.rs b/src/contract/data.rs index 278f8ec3..ef220d24 100644 --- a/src/contract/data.rs +++ b/src/contract/data.rs @@ -27,7 +27,7 @@ use amplify::confinement::SmallBlob; use amplify::hex::ToHex; use amplify::{Bytes32, Wrapper}; use bp::secp256k1::rand::{random, Rng, RngCore}; -use commit_verify::{CommitVerify, Conceal, StrictEncodedProtocol}; +use commit_verify::{CommitId, CommitmentId, Conceal, DigestExt, Sha256}; use strict_encoding::{StrictSerialize, StrictType}; use super::{ConfidentialState, ExposedState}; @@ -73,6 +73,8 @@ impl From for DataState { #[derive(Clone, Eq, PartialEq, Hash)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] +#[derive(CommitEncode)] +#[commit_encode(strategy = strict, id = ConcealedData)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate = "serde_crate"))] pub struct RevealedData { pub value: DataState, @@ -108,7 +110,7 @@ impl ExposedState for RevealedData { impl Conceal for RevealedData { type Concealed = ConcealedData; - fn conceal(&self) -> Self::Concealed { ConcealedData::commit(self) } + fn conceal(&self) -> Self::Concealed { self.commit_id() } } impl PartialOrd for RevealedData { @@ -158,6 +160,10 @@ impl ConfidentialState for ConcealedData { fn state_commitment(&self) -> ConcealedState { ConcealedState::Structured(*self) } } -impl CommitVerify for ConcealedData { - fn commit(revealed: &RevealedData) -> Self { Bytes32::commit(revealed).into() } +impl From for ConcealedData { + fn from(hasher: Sha256) -> Self { hasher.finish().into() } +} + +impl CommitmentId for ConcealedData { + const TAG: &'static str = "urn:lnpbp:rgb:state-data#2024-02-12"; } From 5dfd5ed79e7f5040e322207ad8c737219a90ff40 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Mon, 12 Feb 2024 17:55:38 +0100 Subject: [PATCH 14/29] chore: update dependencies --- Cargo.lock | 94 +++++++++++++++++++++++++++--------------------------- src/stl.rs | 2 +- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b41833b..73018156 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -189,7 +189,7 @@ dependencies = [ [[package]] name = "bp-consensus" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" dependencies = [ "amplify", "chrono", @@ -203,7 +203,7 @@ dependencies = [ [[package]] name = "bp-core" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" dependencies = [ "amplify", "bp-consensus", @@ -221,7 +221,7 @@ dependencies = [ [[package]] name = "bp-dbc" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" dependencies = [ "amplify", "base85", @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "bp-seals" version = "0.11.0-beta.3" -source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#e5da72f8ffae49ccca6a9dbabf24f961cb619761" +source = "git+https://github.com/BP-WG/bp-core?branch=v0.11#0a84072daaa8ca7d81d4bb3064b813d8c382b27b" dependencies = [ "amplify", "baid58", @@ -277,9 +277,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", @@ -292,7 +292,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#ce4d602e302645c9ec46e24e52a0d97b073ce744" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#9562563e1fde21fe7ae6a6a9d36c0115f654a59e" dependencies = [ "amplify", "amplify_syn", @@ -304,7 +304,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#ce4d602e302645c9ec46e24e52a0d97b073ce744" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=v0.11#9562563e1fde21fe7ae6a6a9d36c0115f654a59e" dependencies = [ "amplify", "commit_encoding_derive", @@ -448,9 +448,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", @@ -464,9 +464,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -758,7 +758,7 @@ dependencies = [ [[package]] name = "strict_encoding" version = "2.7.0" -source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#f95dbcbf8b01a4ea92dea92bd6492e9ae8c73c67" +source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#bdd35d550369590a3e6a86439a55e0b2f2d06766" dependencies = [ "amplify", "half", @@ -769,7 +769,7 @@ dependencies = [ [[package]] name = "strict_encoding_derive" version = "2.7.0" -source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#f95dbcbf8b01a4ea92dea92bd6492e9ae8c73c67" +source = "git+https://github.com/strict-types/strict-encoding?branch=refactor/io#bdd35d550369590a3e6a86439a55e0b2f2d06766" dependencies = [ "amplify_syn", "heck", @@ -781,7 +781,7 @@ dependencies = [ [[package]] name = "strict_types" version = "2.7.0" -source = "git+https://github.com/strict-types/strict-types?branch=refactor/io#ada11c04ab6e6483e769885f2fe93eae0bd42f85" +source = "git+https://github.com/strict-types/strict-types?branch=refactor/io#abc6133b6cfdb9699714c493e5f62175d99fd752" dependencies = [ "amplify", "baid58", @@ -793,7 +793,7 @@ dependencies = [ "serde_yaml", "sha2", "strict_encoding", - "toml 0.8.9", + "toml 0.8.10", "vesper", ] @@ -831,18 +831,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -863,14 +863,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.1", + "toml_edit 0.22.4", ] [[package]] @@ -897,9 +897,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" dependencies = [ "indexmap", "serde", @@ -949,9 +949,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -959,9 +959,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -974,9 +974,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -986,9 +986,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -996,9 +996,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -1009,15 +1009,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-bindgen-test" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139bd73305d50e1c1c4333210c0db43d989395b64a237bd35c10ef3832a7f70c" +checksum = "143ddeb4f833e2ed0d252e618986e18bfc7b0e52f2d28d77d05b2f045dd8eb61" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1029,9 +1029,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70072aebfe5da66d2716002c729a14e4aec4da0e23cc2ea66323dac541c93928" +checksum = "a5211b7550606857312bba1d978a8ec75692eae187becc5e680444fffc5e6f89" dependencies = [ "proc-macro2", "quote", @@ -1040,9 +1040,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -1116,9 +1116,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.37" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] diff --git a/src/stl.rs b/src/stl.rs index 7348a90d..092b0ce1 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:BQugurBw6JSc3iF92RZipSMbFgsRU9M6jkYjSctpMzX2#ecology-nobel-prince"; + "urn:ubideco:stl:35cF57bXFVGRrGsPBW7D9wh49BeAZpBgSwBGQxSXDFDH#station-product-conduct"; fn _rgb_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_RGB), tiny_bset! { From 85a2cd752c463a70067802343671c2d704bcbc7f Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Mon, 12 Feb 2024 18:09:59 +0100 Subject: [PATCH 15/29] doc: standardize commitment tags; add remaining commitment types --- doc/Commitments.md | 45 ++++++++++++++++++++++---------------- src/contract/attachment.rs | 2 +- src/contract/bundle.rs | 2 +- src/contract/data.rs | 2 +- src/contract/id.rs | 2 +- src/schema/schema.rs | 2 +- 6 files changed, 31 insertions(+), 24 deletions(-) diff --git a/doc/Commitments.md b/doc/Commitments.md index fa9434cd..1dfb95a7 100644 --- a/doc/Commitments.md +++ b/doc/Commitments.md @@ -76,7 +76,7 @@ elements, depth of the tree, as well as depth of each node; and uses tagged SHA256, like the rest of the commitment procedures used here. The main data type, related to the merklization, is `MerkleHash`: it is a tagged -hash (using `urn:lnpbp:merkle:node#2024-01-31` tag) representing node at any +hash (using `urn:ubideco:merkle:node#2024-01-31` tag) representing node at any position of the tree: leafs, branch nodes and merkle tree root. `MerkleHash` can be produced in the following ways: - as a result of merklziation procedure, when it represents Merkle tree root; @@ -138,40 +138,47 @@ the equal result. Here are more details on each type of the commitments: -| Commitment ID | Produced by | Procedure | Tag URN suffix(1) | -|----------------------|--------------------------------------|------------------------------------------------------------------------------------------------|---------------------------| -| `SchemaID` | `RootSchema`, `SubSchema` | strict serialization | `schema#2024-02-03` | -| `OpId`, `ContractId` | `Genesis`, `Transition`, `Extension` | nested commitments with concealing, merklization etc via intermediate `OpCommitment` structure | `operation#2024-02-03` | -| `BundleId` | `TransitionBundle` | conceal and partial strict serialization | `bundle#2024-02-03` | -| `ConcealedData` | `RevealedData` | strict serialization | `state-data#2024-02-12` | -| `ConcealedAttach` | `RevealedAttach` | strict serialization | `state-attach#2024-02-12` | +| Commitment ID | Produced by | Procedure | Tag URN suffix(1) | +|----------------------|--------------------------------------|------------------------------------------------------------------------------------------------|-------------------------------| +| `SchemaID` | `RootSchema`, `SubSchema` | strict serialization | `rgb:schema#2024-02-03` | +| `OpId`, `ContractId` | `Genesis`, `Transition`, `Extension` | nested commitments with concealing, merklization etc via intermediate `OpCommitment` structure | `rgb:operation#2024-02-03` | +| `BundleId` | `TransitionBundle` | conceal and partial strict serialization | `rgb:bundle#2024-02-03` | +| `SecretSeal` | `BlindSeal` | strict serialization | `seals:secret#2024-02-03` | +| `ConcealedData` | `RevealedData` | strict serialization | `rgb:state-data#2024-02-12` | +| `ConcealedAttach` | `RevealedAttach` | strict serialization | `rgb:state-attach#2024-02-12` | -(1): "URN suffix" is a part which follows "urn:lnpbp:rgb:" prefix. +(1): "URN suffix" is a part which follows "urn:lnp-bp:" prefix. -The last two commitments co-incede to be a concealed form for an RGB state. -They can be produced by either calling `commit_id` or `conceal` methods of -revealed state types (`RevealedData` and `RevealedAttach`). +The last three commitments coincide to be a concealed form of BP seals and RGB state. +These commitments produced by either calling `commit_id` or `conceal` methods of +revealed seal (`BlindSeal`) and state types (`RevealedData` and `RevealedAttach`). Additionally to these types there are two other commitment ids used internally by merklization and strict encoding procedures: `MerkleHash` (discussed in the Merklization section above) and `StrictHash` from `commit_verify` crate: -| Commitment ID | Tag URN suffix | -|---------------|--------------------------------------------------| -| `MerkleHash` | `urn:lnpbp:merkle:node#2024-01-31` | -| `StrictHash` | `urn:ubideco:strict-types:value-hash#2024-02-10` | +| Commitment ID | Tag URN suffix | +|-------------------|--------------------------------------------------| +| `MerkleHash` | `urn:ubideco:merkle:node#2024-01-31` | +| `StrictHash` | `urn:ubideco:strict-types:value-hash#2024-02-10` | +| `mpc::Commitment` | `urn:ubideco:mpc:commitment#2024-01-31` | `StrictHash` can be produced as a result of serialization of any strict-encodable data; for instance, it is used in compactifying collections into a single hash field in the process of computing operation ids (described below). +Finally, in `commit_verify::mpc`, multi-protocol commitment protocol +implementation, we have a type named `mpc::Commitment`, which is a commitment +to a root of the MPC tree (i.e. the tree's root `MerkleHash` is tag-hashed once +again to produce the final commitment value). + ### Schema ID Schema id, represented by `SchemaId` data type, is produced from `Schema` type via strict serialization of all the schema data using -`urn:lnpbp:rgb:schema#2024-02-03` hash tag. No conceal or merklization +`urn:lnp-bp:rgb:schema#2024-02-03` hash tag. No conceal or merklization procedures are applied; i.e. the commitment id is the same as hashing serialized schema with the given tag. The full description of how schema data are serialized into the hasher can be found in [`Schema.vesper`]( @@ -183,7 +190,7 @@ code. Operation id is represented by a `OpId` type and produced for `Genesis`, `Transition` and `Extension` types via custom algorithm, which first creates a dedicated `OpCommitment` structure, and strict-serializes it to hasher, -initialized with `urn:lnpbp:rgb:operation#2024-02-03` hash tag. +initialized with `urn:lnp-bp:rgb:operation#2024-02-03` hash tag. The `OpCommitment` by itself consists of a sub-commitments to blocks of the operation data, where each sub-commitment is created with a custom procedure. @@ -244,7 +251,7 @@ constructing multi-protocol commitment tree. Bundle id commits to operation ids for the participating state transitions and maps of the witness transaction input to the operation ids. For this purpose, the commitment is created by strict-encoding `input_map` field of `TransitionBundle` into the hasher, -initialized with tag `urn:lnpbp:rgb:bundle#2024-02-03`. Input map is serialzied +initialized with tag `urn:lnp-bp:rgb:bundle#2024-02-03`. Input map is serialzied first as a 16-bit little-endian integer specifying the number of the items in the map, followed by the sequence of pairs of input number (32-bit LE value) and `OpId` (32-bytes). diff --git a/src/contract/attachment.rs b/src/contract/attachment.rs index b6b7268b..0f0db2c7 100644 --- a/src/contract/attachment.rs +++ b/src/contract/attachment.rs @@ -149,7 +149,7 @@ impl From for ConcealedAttach { } impl CommitmentId for ConcealedAttach { - const TAG: &'static str = "urn:lnpbp:rgb:state-attach#2024-02-12"; + const TAG: &'static str = "urn:lnp-bp:rgb:state-attach#2024-02-12"; } #[cfg(test)] diff --git a/src/contract/bundle.rs b/src/contract/bundle.rs index 532c6225..6280a4bb 100644 --- a/src/contract/bundle.rs +++ b/src/contract/bundle.rs @@ -55,7 +55,7 @@ impl From for BundleId { } impl CommitmentId for BundleId { - const TAG: &'static str = "urn:lnpbp:rgb:bundle#2024-02-03"; + const TAG: &'static str = "urn:lnp-bp:rgb:bundle#2024-02-03"; } impl From for mpc::Message { diff --git a/src/contract/data.rs b/src/contract/data.rs index ef220d24..46b25d85 100644 --- a/src/contract/data.rs +++ b/src/contract/data.rs @@ -165,5 +165,5 @@ impl From for ConcealedData { } impl CommitmentId for ConcealedData { - const TAG: &'static str = "urn:lnpbp:rgb:state-data#2024-02-12"; + const TAG: &'static str = "urn:lnp-bp:rgb:state-data#2024-02-12"; } diff --git a/src/contract/id.rs b/src/contract/id.rs index e7379888..f64b60d6 100644 --- a/src/contract/id.rs +++ b/src/contract/id.rs @@ -124,7 +124,7 @@ impl From for OpId { } impl CommitmentId for OpId { - const TAG: &'static str = "urn:lnpbp:rgb:operation#2024-02-03"; + const TAG: &'static str = "urn:lnp-bp:rgb:operation#2024-02-03"; } impl FromStr for OpId { diff --git a/src/schema/schema.rs b/src/schema/schema.rs index 7db3577c..ca057592 100644 --- a/src/schema/schema.rs +++ b/src/schema/schema.rs @@ -109,7 +109,7 @@ impl From for SchemaId { } impl CommitmentId for SchemaId { - const TAG: &'static str = "urn:lnpbp:rgb:schema#2024-02-03"; + const TAG: &'static str = "urn:lnp-bp:rgb:schema#2024-02-03"; } impl ToBaid58<32> for SchemaId { From 86fb38229b43c2ffcf274f0f0e1c7b957a10bf20 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Thu, 15 Feb 2024 08:49:02 +0100 Subject: [PATCH 16/29] contract: provide custom impl of CommitEncode for operations --- src/contract/operations.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/contract/operations.rs b/src/contract/operations.rs index c101aa13..e64aba41 100644 --- a/src/contract/operations.rs +++ b/src/contract/operations.rs @@ -25,7 +25,9 @@ use std::iter; use amplify::confinement::{SmallBlob, TinyOrdMap, TinyOrdSet}; use amplify::Wrapper; -use commit_verify::{CommitId, Conceal, MerkleHash, MerkleLeaves, StrictHash}; +use commit_verify::{ + CommitEncode, CommitEngine, CommitId, Conceal, MerkleHash, MerkleLeaves, StrictHash, +}; use strict_encoding::{StrictDeserialize, StrictEncode, StrictSerialize}; use crate::schema::{self, ExtensionType, OpFullType, OpType, SchemaId, TransitionType}; @@ -194,8 +196,6 @@ pub trait Operation { #[derive(Clone, PartialEq, Eq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = conceal, id = OpId)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -218,8 +218,6 @@ impl StrictDeserialize for Genesis {} #[derive(Clone, PartialEq, Eq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = conceal, id = OpId)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -242,8 +240,6 @@ impl StrictDeserialize for Extension {} #[derive(Clone, PartialEq, Eq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] -#[derive(CommitEncode)] -#[commit_encode(strategy = conceal, id = OpId)] #[cfg_attr( feature = "serde", derive(Serialize, Deserialize), @@ -299,6 +295,21 @@ impl Conceal for Extension { } } +impl CommitEncode for Genesis { + type CommitmentId = OpId; + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.commit()) } +} + +impl CommitEncode for Transition { + type CommitmentId = OpId; + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.commit()) } +} + +impl CommitEncode for Extension { + type CommitmentId = OpId; + fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.commit()) } +} + impl Transition { /// Returns reference to information about the owned rights in form of /// [`Inputs`] wrapper structure which this operation updates with From 30f63291268233e402dded89e2ee1201a0f3fe18 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Thu, 15 Feb 2024 08:52:20 +0100 Subject: [PATCH 17/29] doc: fix grammar --- doc/Commitments.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Commitments.md b/doc/Commitments.md index 1dfb95a7..9eb90d18 100644 --- a/doc/Commitments.md +++ b/doc/Commitments.md @@ -77,7 +77,7 @@ SHA256, like the rest of the commitment procedures used here. The main data type, related to the merklization, is `MerkleHash`: it is a tagged hash (using `urn:ubideco:merkle:node#2024-01-31` tag) representing node at any -position of the tree: leafs, branch nodes and merkle tree root. `MerkleHash` +position of the tree: leaves, branch nodes and merkle tree root. `MerkleHash` can be produced in the following ways: - as a result of merklziation procedure, when it represents Merkle tree root; - as a root of empty Merkle tree (i.e. collection having 0 elements), by calling @@ -86,7 +86,7 @@ can be produced in the following ways: commitment id to be `MerkleHash`. In all of the above cases the hash commits to the tree parameters, which makes -it safe to use the same type for leafs, branches and root nodes. Specifically, +it safe to use the same type for leaves, branches and root nodes. Specifically, it uses an intermediate structure `MerkleNode`, which is filled with information on (see [`MerkleNode.vesper`](../stl/MerkleNode.vesper) for details): - type of node branching (no branches, one branch or two branches), @@ -103,7 +103,7 @@ call. The API puts the following requirements on the collection: either - maximum number of elements must be either 0xFF or 0xFFFF **and** each collection element must implement `CommitEncode` trait with target id set to `MerkleHash`, -- or there is a manual implementation of `MerkleLeafs` trait. +- or there is a manual implementation of `MerkleLeaves` trait. ```mermaid flowchart BT @@ -251,7 +251,7 @@ constructing multi-protocol commitment tree. Bundle id commits to operation ids for the participating state transitions and maps of the witness transaction input to the operation ids. For this purpose, the commitment is created by strict-encoding `input_map` field of `TransitionBundle` into the hasher, -initialized with tag `urn:lnp-bp:rgb:bundle#2024-02-03`. Input map is serialzied +initialized with tag `urn:lnp-bp:rgb:bundle#2024-02-03`. Input map is serialized first as a 16-bit little-endian integer specifying the number of the items in the map, followed by the sequence of pairs of input number (32-bit LE value) and `OpId` (32-bytes). From 1759eab75a1d2f94f402db6897bc76abc1221441 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Thu, 15 Feb 2024 17:26:32 +0100 Subject: [PATCH 18/29] contract: fix unnamed commitment type by newtype for bundle input map --- src/contract/bundle.rs | 43 +++++++++++++++++++++++++++++++++++++----- src/contract/mod.rs | 2 +- src/stl.rs | 2 +- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/contract/bundle.rs b/src/contract/bundle.rs index 6280a4bb..d12918dc 100644 --- a/src/contract/bundle.rs +++ b/src/contract/bundle.rs @@ -20,7 +20,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::collections::BTreeMap; +use std::collections::{btree_map, BTreeMap}; use amplify::confinement::{Confined, U16}; use amplify::{Bytes32, Wrapper}; @@ -28,8 +28,7 @@ use bp::Vout; use commit_verify::{mpc, CommitEncode, CommitEngine, CommitId, CommitmentId, DigestExt, Sha256}; use strict_encoding::{StrictDumb, StrictEncode}; -use super::OpId; -use crate::{Transition, LIB_NAME_RGB}; +use crate::{OpId, Transition, LIB_NAME_RGB}; pub type Vin = Vout; @@ -66,6 +65,40 @@ impl From for BundleId { fn from(id: mpc::Message) -> Self { BundleId(id.into_inner()) } } +#[derive(Wrapper, WrapperMut, Clone, PartialEq, Eq, Hash, Debug, From)] +#[wrapper(Deref)] +#[wrapper_mut(DerefMut)] +#[derive(StrictType, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_RGB)] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate", transparent) +)] +pub struct InputMap(Confined, 1, U16>); + +impl StrictDumb for InputMap { + fn strict_dumb() -> Self { Self(confined_bmap!(strict_dumb!() => strict_dumb!())) } +} + +impl InputMap { + pub fn with(input: Vin, id: OpId) -> Self { InputMap(Confined::with((input, id))) } +} + +impl IntoIterator for InputMap { + type Item = (Vin, OpId); + type IntoIter = btree_map::IntoIter; + + fn into_iter(self) -> Self::IntoIter { self.0.into_iter() } +} + +impl<'a> IntoIterator for &'a InputMap { + type Item = (&'a Vin, &'a OpId); + type IntoIter = btree_map::Iter<'a, Vin, OpId>; + + fn into_iter(self) -> Self::IntoIter { self.0.iter() } +} + #[derive(Clone, PartialEq, Eq, Debug, From)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_RGB)] @@ -75,7 +108,7 @@ impl From for BundleId { serde(crate = "serde_crate", rename_all = "camelCase") )] pub struct TransitionBundle { - pub input_map: Confined, 1, U16>, + pub input_map: InputMap, pub known_transitions: Confined, 1, U16>, } @@ -88,7 +121,7 @@ impl CommitEncode for TransitionBundle { impl StrictDumb for TransitionBundle { fn strict_dumb() -> Self { Self { - input_map: confined_bmap! { strict_dumb!() => strict_dumb!() }, + input_map: strict_dumb!(), known_transitions: confined_bmap! { strict_dumb!() => strict_dumb!() }, } } diff --git a/src/contract/mod.rs b/src/contract/mod.rs index 56608287..4d7768b9 100644 --- a/src/contract/mod.rs +++ b/src/contract/mod.rs @@ -41,7 +41,7 @@ pub use assignments::{ TypedAssigns, }; pub use attachment::{AttachId, ConcealedAttach, RevealedAttach}; -pub use bundle::{BundleId, TransitionBundle, Vin}; +pub use bundle::{BundleId, InputMap, TransitionBundle, Vin}; pub use contract::{ AssignmentWitness, ContractHistory, ContractState, GlobalOrd, KnownState, Opout, OpoutParseError, OutputAssignment, diff --git a/src/stl.rs b/src/stl.rs index 092b0ce1..2efc4628 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:35cF57bXFVGRrGsPBW7D9wh49BeAZpBgSwBGQxSXDFDH#station-product-conduct"; + "urn:ubideco:stl:GBpCZWjW6YyuTB8tGMi856t1iATppxNGTr7GPzZxgSpU#helium-cinema-contact"; fn _rgb_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_RGB), tiny_bset! { From 92183503e0ba112087d8c73fab238f60402e5b49 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Fri, 16 Feb 2024 10:35:14 +0100 Subject: [PATCH 19/29] 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 20/29] 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 21/29] 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 22/29] 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 23/29] 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 24/29] 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 25/29] 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 26/29] 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{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Jqp^&Hw-a000000RI300000000(DfZe??6a +{;SD{|dyAYDEzER9^-pDoqKDkX2Z-)7v*JaEw{tOhXD~cywiMb7^mGa{vkfWOW`w +sTH9-LlJ`2|Ay5Z(?oEikl{+~pis;@Q*TJ#0cNz9gpb5|Ibh#3lIwO7kh2b~5Yat +1R4r0u5eSq}aR2}S000000RI300000001I?-VQzD2bZKvHa{vkfG*S<)6P6lYy(# +<=BR_>s@(?%#f7ArN-=Rj?7Ns(10lmj>c*;HH-+nx*l=M-QoGleKhk#vs%IKt8i% +IbTe*gdg000000RI3000000019+@aAi|@b97~G0!XQB?8_As^WnPDotHzoVsdtr@ +aSRwVWi2G1l#x)zof7oiPG643gHJ7x;*+(o97D-WiY6Oxis%K^ujrr2XPctjrBQEn_gi@y%2uu6czw;j3Za^^pA<|F_B0000000930 +00000000VacWz~5RC#b^a{vkfhyLPaScq)s9KMExvw34D6J>+NwrBxfixd_%u|$W +t0XWJO;DsW`<2iyxl(NH_SanmT=*kQZ;pml#x`}ri^8f$<000000RI300000001S +3vY-Mg^c~p6DWpe-t0Y>fS!w4MxxaL=+DqP^k2!wz9AHH68xp8!<%Jqp^&Hw-a00 +0000RI300000000(DfZe??6a{;SD{|dyAYDEzER9^-pDoqKDkX2Z-)7v*JaEw{tO +hXD~cywiMb7^mGa{vkfWOW`wsTH9-LlJ`2|Ay5Z(?oEikl{+~pis;@Q*TJ#0cNz9 +gpb5|Ibh#3lIwO7kh2b~5Yat1R4r0u5eSq}aR2}S000000RI300000001I?-VQzD +2bZKvHa{vkfG*S<)6P6lYy(#<=BR_>s@(?%#f7ArN-=Rj?7Ns(10lmj>c*;HH-+n +x*l=M-QoGleKhk#vs%IKt8i%IbTe*gdg000000RI3000000019+@aAi|@b97~G0! +XQB?8_As^WnPDotHzoVsdtr@aSRwVWi2G1l#x)zof7oiPG643gHJ7x;*+(o97D-W +iY6OM0r~W-2xh +K9cV^W63=w?&L0!XQB?8_As^W +nPDotHzoVsdtr@aSRwVWi2G1l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IusYuPIV!b?p725f0@b!l +V(1pxut;9)08u!CeLKyU8YAgL0^vpn5O4pIusYuPIV!b?pQSVL%GX>LMnX>MdwWn +pYocu;h51OfmDVrg_^Z)t7-1pxvG|HJk{=BHQW>(iVt$m2HN5eB?Xzf>dBv8whnK +UZ)@C#Wt^wA&hNfbvI8l{tqo-}{|djZ8YAkJtUQVz<=+25f0@b!lV(1pxvG|HJk{ +=BHQW>(iVt$m2HN5eB?Xzf>dBv8whnKUZ)@C#Wt^wA&hNfbvI8l{tqo-}{|djZ8Y +AkJtUQVz<>3SVL%GX>LMnX>MdwWnpYocxhw=0sseMX>?<6X>I@o0RjmB!}dYur&r +|b)0{BK<2K$A2E0wbR3p=|s`fKKS8%Y#aju4Y+v8xG!`|yM#YZ$vY*ct@ +WCQ{L2V!Y-V{d7000jX82>-+OLFT7dqK>mX$cszrKCL=@F5H{a;)B(Tlt4rog*WC0S0Voadl~A00jX82>-+OLFT7dqK>mX$cszrKCL=@F5H{a;)B(Tlt4rog +*WC5LiQKVQFqtWn*$>bW>$vYy<)T2V!Y-V{d7000jX82>-+OLFT7d-+OLFT7d?<6X>I@o0Rr`G6Jj +IwIj2eqliWu}$@z+_xPw?-wb>Rw7=FYk8VaL=Li5Yl(a@n1+Ku60FILp}Zw|!7cE +!MGSxid=WmW+OY-w?IX=DHe0Rr`G6JjIwIj2eqliWu}$@z+_xPw?-wb>Rw7=FYk8 +VaL=Li5Yl(a@n1+Ku60FILp}Zw|!7cE!MGSxid=WmW -----END STRICT TYPE LIB----- diff --git a/stl/RGB@0.1.0.stl b/stl/RGB@0.1.0.stl index bf2f125819689616029df90bfb681a258f727ae5..b2750c6f6f48c2b28e26b05ba812de07042d04e5 100644 GIT binary patch delta 1437 zcmX@q$oQ_2v7R}|-HDCk|KV?r&z6Tjd3||~!HLIa_XOGY`0fu;zPxeOH)H$o0yd`r z=lr5nTSK!?d>d+}$aOkbX8pZ;BtP86^In$TikoU#<{vg{xAHjW=jLXXgryc`rd4{Z z%z1NKRQU75T^Hw0cix#)R5s&TBQ>~*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 27/29] 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 28/29] 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 29/29] 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 +