Skip to content

Commit

Permalink
chore: update to new STL
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Feb 3, 2024
1 parent bce2b34 commit 7f2e245
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 84 deletions.
82 changes: 46 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ serde = ["serde_crate", "commit_verify/serde"]

[package.metadata.docs.rs]
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" }
6 changes: 3 additions & 3 deletions commit_verify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ name = "commit-stl"
required-features = ["stl"]

[dependencies]
amplify = { version = "4.5.0", features = ["hex", "apfloat"] }
amplify = { version = "4.5.1", features = ["hex", "apfloat"] }
commit_encoding_derive = { version = "0.11.0-beta.3", path = "derive" }
strict_encoding = "2.6.1"
strict_encoding = "2.6.2"
strict_types = { version = "1.6.3" }
sha2 = "0.10.8"
ripemd = "0.1.3"
Expand All @@ -38,7 +38,7 @@ rand = "0.8.5"
default = ["derive"]
all = ["rand", "serde", "stl", "derive"]
serde = ["serde_crate", "amplify/serde"]
stl = ["strict_types/base64"]
stl = ["strict_types/base85"]
derive = []

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion commit_verify/src/stl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use strict_types::{CompileError, LibBuilder, TypeLib};
use crate::{mpc, LIB_NAME_COMMIT_VERIFY};

pub const LIB_ID_COMMIT_VERIFY: &str =
"urn:ubideco:stl:Ewz3JJVGUDfT1KkcBpJ1tYHUpVfvwNpQBWdvPqKMEZfY#capitan-bonjour-whiskey";
"urn:ubideco:stl:4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner";

fn _commit_verify_stl() -> Result<TypeLib, CompileError> {
LibBuilder::new(libname!(LIB_NAME_COMMIT_VERIFY), tiny_bset! {
Expand Down
45 changes: 22 additions & 23 deletions stl/[email protected]
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
-----BEGIN STRICT TYPE LIB-----
Id: urn:ubideco:stl:ZtHaBzu9ojbDahaGKEXe5v9DfSDxLERbLkEB23R6Q6V
Id: 4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner
Name: CommitVerify
Dependencies:
urn:ubideco:stl:9KALDYR8Nyjq4FdMW6kYoL7vdkWnqPqNuFnmE9qHpNjZ
55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray

DENvbW1pdFZlcmlmeQF7hIA8nvriESWnfCw5vHDS/ej5Q64N/Zz05oLtx2bKcANT
dGQBA1N0ZAEAIuTglum9fVyG9eHfXXcBav45xzzZNIVQlECJjKijeV4CVTUIAApD
b21taXRtZW50BQEABwAAQCAAC01lcmtsZUJsb2NrBgQFZGVwdGgCe4SAPJ764hEl
p3wsObxw0v3o+UOuDf2c9OaC7cdmynAi5OCW6b19XIb14d9ddwFq/jnHPNk0hVCU
QImMqKN5Xghjb2ZhY3RvcgAAAgxjcm9zc1NlY3Rpb24ACAFTQ5UPRDMqI//ogM9Q
588IBqEEzeBIaxPhDPwYg0Ow1wAAAAAAAAAA/////wAAAAAHZW50cm9weQAEAgAE
bm9uZQAAAAEEc29tZQAFAQAACApNZXJrbGVOb2RlBQEABwAAQCAAC01lcmtsZVBy
b29mBgMDcG9zAAAECGNvZmFjdG9yAAACBHBhdGgACAFVjTcH+EWGU4DuzEFVJOik
mWBR05SCQ/GU9/GRVyPp5gAAAAAAAAAAIAAAAAAAAAAKTWVya2xlVHJlZQYFBWRl
cHRoAnuEgDye+uIRJad8LDm8cNL96PlDrg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mAZf|a7000011aog~WdH>M000O
IO=WUxY-LDcb7%zt00#g7Kp+4MO=WUxY-Lb#Z*OJ>0|Rhxa{vGY2xD(%VPkY}asU
7V1aM(=XaEQSIG#g>Clv)aMjKgwAH@`bu1x<7g|G$};xvA~n-$_S0000000000AO
HXW000003Qc8lYiwmya%E)(1qEbfaCB$_JfJU>zJB;=bhBCKPB)LHON@H8JZNt%N
vJPm-=hp1W>|38j$F|Rkm*bpSUudIqf?x<LRg@~V42^pIs*%m2W4(_a&K^X000OG
V{c|*V{~tF0006AZDn(FVP|D?015#xm44<OVKiC01qkHfuRUrZzt;Qv9WjEZdF4f
P;8w8#H8-hI70Bv^+*0?ef%0)>Q3WPbltNdpi4*91)SI!>0000000000|Ns90000
0018re&015yA1ONpB0Wg(*<{e=)S-S-Y<l(P9Y9YVY`}-X+f~R@qMRed+u>mzVsZ
kZk>V@1=_p5>Oab-~jCR3C`SFec^=zG+gvC{wm0000000960{{R30000L~Wpi_3X
JrKe00#g7Kp+4LP;zf{Z)0z4Nn`~900#g7Kp+4JRB~lyPH$vo1OfmJV{dL_WnpY(
WKM5nWdH^O1!QG#bZ7!Rpf8lZe)ws0vsvd(H;<-EjC!>^Xm2e^s4rySqYNBoSa8^
mT+s=T=}Z?`J=~w8Q=GLzSfImTncuED0}GM_Xkl|`0XUvRh9?yTI7S;;e;>sZfv!
yd427@;7veO2zMB=|GXV}`Z*6U9bZupBbWCMoW&j2P3UG37bZ=vCY)NDRFqMAh9b
q(Cy9Eg3;jcYvA-~r9`yDZYr+MW?bl_I82W@3@b75y?0W~+NQ5DGQh1^p2tAX-yW
l;qtQ<OqiuZa`rd(@k;(*

-----END STRICT TYPE LIB-----

Binary file modified stl/[email protected]
Binary file not shown.
49 changes: 28 additions & 21 deletions stl/[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{-
Id: urn:ubideco:stl:ZtHaBzu9ojbDahaGKEXe5v9DfSDxLERbLkEB23R6Q6V#rhino-cover-frog
Id: urn:ubideco:stl:4SZ2EgWWtC5LsNXmNpAzogNHZoaZNTCwU3SQhAYwDX6A#citizen-fiction-corner
Name: CommitVerify
Version: 0.1.0
Description: Client-side-validation deterministic commitments
Expand All @@ -8,38 +8,45 @@
License: Apache-2.0
-}

@context
typelib CommitVerify

import urn:ubideco:stl:9KALDYR8Nyjq4FdMW6kYoL7vdkWnqPqNuFnmE9qHpNjZ#justice-rocket-type as Std
-- Imports:
-- U5 := urn:ubideco:semid:3MDHMYsJt8d1gUiyx5vGCWcNLQ7biek6UTjHg3ksW4Bf#ground-volume-singer
import Std#55f8bsTvyh7zAeYAiNwL9G1DxgwXzDvE8edcTFJz3Q9H#milan-poncho-gray
use U5#nitro-george-nebula


@mnemonic(ventura-equal-think)
data Commitment : [Byte ^ 32]

-- urn:ubideco:semid:F8mU5NPc8Z5CMnkSFGdF5UxrPsdcBS6B5DCyP5kJPgWc#ventura-equal-think
data Commitment :: [Byte ^ 32]
-- urn:ubideco:semid:qp6pMjMCcukxxZdkM2PtfNWfJjXKoVHXtXSBCsYjQwY#transit-bogart-nissan
data MerkleBlock :: depth Std.U5 {- urn:ubideco:semid:3MDHMYsJt8d1gUiyx5vGCWcNLQ7biek6UTjHg3ksW4Bf#ground-volume-singer -}
@mnemonic(iris-explore-script)
data MerkleBlock : depth Std.U5#nitro-george-nebula
, cofactor U16
, crossSection [TreeNode ^ ..0xffffffff]
, entropy U64?
-- urn:ubideco:semid:6kxYeCatpncbA9UiTdsFbxbxJdU56x6MdmTRkEeGAv6R#iceberg-rocket-velvet
data MerkleNode :: [Byte ^ 32]
-- urn:ubideco:semid:9FbrjZLnMDfbrN9gEbWij5HNkxqAVaZBkoW2UvKdYw4B#canyon-exhibit-ravioli
data MerkleProof :: pos U32

@mnemonic(culture-metro-modular)
data MerkleHash : [Byte ^ 32]

@mnemonic(father-adios-common)
data MerkleProof : pos U32
, cofactor U16
, path [MerkleNode ^ ..0x20]
-- urn:ubideco:semid:57jCv2LWrdn89GzuSYaH17f21N3su76uM2tEaG1dwwoT#russian-wedding-florida
data MerkleTree :: depth Std.U5 {- urn:ubideco:semid:3MDHMYsJt8d1gUiyx5vGCWcNLQ7biek6UTjHg3ksW4Bf#ground-volume-singer -}
, path [MerkleHash ^ ..0x20]

@mnemonic(civil-left-nova)
data MerkleTree : depth Std.U5#nitro-george-nebula
, entropy U64
, cofactor U16
, messages {ProtocolId -> ^ ..0xffffff Message}
, map {U32 -> ^ ..0xffffff ProtocolId, Message}
-- urn:ubideco:semid:4ajqScXjJ6wQ5af2zgBFzzP7k1qzD6DXXU28taQidCcA#shampoo-bishop-morgan
data Message :: [Byte ^ 32]
-- urn:ubideco:semid:4GenVCt5Xq6xtnJDjT98FehgCS8rTmwEzbjwGkaUVjHz#gamma-banjo-corona
data ProtocolId :: [Byte ^ 32]
-- urn:ubideco:semid:D7Q2eTnYyjN6gMZnZYrMG6gmRwmtnxyGLeqBbki8DFLv#greek-decimal-quiz
data TreeNode :: concealedNode (depth Std.U5 {- urn:ubideco:semid:3MDHMYsJt8d1gUiyx5vGCWcNLQ7biek6UTjHg3ksW4Bf#ground-volume-singer -}, hash MerkleNode)

@mnemonic(shampoo-bishop-morgan)
data Message : [Byte ^ 32]

@mnemonic(gamma-banjo-corona)
data ProtocolId : [Byte ^ 32]

@mnemonic(empty-active-truck)
data TreeNode : concealedNode (depth Std.U5#nitro-george-nebula, hash MerkleHash)
| commitmentLeaf (protocolId ProtocolId, message Message)


0 comments on commit 7f2e245

Please sign in to comment.