Skip to main content

Crate scp_kernel

Crate scp_kernel 

Source
Expand description

The Stellar Consensus Protocol (SCP) kernel: federated voting, nomination and the ballot protocol, following stellar-core’s implementation, over Thruput’s protocol types from thruput_scp.

The application supplies two things. A Consensus validates and combines its values and receives progress notifications through ConsensusNotify. A Driver supplies quorum sets by hash, hashes and signs for the node, emits envelopes to peers and runs the timers. StellarKernel::new takes both, with the node ID, the validator flag and the local quorum set. StellarKernel::proto returns the StellarProto through which envelopes from peers arrive (DriverCb::received_envelope), values are nominated (StellarProto::nominate) and expired timers are delivered (DriverCb::driver_calling_back).

The kernel does not verify envelope signatures. Envelopes must be authenticated before they reach it; see DriverCb.

verifier checks, outside a running kernel, that a set of EXTERNALIZE envelopes proves a slot externalized under a quorum set.

Everything in scp_util is re-exported.

Re-exports§

pub use stellar::*;
pub use kernel::*;
pub use info::*;
pub use local::*;
pub use federated::*;
pub use verifier::*;
pub use slot::*;
pub use qset::*;
pub use ballotutil::*;
pub use phase::*;
pub use envelope::*;
pub use nomination::*;
pub use ballot::*;
pub use heuristic::*;
pub use util::*;

Modules§

ballot
ballotutil
envelope
federated
hash
heuristic
info
kernel
keygen
local
nomination
phase
qset
sign
slot
stellar
util
verifier
xdr

Enums§

DriverCallback
SigningError
Timer
ValidationLevel
VerifyingError

Constants§

HASH_K
HASH_N
HASH_P

Traits§

Consensus
ConsensusNotify
Driver
DriverCb
The entry points through which the application drives the protocol.

Functions§

derive_node_id
derive_public_key
generate_secret_key
Derives an Ed25519 secret key deterministically from seed: the key’s 32-byte seed is SHA-256(seed).
hash_bytes
hash_xdr
hash_xdr_scp
marshal_xdr
parse_secret_key_from_base64
Parse a SecretKey from a Base64 standard encoded string of the 64-byte secret key
public_key_bytes
The raw bytes of a public key, whatever its scheme.
sign_bytes
Signs msg with secret_key: plain Ed25519 (RFC 8032), no pre-hash.
sign_xdr
unmarshal_xdr
verify_bytes
Verifies signature over msg with public_key: plain Ed25519 (RFC 8032) under the ZIP-215 validation rules.
verify_envelope
Verifies that envelope.signature is a valid signature over the XDR encoding of envelope.statement produced by the secret key matching envelope.statement.node_id.
verify_xdr