-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
89 lines (74 loc) · 3.03 KB
/
Cargo.toml
File metadata and controls
89 lines (74 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
[workspace]
members = ["wasm-vpack"]
[package]
name = "vpack"
version = "1.0.0-rc.1"
edition = "2021"
authors = ["Jon McAlpine"]
description = "A no_std Rust library for the universal serialization and verification of VTXOs."
license = "MIT"
repository = "https://github.com/jgmcalpine/libvpack-rs"
readme = "README.md"
keywords = ["bitcoin", "vtxo", "verification", "layer2", "ark"]
categories = ["cryptography", "no-std", "embedded"]
[dependencies]
# Optional: full bitcoin (pulls secp256k1 C lib; not used for wasm32).
bitcoin = { version = "0.32", default-features = false, optional = true }
# Optional: hashes only for wasm (no secp256k1).
bitcoin_hashes = { version = "0.14", default-features = false, optional = true }
# Serialization
borsh = { version = "1.3", default-features = false, features = ["derive"] }
# Parsing (Manual Safety)
byteorder = { version = "1.5", default-features = false }
# Checksum
crc32fast = { version = "1.4", default-features = false }
# Optional features
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"], optional = true }
serde_json = { version = "1.0", optional = true }
hex = { version = "0.4", default-features = false, features = ["alloc"], optional = true }
# BIP-340 Schnorr verification (pure Rust; no C linkage for wasm32).
k256 = { version = "0.13", default-features = false, features = ["schnorr"], optional = true }
[features]
default = ["std", "bitcoin", "schnorr-verify", "export-json"]
std = [
"bitcoin?/std",
"borsh/std",
"byteorder/std",
"crc32fast/std",
"serde?/std",
]
alloc = []
# Use full bitcoin crate (native builds only; pulls secp256k1).
bitcoin = ["dep:bitcoin"]
# BIP-341 script-path control blocks and Taproot output-key tweaking use `rust-secp256k1` via this
# crate. This is separate from `schnorr-verify` (BIP-340 signature checks via k256 / wasm).
# Control-block APIs are compiled only when `bitcoin` is enabled.
# Enable JSON adapters (reconstruction_ingredients -> VPackTree; used by wasm-vpack)
adapter = ["dep:serde", "dep:hex", "dep:serde_json", "std", "export-json"]
# JSON envelope (VpackState) + serde on export ingredient types (optional for minimal builds).
export-json = ["dep:serde", "dep:hex", "dep:serde_json", "hex/alloc"]
# For wasm32: no bitcoin (no secp256k1); use bitcoin_hashes + minimal types.
wasm = [
"dep:serde",
"dep:hex",
"dep:serde_json",
"export-json",
"dep:bitcoin_hashes",
"borsh/std",
"byteorder/std",
"crc32fast/std",
"serde?/std",
"schnorr-verify",
]
# BIP-340 Schnorr signature verification + Taproot sighash helpers; uses k256 (pure Rust, wasm-friendly).
# Taproot *output-key tweak* for `bitcoin` builds uses rust-secp256k1 instead (see `compute_taproot_tweak`).
schnorr-verify = ["dep:k256"]
[dev-dependencies]
ark-lib = "0.1.0-beta.9"
borsh = { version = "1.3", features = ["derive"] }
hex = "0.4"
k256 = { version = "0.13", default-features = false, features = ["schnorr"] }
musig2 = "0.3.1"
proptest = "1.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"