Crates.io | vls-core |
lib.rs | vls-core |
version | 0.12.0 |
source | src |
created_at | 2023-03-05 21:56:23.66772 |
updated_at | 2024-08-09 09:21:25.154751 |
description | A library for implementing a Lightning signer, which externalizes and secures cryptographic operations. |
homepage | https://gitlab.com/lightning-signer/docs/ |
repository | https://gitlab.com/lightning-signer/validating-lightning-signer |
max_upload_size | |
id | 801762 |
size | 1,225,658 |
Please see the VLS Project Overview for more information. Our web site.
The following remain to be implemented:
vlsd2 --recover-to
can only handle a simple force-close by us. It cannot sweep a force-close or a breach by the peer. It also cannot sweep HTLC outputs.no_std
VLS wire protocol encoder/decoder - in ./vls-protocolno_std
protocol handler for VLS - in ./vls-protocol-signerhsmd
binary, implemented in Rust in ./vls-proxy.Additional HOWTO Documentation
We recommend using the nightly version of Rust only in specific cases, such as for cargo fmt
and no-std
. Otherwise, we explicitly recommend using the stable version.
Enable formatting precommit hooks:
./scripts/enable-githooks
For some reason, the ignore
configuration for rustfmt is only available on the nightly channel,
even though it's documented as stable.
rustup install nightly
cargo +nightly fmt
Build VLS and related crates:
cargo build
cargo test
To enable logging for a failing test (adjust log level to preference):
RUST_LOG=trace cargo test
Dependencies:
cargo +stable install cargo-llvm-cov --locked
Run coverage:
./scripts/run-llvm-cov
Changing linker to mold
instead of ld
:
cp .cargo/config.sample.toml .cargo/config.toml
cargo bench -p vls-core --bench secp_bench
Note that you might need to add --features=test_utils
if you want to run all benches in vls-core.
Without optimizations:
cargo bench -p vls-core --bench secp_bench --profile=dev
Expect something like:
test fib1_bench ... bench: 1 ns/iter (+/- 0)
test fib_bench ... bench: 17,247 ns/iter (+/- 198)
test hash_bench ... bench: 258 ns/iter (+/- 2)
test secp_create_bench ... bench: 49,981 ns/iter (+/- 642)
test sign_bench ... bench: 25,692 ns/iter (+/- 391)
test verify_bench ... bench: 31,705 ns/iter (+/- 1,445)
i.e. around 30 microseconds per secp256k1 crypto operation. We also see that creating a secp context is expensive, but not prohibitively so.