Skip to content

Commit

Permalink
vesper: add commitment layout for TransitionBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Feb 26, 2024
1 parent 534ef91 commit 0716f0e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
22 changes: 20 additions & 2 deletions src/bin/rgbcore-stl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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 rgb::{SubSchema, Transition, TransitionBundle};
use strict_types::stl::{std_stl, strict_types_stl};
use strict_types::typelib::parse_args;
use strict_types::SystemBuilder;
Expand Down Expand Up @@ -119,8 +119,26 @@ Seals vesper lexicon=types+commitments
let tt = sys.type_tree("RGB.Transition").unwrap();
writeln!(file, "{tt}").unwrap();

let mut file = fs::File::create(format!("{dir}/AnchoredBundle.vesper")).unwrap();
writeln!(
file,
"{{-
Description: RGB Anchored Bundle
Author: Dr Maxim Orlovsky <[email protected]>
Copyright (C) 2024 LNP/BP Standards Association. All rights reserved.
License: Apache-2.0
-}}
Seals vesper lexicon=types+commitments
"
)
.unwrap();
let layout = TransitionBundle::commitment_layout();
writeln!(file, "{layout}").unwrap();
let tt = sys.type_tree("RGB.InputMap").unwrap();
writeln!(file, "{tt}").unwrap();
let tt = sys.type_tree("RGB.AnchoredBundle").unwrap();
fs::write(format!("{dir}/AnchoredBundle.vesper",), format!("{tt}")).unwrap();
writeln!(file, "{tt}").unwrap();

let tt = sys.type_tree("CommitVerify.MerkleNode").unwrap();
fs::write(format!("{dir}/MerkleNode.vesper",), format!("{tt}")).unwrap();
Expand Down
17 changes: 17 additions & 0 deletions stl/AnchoredBundle.vesper
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
{-
Description: RGB Anchored Bundle
Author: Dr Maxim Orlovsky <[email protected]>
Copyright (C) 2024 LNP/BP Standards Association. All rights reserved.
License: Apache-2.0
-}

Seals vesper lexicon=types+commitments

BundleId commitment hasher=SHA256 tagged=urn:lnp-bp:rgb:bundle#2024-02-03
InputMap serialized

_ map len=1..MAX16 aka=InputMap
key is U32 aka=Vout
value bytes len=32 aka=OpId

AnchoredBundle rec
anchor union -- XChainAnchorSet
bitcoin union wrapped tag=0 -- AnchorSet
Expand Down Expand Up @@ -319,3 +335,4 @@ AnchoredBundle rec
salt is U64
valencies set len=0..MAX8 aka=Valencies
element is U16 aka=ValencyType

0 comments on commit 0716f0e

Please sign in to comment.