diff --git a/Cargo.lock b/Cargo.lock index a409bca8..c8fc877c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,6 +98,19 @@ dependencies = [ "serde", ] +[[package]] +name = "ascii-armor" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743d90b41a39d6e3920eef64a70f6411097cbb47141606a45b2a96533ec7111c" +dependencies = [ + "amplify", + "baid58", + "base85", + "sha2", + "strict_encoding", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -260,8 +273,7 @@ dependencies = [ [[package]] name = "commit_encoding_derive" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25b4b09de08ea8530138fb8a7ca45d90b53fef8d582a944a1b08eedf3f2583e" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=master#e963d5df29e9c04cb24dfc7d0b3553d286bb1986" dependencies = [ "amplify", "amplify_syn", @@ -273,8 +285,7 @@ dependencies = [ [[package]] name = "commit_verify" version = "0.11.0-beta.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00351b49be0ce72775b37cca336c3c10e958d810ca097f0712d95a63684b4f99" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=master#e963d5df29e9c04cb24dfc7d0b3553d286bb1986" dependencies = [ "amplify", "commit_encoding_derive", @@ -650,13 +661,13 @@ dependencies = [ [[package]] name = "strict_types" -version = "2.7.0-beta.1" +version = "2.7.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66de5cdf197b68e13fcac9fad7ed288f44052a319a3df3abbaba9c6e52f735b" +checksum = "78c32716de4b99b0e8fb0c114e99b6929613e8d7302999c6b8c77251783923ad" dependencies = [ "amplify", + "ascii-armor", "baid58", - "base85", "half", "indexmap", "sha2", diff --git a/Cargo.toml b/Cargo.toml index 9b4f35c3..64124e58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ license = "Apache-2.0" [workspace.dependencies] amplify = "4.6.0" strict_encoding = "2.7.0-beta.1" -strict_types = "2.7.0-beta.1" +strict_types = "2.7.0-beta.2" commit_verify = "0.11.0-beta.4" single_use_seals = "0.11.0-beta.4" bp-consensus = { version = "0.11.0-beta.4", path = "consensus" } @@ -77,7 +77,7 @@ serde = [ "bp-dbc/serde", "bp-seals/serde", ] -stl = ["strict_types", "strict_types/base85", "bp-consensus/stl", "commit_verify/stl"] +stl = ["strict_types", "strict_types/armor", "bp-consensus/stl", "commit_verify/stl"] [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen = "0.2" @@ -89,3 +89,6 @@ wasm-bindgen-test = "0.3" [package.metadata.docs.rs] features = [ "all" ] + +[patch.crates-io] +commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "master" } diff --git a/src/stl.rs b/src/stl.rs index 5c19bee0..a0f80417 100644 --- a/src/stl.rs +++ b/src/stl.rs @@ -32,7 +32,7 @@ use strict_types::{CompileError, LibBuilder, TypeLib}; /// Strict types id for the library providing data types from [`dbc`] and /// [`seals`] crates. pub const LIB_ID_BPCORE: &str = - "urn:ubideco:stl:c8Tnib31q1p7szyPukEGDoQzJQ5qJwPCn5uZCHUXzB9#cupid-metro-warning"; + "urn:ubideco:stl:BeAiDVK898mzgHrmWgxHtysDhmffgMEoDwBgNuZo7QeZ#connect-verona-secret"; fn _bp_core_stl() -> Result { LibBuilder::new(libname!(LIB_NAME_BPCORE), tiny_bset! { diff --git a/stl/Anchor.MerkleBlock.Tapret.vesper b/stl/Anchor.MerkleBlock.Tapret.vesper index e8395f79..4aac1ce2 100644 --- a/stl/Anchor.MerkleBlock.Tapret.vesper +++ b/stl/Anchor.MerkleBlock.Tapret.vesper @@ -1,29 +1,31 @@ AnchorMerkleBlockTapretProof rec txid bytes len=32 aka=Txid - mpcProof rec -- MerkleBlock + mpcProof rec MerkleBlock depth enum { - _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 _8=8 - _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 _16=16 - _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 _24=24 - _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 - } -- U5 + U5 _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 + _8=8 _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 + _16=16 _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 + _24=24 _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 + + } cofactor is U16 - crossSection list len=0..MAX32 + crossSection list len=1..MAX32 TreeNode union concealedNode rec tag=0 depth enum { - _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 _8=8 - _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 _16=16 - _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 _24=24 - _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 - } -- U5 + U5 _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 + _8=8 _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 + _16=16 _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 + _24=24 _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 + + } hash bytes len=32 aka=MerkleHash commitmentLeaf rec tag=1 protocolId bytes len=32 aka=ProtocolId message bytes len=32 aka=Message some is U64 option wrapped tag=1 - 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 diff --git a/stl/Anchor.MerkleProof.Tapret.vesper b/stl/Anchor.MerkleProof.Tapret.vesper index e7e2bb7b..027b1e08 100644 --- a/stl/Anchor.MerkleProof.Tapret.vesper +++ b/stl/Anchor.MerkleProof.Tapret.vesper @@ -1,12 +1,12 @@ AnchorMerkleProofTapretProof rec 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 diff --git a/stl/Anchor.MerkleTree.Opret.vesper b/stl/Anchor.MerkleTree.Opret.vesper index 5d71467f..13de5143 100644 --- a/stl/Anchor.MerkleTree.Opret.vesper +++ b/stl/Anchor.MerkleTree.Opret.vesper @@ -1,12 +1,13 @@ AnchorMerkleTreeOpretProof rec txid bytes len=32 aka=Txid - mpcProof rec -- MerkleTree + mpcProof rec MerkleTree depth enum { - _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 _8=8 - _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 _16=16 - _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 _24=24 - _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 - } -- U5 + U5 _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 + _8=8 _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 + _16=16 _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 + _24=24 _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 + + } entropy is U64 cofactor is U16 messages map len=0..MAX24 diff --git a/stl/Anchor.MerkleTree.Tapret.vesper b/stl/Anchor.MerkleTree.Tapret.vesper index b42c9feb..5de7efaa 100644 --- a/stl/Anchor.MerkleTree.Tapret.vesper +++ b/stl/Anchor.MerkleTree.Tapret.vesper @@ -1,12 +1,13 @@ AnchorMerkleTreeTapretProof rec txid bytes len=32 aka=Txid - mpcProof rec -- MerkleTree + mpcProof rec MerkleTree depth enum { - _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 _8=8 - _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 _16=16 - _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 _24=24 - _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 - } -- U5 + U5 _0=0 _1=1 _2=2 _3=3 _4=4 _5=5 _6=6 _7=7 + _8=8 _9=9 _10=10 _11=11 _12=12 _13=13 _14=14 _15=15 + _16=16 _17=17 _18=18 _19=19 _20=20 _21=21 _22=22 _23=23 + _24=24 _25=25 _26=26 _27=27 _28=28 _29=29 _30=30 _31=31 + + } entropy is U64 cofactor is U16 messages map len=0..MAX24 @@ -17,8 +18,8 @@ AnchorMerkleTreeTapretProof rec value tuple _ bytes len=32 aka=ProtocolId _ bytes len=32 aka=Message - 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 diff --git a/stl/BPCore@0.1.0.sta b/stl/BPCore@0.1.0.sta index acc7e014..08de4580 100644 --- a/stl/BPCore@0.1.0.sta +++ b/stl/BPCore@0.1.0.sta @@ -1,12 +1,12 @@ -----BEGIN STRICT TYPE LIB----- -Id: c8Tnib31q1p7szyPukEGDoQzJQ5qJwPCn5uZCHUXzB9#cupid-metro-warning +Id: urn:ubideco:stl:BeAiDVK898mzgHrmWgxHtysDhmffgMEoDwBgNuZo7QeZ#connect-verona-secret Name: BPCore -Dependencies: - 57sPvZcwQaziec3ux249XoCMhziQpKB8Yw99U5oRwfqW#deluxe-safari-random, - DzTvt9gGhPUKD8Dkkjk9PDBhkJ4gtWxXWQjxnmUYLNrs#voyage-kimono-disco, - HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9#speed-atlanta-trilogy +Dependency: 7qvjR4HCwJKF3mxE5GqsAaADces5JDRwb8ajAse9mkz3#exhibit-karate-ritual +Dependency: DzTvt9gGhPUKD8Dkkjk9PDBhkJ4gtWxXWQjxnmUYLNrs#voyage-kimono-disco +Dependency: HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9#speed-atlanta-trilogy +Checksum-SHA256: 64929409fba4ac73a0e4add2e174504c170ed17008f31180956f05569ceee36c -20~CnZ*pY=Jux=&4zPTb9*IMFYW>~BZ&yS~-fAwW*(Pc?@Ubg}3`1{iZE18?WpZg +20~CnZ*pY=Wv;<0l-(Pe$^)UD5K7r}*s>bq5$WSxcMKAy3WKnC3`1{iZE18?WpZg |dBFtCMqVsrZe&e(V->r|?y|b&t*2isXxNhAA_oAshyzn}Wc6$lVk7oBr%DNv+($ ;q`HHK!gIHa)*%m(-e#9sm3I{@IbYpL6ZUYBGX>?<6X>JGrA>%$n#j0HLDJN5-IK gM_J7b(p+0MPGk2Gl)y2(Rz1Xgc#bS10xxe^o?x}!PNUwajGr*TW+dUY6G&@nZ7) @@ -16,36 +16,36 @@ Mqk=;7%h%D+p%U7S;b1RT)c9`>#Kd;Rz-U=aO9W+B1XOrwWT}OOcT=8d`>?<6$C@ F;S3|*6`1-v+nBdcqJ?FPKcnV2wbY*gGVQf%qwlfK-7{9iX4Q|L-q$GzUMp|h#f#{Gz8SzLEaTf~c{WkYggkPIjuQHS#3Ua|L6d7%qre2 Ut&TY@l<|wuPSOOLZ&$Vj#jYr62iSlS>y#`6AYfdEyIAWpZn -5WkPIkV{0&#e&!uvG+Da^2;||fJ!&Dp*8BS%F@mRgsZfv!yd427@;7veO2zMB=|GYU;*a%*g5NMUnmh0#5^R?l+2>x*OcO&#*^E;5@PQ +)^zd;O=WUxY-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`HHK!gIHa)*%m(-e#9sm3ZsHT^UK%K(4i9Ajp1M~R@C@!4#dQE# -lUD;OiKi1RtRlyV^DH$Z)O5LF*foJuzZvri9>m6{oTZGS42tPYA&eRCTchEu`7iL +lUD;OiKi1RtRlyV^DH$Z)O5zuE8pl-5Z+91EHM|O4)SSvKr$N>Em2?3=*aagRpoA R`-7%D0S~qxm_HirtB!l h<{Yi-S-!KI0_27BH<@sVme~^s3=TqUX>MdwWnpYocu;h51_TCeWprq7WC1R>5GA >8Wft0d6dj=*oo`t>c$)o5X19O9`rXu=lIsL?cxhw-vE?{96bd-L@NXK=z8qksZ{ diff --git a/stl/BPCore@0.1.0.stl b/stl/BPCore@0.1.0.stl index 7a9248b6..2f0ba417 100644 Binary files a/stl/BPCore@0.1.0.stl and b/stl/BPCore@0.1.0.stl differ diff --git a/stl/BPCore@0.1.0.sty b/stl/BPCore@0.1.0.sty index d91886b2..924e47a8 100644 --- a/stl/BPCore@0.1.0.sty +++ b/stl/BPCore@0.1.0.sty @@ -1,5 +1,5 @@ {- - Id: urn:ubideco:stl:c8Tnib31q1p7szyPukEGDoQzJQ5qJwPCn5uZCHUXzB9#cupid-metro-warning + Id: urn:ubideco:stl:BeAiDVK898mzgHrmWgxHtysDhmffgMEoDwBgNuZo7QeZ#connect-verona-secret Name: BPCore Version: 0.1.0 Description: Bitcoin client-side-validation library @@ -11,12 +11,12 @@ @context typelib BPCore -import CommitVerify#57sPvZcwQaziec3ux249XoCMhziQpKB8Yw99U5oRwfqW#deluxe-safari-random +import CommitVerify#7qvjR4HCwJKF3mxE5GqsAaADces5JDRwb8ajAse9mkz3#exhibit-karate-ritual use MerkleTree#side-locate-bonus - use MerkleBlock#portal-slogan-mirage use ProtocolId#gamma-banjo-corona use Message#shampoo-bishop-morgan use MerkleHash#culture-metro-modular + use MerkleBlock#miracle-antenna-moral use MerkleProof#labor-hilton-magenta use TreeNode#risk-opinion-orca @@ -34,14 +34,14 @@ import Bitcoin#HX2UBak8vPsTokug1DGMDvTpzns3xUdwZ7QJdyt4qBA9#speed-atlanta-trilog use XOnlyPk#evident-finance-promo -@mnemonic(quest-respect-sound) +@mnemonic(promo-byte-ceramic) data AnchorMerkleBlockOpretProof : txid Bitcoin.Txid#cowboy-diego-betty - , mpcProof CommitVerify.MerkleBlock#portal-slogan-mirage + , mpcProof CommitVerify.MerkleBlock#miracle-antenna-moral , dbcProof OpretProof -@mnemonic(camera-hostel-perform) +@mnemonic(tarzan-grille-telecom) data AnchorMerkleBlockTapretProof : txid Bitcoin.Txid#cowboy-diego-betty - , mpcProof CommitVerify.MerkleBlock#portal-slogan-mirage + , mpcProof CommitVerify.MerkleBlock#miracle-antenna-moral , dbcProof TapretProof @mnemonic(absent-eric-armada) diff --git a/stl/Bitcoin@0.1.0.sta b/stl/Bitcoin@0.1.0.sta index 19479315..6faafa67 100644 --- a/stl/Bitcoin@0.1.0.sta +++ b/stl/Bitcoin@0.1.0.sta @@ -1,8 +1,8 @@ -----BEGIN STRICT TYPE LIB----- -Id: 7rhLkuvqTy2PpvD2zTFT4veffXutWDxjNgJbFAjU8cUC#join-object-wonder +Id: urn:ubideco:stl:7rhLkuvqTy2PpvD2zTFT4veffXutWDxjNgJbFAjU8cUC#join-object-wonder Name: Bitcoin -Dependencies: - DzTvt9gGhPUKD8Dkkjk9PDBhkJ4gtWxXWQjxnmUYLNrs#voyage-kimono-disco +Dependency: DzTvt9gGhPUKD8Dkkjk9PDBhkJ4gtWxXWQjxnmUYLNrs#voyage-kimono-disco +Checksum-SHA256: 4d5c95b088052dbd373f14a1705a17367bd5818e98c1882e295b60c542ed6575 2SRCdV{d700l@^!MqVsrZe&e(V->r|?y|b&t*2isXxNhAA_oAshyzn}WB~(HbYuY lVTK~nd#>DZ%0RR9 52v2o%aBpdDbOr(hba-iG0i%LK^UK%K(4i9Ajp1M~R@C@!4#dQE#lUD;OiKi1Rs?