serde-BOLT
An incomplete implementation of the Lightning BOLT message serialization format. Compatible with rust-bitcoin Encodable and Decodable traits.
Unlike rust-bitcoin, the default is big-endian encoding and u16/u32 for length fields for the following types:
- Octets (u16 length field)
- Array (u16 length field)
- LargeOctets (u32 length field)
- IgnoredLargeOctets (u32 length field)
Option is implemented as a single byte, with None as 0x00 and Some as 0x01 followed by the value.
Domain-specific types are not implemented. You can just use Array<u8> or [u8; nnn] or a wrapped version thereof.
Structs and tuples are considered transparent - they are not delimited in the stream.
Unimplemented
- TLVs
Usage
use ;
extern crate alloc;
use ;
use ;
;