[−][src]Struct lnpbp::dbc::lockscript::LockscriptCommitment
LockScript
containing public keys which sum is commit to some message
according to LNPBP-2
Trait Implementations
impl AsMut<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment
[src]
impl AsRef<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment
[src]
impl Borrow<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment
[src]
impl BorrowMut<<LockscriptCommitment as Wrapper>::Inner> for LockscriptCommitment
[src]
pub fn borrow_mut(&mut self) -> &mut Self::Inner
[src]
impl Clone for LockscriptCommitment
[src]
pub fn clone(&self) -> LockscriptCommitment
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for LockscriptCommitment
[src]
impl Default for LockscriptCommitment
[src]
pub fn default() -> LockscriptCommitment
[src]
impl Deref for LockscriptCommitment
[src]
type Target = Self::Inner
The resulting type after dereferencing.
pub fn deref(&self) -> &Self::Target
[src]
impl DerefMut for LockscriptCommitment
[src]
impl Display for LockscriptCommitment
[src]
impl<MSG> EmbedCommitVerify<MSG> for LockscriptCommitment where
MSG: AsRef<[u8]>,
[src]
MSG: AsRef<[u8]>,
type Container = LockscriptContainer
External container type that will be used to host commitment to a message Read more
type Error = Error
Error type that may be reported during [commit_embed] procedure
pub fn embed_commit(
container: &mut Self::Container,
msg: &MSG
) -> Result<Self, Self::Error>
[src]
container: &mut Self::Container,
msg: &MSG
) -> Result<Self, Self::Error>
Function implements commitment procedure according to LNPBP-2.
LNPBP-2 Specification extract:
- The provided script MUST be parsed with Miniscript parser; if the parser fails the procedure MUST fail.
- Iterate over all branches of the abstract syntax tree generated by
the Miniscript parser, running the following algorithm for each node:
- if a public key hash is met (
pk_h
Miniscript command) and it can't be resolved against known public keys or other public keys extracted from the script, fail the procedure; - if a public key is found (
pk
) add it to the list of the collected public keys; - for all other types of Miniscript commands iterate over their branches.
- if a public key hash is met (
- Select unique public keys (i.e. if some public key is repeated in different parts of the script/in different script branches, pick a single instance of it). Compressed and uncompressed versions of the same public key must be treaded as the same public key under this procedure.
- If no public keys were found fail the procedure; return the collected keys otherwise.
NB: SUBJECT TO CHANGE UPON RELEASE
By "miniscript" we mean usage of rust-miniscript
library at commit
a5ba1219feb8b5a289c8f12176d632635eb8a959
which may be found on
https://github.com/LNP-BP/rust-miniscript/commit/a5ba1219feb8b5a289c8f12176d632635eb8a959
pub fn verify(
&self,
container: &Self::Container,
msg: &MSG
) -> Result<bool, Self::Error>
[src]
&self,
container: &Self::Container,
msg: &MSG
) -> Result<bool, Self::Error>
impl Eq for LockscriptCommitment
[src]
impl From<LockScript> for LockscriptCommitment
[src]
pub fn from(v: LockScript) -> Self
[src]
impl Hash for LockscriptCommitment
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl LowerHex for LockscriptCommitment
[src]
impl Ord for LockscriptCommitment
[src]
pub fn cmp(&self, other: &LockscriptCommitment) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<LockscriptCommitment> for LockscriptCommitment
[src]
pub fn eq(&self, other: &LockscriptCommitment) -> bool
[src]
pub fn ne(&self, other: &LockscriptCommitment) -> bool
[src]
impl PartialOrd<LockscriptCommitment> for LockscriptCommitment
[src]
pub fn partial_cmp(&self, other: &LockscriptCommitment) -> Option<Ordering>
[src]
pub fn lt(&self, other: &LockscriptCommitment) -> bool
[src]
pub fn le(&self, other: &LockscriptCommitment) -> bool
[src]
pub fn gt(&self, other: &LockscriptCommitment) -> bool
[src]
pub fn ge(&self, other: &LockscriptCommitment) -> bool
[src]
impl StructuralEq for LockscriptCommitment
[src]
impl StructuralPartialEq for LockscriptCommitment
[src]
impl UpperHex for LockscriptCommitment
[src]
impl Wrapper for LockscriptCommitment
[src]
type Inner = LockScript
Inner type wrapped by the current newtype
pub fn from_inner(inner: Self::Inner) -> Self
[src]
pub fn as_inner(&self) -> &Self::Inner
[src]
pub fn as_inner_mut(&mut self) -> &mut Self::Inner
[src]
pub fn into_inner(self) -> Self::Inner
[src]
pub fn to_inner(&self) -> Self::Inner
[src]
Auto Trait Implementations
impl RefUnwindSafe for LockscriptCommitment
[src]
impl Send for LockscriptCommitment
[src]
impl Sync for LockscriptCommitment
[src]
impl Unpin for LockscriptCommitment
[src]
impl UnwindSafe for LockscriptCommitment
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToHex for T where
T: LowerHex,
[src]
T: LowerHex,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,