Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
582100d
chore: initial work on crate refactoring
dr-orlovsky Aug 1, 2023
cfb3523
runtime: implementing basics
dr-orlovsky Aug 1, 2023
b354c30
Merge branch 'resolver' into v0.11
dr-orlovsky Aug 1, 2023
7aaf809
runtime: wip
dr-orlovsky Aug 1, 2023
6e79103
cli: make compile
dr-orlovsky Aug 1, 2023
df2080b
cli: streamline resolver initialization
dr-orlovsky Aug 2, 2023
bdd3cbf
cli: add wallet output filtering
dr-orlovsky Aug 2, 2023
adec580
cli: complete RGB and BP wallet integration for state command
dr-orlovsky Aug 2, 2023
0b9e759
runtime: add load_or method
dr-orlovsky Aug 4, 2023
a705149
runtime: uncomment RGB methods
dr-orlovsky Aug 4, 2023
3f97f25
runtime: allow callback function for load_or to error
dr-orlovsky Aug 4, 2023
40413b4
chore: fix outdated example contract
dr-orlovsky Aug 4, 2023
3bcceca
runtime: move descriptor to rgb-std
dr-orlovsky Aug 6, 2023
9c5d21e
runtime: add address_network convenience method
dr-orlovsky Aug 6, 2023
76c9421
runtime: refactor load functions
dr-orlovsky Aug 6, 2023
de47249
runtime: add descriptor method
dr-orlovsky Aug 6, 2023
331852a
runtime: support load_or_init for internal bitcoin wallet
dr-orlovsky Aug 7, 2023
780af23
descriptor: add serde serialization for descriptors
dr-orlovsky Aug 9, 2023
1d20f41
add support to RgbKeychain
dr-orlovsky Aug 9, 2023
20e1f71
chore: update dependencies
dr-orlovsky Aug 12, 2023
64a9c46
cli: update to the new underlying APIs
dr-orlovsky Aug 12, 2023
a07d98c
cli: provide custom Rgb descriptors
dr-orlovsky Aug 12, 2023
680fe37
cli: fix clap errors
dr-orlovsky Aug 12, 2023
2c0e4e1
cli: connect BP commands through RGB
dr-orlovsky Aug 12, 2023
9e11d67
runtime: fix load_or_init wallet path computing
dr-orlovsky Aug 12, 2023
e17e494
runtime: avoid use of bp_rt::Runtime, use naked bp::Wallet instead
dr-orlovsky Sep 18, 2023
80ab99c
chore: update dependencies
dr-orlovsky Oct 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,452 changes: 1,112 additions & 340 deletions Cargo.lock

Large diffs are not rendered by default.

83 changes: 49 additions & 34 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,74 +1,89 @@
[workspace]
members = [
"runtime",
"fs",
".",
"."
]
default-members = [
"runtime",
"fs",
"."
]

[workspace.package]
version = "0.11.0-alpha"
keywords = ["bitcoin", "lightning", "rgb", "smart-contracts", "lnp-bp"]
categories = ["cryptography::cryptocurrencies"]
authors = ["Dr Maxim Orlovsky <orlovsky@lnp-bp.org>"]
homepage = "https://github.com/RGB-WG"
repository = "https://github.com/RGB-WG/rgb"
homepage = "https://lnp-bp.org"
repository = "https://github.com/RGB-WG/rgb-wallet"
rust-version = "1.67" # Due to strict encoding library
edition = "2021"
license = "Apache-2.0"

[workspace.dependencies]
amplify = "4.0.0"
amplify = "4.5.0"
baid58 = "0.4.4"
strict_encoding = "2.5.0"
strict_types = "1.6.0"
rgb-std = { version = "0.10.5", features = ["fs"] }
rgb-wallet = { version = "0.10.5", features = ["fs"] }
strict_encoding = "2.6.1"
strict_types = "1.6.3"
bp-dbc = "0.10.10"
bp-std = "0.10.0-beta.1"
bp-wallet = "0.10.0-beta.1"
bp-utils = "0.10.0-beta.1"
bp-esplora = "0.10.0-beta.1"
rgb-std = { version = "0.11.0-alpha", features = ["fs"] }
rgb-invoice = "0.11.0-alpha"
serde_crate = { package = "serde", version = "1", features = ["derive"] }
serde_yaml = "0.9.19"
log = { version = "0.4", features = ["max_level_trace", "release_max_level_debug"] }

[package]
name = "rgb-contracts"
version = "0.10.0-rc.4"
description = " RGB: scalable & confidential smart contracts for Bitcoin & Lightning network"
keywords = ["bitcoin", "lightning", "rgb", "smart-contracts", "lnp-bp"]
categories = ["cryptography::cryptocurrencies"]
name = "rgb-wallet"
version = "0.11.0-alpha"
description = "Command-line wallet for RGB smart contracts on Bitcoin"
keywords = { workspace = true }
categories = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
readme = "README.md"
exclude = [".github", "std"]

[lib]
name = "rgb"
exclude = [".github"]

[[bin]]
name = "rgb"
required-features = ["cli"]
path = "src/main.rs"

[dependencies]
amplify = { workspace = true }
baid58 = { workspace = true }
strict_types = { workspace = true, features = ["serde"] }
commit_verify = "0.10.5"
bp-core = { version = "0.10.7", features = ["serde"] }
rgb-std = { workspace = true }
rgb-wallet = { workspace = true }
rgb-persist-fs = { version = "0.10.0", path = "fs" }
bitcoin = { version = "0.30.0", features = ["serde"] }
electrum-client = { version = "0.15.1", optional = true }
log = { version = "0.4", features = ["max_level_trace", "release_max_level_debug"], optional = true }
commit_verify = "0.10.6"
bp-seals = "0.10.11"
bp-std = { workspace = true, features = ["serde"] }
bp-wallet = { workspace = true }
bp-esplora = { workspace = true }
bp-util = "0.10.0-beta.1"
rgb-std = { workspace = true, features = ["serde", "descriptor"] }
rgb-invoice = { workspace = true }
rgb-runtime = { version = "0.11.0-alpha", path = "runtime", features = ["log", "serde"] }
log = { workspace = true }
env_logger = "0.10.0"
clap = { version = "4.1.8", features = ["derive", "env"], optional = true }
shellexpand = { version = "3.0.0", optional = true }
serde = "1.0.159"
serde_yaml = "0.9.19"
clap = { version = "4.4.6", features = ["derive", "env"] }
shellexpand = "3.1.0"
serde_crate = { workspace = true }
serde_yaml = { workspace = true }
toml = "0.8.2"

[features]
default = ["electrum", "log"]
all = ["cli", "log"]
electrum = ["electrum-client", "log"]
cli = ["clap", "shellexpand", "log", "electrum"]
default = []

[package.metadata.docs.rs]
features = [ "all" ]

[patch.crates-io]
rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "v0.10" }
rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" }
rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" }
Binary file modified examples/rgb20-demo.rgb
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/rgb20-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ globals:

assignments:
assetOwner:
seal: tapret1st:c9a86c99127f1b2d1ff495c238f13069ac881ec9527905016122d11d85b19b61:1
seal: tapret1st:ca43e9a01782343c78fa67cc20d75d81545a8d38a031d361180c36c088639fed:0
amount: 100000000000000
2 changes: 1 addition & 1 deletion fs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rgb-persist-fs"
version = "0.10.0"
version = "0.11.0"
description = "RGB persistence drivers for file storage"
keywords = ["bitcoin", "lightning", "rgb", "smart-contracts", "lnp-bp"]
categories = ["cryptography::cryptocurrencies"]
Expand Down
6 changes: 3 additions & 3 deletions fs/src/stock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
use std::path::Path;

use amplify::confinement::U32;
use rgbstd::persistence::Stock;
use rgb::persistence::Stock;
use strict_encoding::{DeserializeError, SerializeError, StrictDeserialize, StrictSerialize};

pub trait StockFs: Sized {
fn load(file: impl AsRef<Path>) -> Result<Self, DeserializeError>;
fn store(&self, file: impl AsRef<Path>) -> Result<(), SerializeError>;
fn load(path: impl AsRef<Path>) -> Result<Self, DeserializeError>;
fn store(&self, path: impl AsRef<Path>) -> Result<(), SerializeError>;
}

impl StockFs for Stock {
Expand Down
36 changes: 36 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[package]
name = "rgb-runtime"
version.workspace = true
description = "RGB smart contracts wallet runtime"
keywords.workspace = true
categories.workspace = true
readme = "../README.md"
authors.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true
edition.workspace = true
license.workspace = true

[lib]
name = "rgb_rt"

[dependencies]
amplify = { workspace = true }
strict_types = { workspace = true }
bp-dbc = { workspace = true }
bp-std = { workspace = true }
bp-wallet = { workspace = true, features = ["fs"] }
bp-esplora = { workspace = true, optional = true }
descriptors = "=0.10.0-BP-beta.1"
rgb-std = { workspace = true }
rgb-persist-fs = { version = "0.11.0-alpha", path = "../fs" }
serde_crate = { workspace = true, optional = true }
serde_yaml = { workspace = true, optional = true }
log = { workspace = true, optional = true }

[features]
default = []
all = ["esplora", "serde", "log"]
esplora = ["bp-esplora", "bp-wallet/esplora"]
serde = ["serde_crate", "serde_yaml", "bp-std/serde", "bp-wallet/serde",]
11 changes: 1 addition & 10 deletions src/descriptor.rs → runtime/src/descriptor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RGB smart contracts for Bitcoin & Lightning
// RGB smart contract wallet runtime
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -30,15 +30,6 @@ use bp::dbc::tapret::{TapretCommitment, TapretPathProof, TapretProof};
use bp::{ScriptPubkey, TapNodeHash};
use commit_verify::ConvolveCommit;

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Display)]
#[display("*/{app}/{index}")]
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TerminalPath {
pub app: u32,
pub index: u32,
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct DeriveInfo {
pub terminal: TerminalPath,
Expand Down
22 changes: 4 additions & 18 deletions src/lib.rs → runtime/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RGB smart contracts for Bitcoin & Lightning
// RGB smart contract wallet runtime
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -24,23 +24,9 @@ extern crate amplify;
#[cfg(feature = "log")]
#[macro_use]
extern crate log;
#[macro_use]
extern crate serde;
#[cfg(feature = "serde")]
extern crate serde_crate as serde;

mod descriptor;
mod runtime;
mod wallet;

pub mod prelude {
pub use descriptor::{RgbDescr, SpkDescriptor, Tapret, TerminalPath};
pub use rgbfs::StockFs;
pub use rgbstd::*;
pub use rgbwallet::*;
pub use runtime::{Runtime, RuntimeError};
#[cfg(feature = "electrum")]
pub use wallet::BlockchainResolver;
pub use wallet::{DefaultResolver, RgbWallet};

pub use super::*;
}
pub use prelude::*;
pub use runtime::{Runtime, RuntimeError};
Loading