ProprietaryKey

Struct ProprietaryKey 

Source
pub struct ProprietaryKey<Subtype = u8>
where Subtype: Copy + From<u8> + Into<u8>,
{ pub prefix: Vec<u8>, pub subtype: Subtype, pub key: Vec<u8>, }
Expand description

Proprietary keys (i.e. keys starting with 0xFC byte) with their internal structure according to BIP 174.

Fields§

§prefix: Vec<u8>

Proprietary type prefix used for grouping together keys under some application and avoid namespace collision

§subtype: Subtype

Custom proprietary subtype

§key: Vec<u8>

Additional key bytes (like serialized public key data etc)

Implementations§

Source§

impl<Subtype> ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8>,

Source

pub fn to_key(&self) -> Key

Constructs full Key corresponding to this proprietary key type

Trait Implementations§

Source§

impl<Subtype> Clone for ProprietaryKey<Subtype>
where Subtype: Clone + Copy + From<u8> + Into<u8>,

Source§

fn clone(&self) -> ProprietaryKey<Subtype>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Subtype> Debug for ProprietaryKey<Subtype>
where Subtype: Debug + Copy + From<u8> + Into<u8>,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<Subtype> Decodable for ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8>,

Source§

fn consensus_decode<R>(r: &mut R) -> Result<ProprietaryKey<Subtype>, Error>
where R: Read + ?Sized,

Decode an object with a well-defined format. Read more
Source§

fn consensus_decode_from_finite_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read + ?Sized,

Decode Self from a size-limited reader. Read more
Source§

impl<'de, Subtype> Deserialize<'de> for ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8> + Deserialize<'de>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ProprietaryKey<Subtype>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Subtype> Encodable for ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8>,

Source§

fn consensus_encode<W>(&self, w: &mut W) -> Result<usize, Error>
where W: Write + ?Sized,

Encodes an object with a well-defined format. Read more
Source§

impl<Subtype> Hash for ProprietaryKey<Subtype>
where Subtype: Hash + Copy + From<u8> + Into<u8>,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Subtype> Ord for ProprietaryKey<Subtype>
where Subtype: Ord + Copy + From<u8> + Into<u8>,

Source§

fn cmp(&self, other: &ProprietaryKey<Subtype>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<Subtype> PartialEq for ProprietaryKey<Subtype>
where Subtype: PartialEq + Copy + From<u8> + Into<u8>,

Source§

fn eq(&self, other: &ProprietaryKey<Subtype>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Subtype> PartialOrd for ProprietaryKey<Subtype>
where Subtype: PartialOrd + Copy + From<u8> + Into<u8>,

Source§

fn partial_cmp(&self, other: &ProprietaryKey<Subtype>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl RgbOutExt<ProprietaryKey> for Output

Source§

fn get_internal_pk(&self) -> Option<XOnlyPublicKey>

Source§

fn is_tap_tree_empty(&self) -> bool

Source§

fn set_tap_tree(&mut self, script_commitment: &ScriptBuf)

Source§

fn bip32_derivation_terminals(&self) -> Vec<Terminal>

Source§

fn tap_bip32_derivation_terminals(&self) -> Vec<Terminal>

Source§

fn proprietary_mpc_messages<'a>( &'a self, ) -> impl Iterator<Item = (&'a [u8], &'a [u8])> + 'a

Source§

fn proprietary_insert(&mut self, key: ProprietaryKey, value: Vec<u8>)

Source§

fn proprietary_contains_key(&self, key: &ProprietaryKey) -> bool

Source§

fn proprietary_get_value(&self, key: &ProprietaryKey) -> Option<&[u8]>

Source§

fn proprietary_remove(&mut self, key: &ProprietaryKey)

Source§

fn is_opret_host(&self) -> bool

Source§

fn is_tapret_host(&self) -> bool

Source§

fn set_opret_host(&mut self) -> bool

Source§

fn set_tapret_host(&mut self) -> bool

Source§

fn tapret_commitment(&self) -> Result<TapretCommitment, TapretKeyError>

Returns valid tapret commitment from the PSBT_OUT_TAPRET_COMMITMENT key, if present. If the commitment is absent or invalid, returns TapretKeyError::NoCommitment.
Source§

fn opret_commit(&mut self, commitment: Commitment) -> Result<(), OpretKeyError>

Assigns value of the opreturn commitment to this PSBT output, by adding PSBT_OUT_OPRET_COMMITMENT proprietary key containing the 32-byte commitment as its value. Also modifies the output script and removes PSBT_OUT_OPRET_HOST key. Read more
Source§

fn tapret_commit( &mut self, commitment: Commitment, ) -> Result<TapretProof, TapretKeyError>

Assigns value of the tapreturn commitment to this PSBT output, by adding PSBT_OUT_TAPRET_COMMITMENT and PSBT_OUT_TAPRET_PROOF proprietary keys containing the 32-byte commitment as its proof. Read more
Source§

fn terminal_derivation(&self) -> Option<Terminal>

Source§

fn mpc_message_map( &self, ) -> Result<Confined<BTreeMap<ProtocolId, Message>, amplify::::collection::confinement::MediumOrdMap::{constant#0}, amplify::::collection::confinement::MediumOrdMap::{constant#1}>, MpcPsbtError>

Returns mpc::MessageMap constructed from the proprietary key data.
Source§

fn mpc_entropy(&self) -> Option<u64>

Returns a valid LNPBP-4 entropy value, if present. Read more
Source§

fn mpc_min_tree_depth(&self) -> Option<u8>

Source§

fn set_mpc_entropy(&mut self, entropy: u64) -> Result<bool, MpcPsbtError>

Sets MPC entropy value. Read more
Source§

fn set_mpc_message( &mut self, protocol_id: ProtocolId, message: Message, ) -> Result<bool, MpcPsbtError>

Sets MPC Message for the given ProtocolId. Read more
Source§

fn mpc_commit(&mut self) -> Result<(Commitment, MerkleBlock), MpcPsbtError>

Source§

fn proprietary_push( &mut self, key: P, value: Vec<u8>, ) -> Result<(), MpcPsbtError>

Source§

fn proprietary_contains(&self, key: &P) -> bool

Source§

fn proprietary_get(&self, key: &P) -> Option<&[u8]>

Source§

impl RgbPropKeyExt for ProprietaryKey

Source§

impl RgbPsbtExt<ProprietaryKey, Output> for Psbt

Source§

fn get_txid(&self) -> Txid

Source§

fn modifiable_outputs(&self) -> bool

Source§

fn set_as_unmodifiable(&mut self)

Source§

fn unsigned_tx(&self) -> Transaction

Source§

fn set_opret_host(&mut self) -> bool

Source§

fn dbc_output<D>(&self) -> Option<&Output>
where D: DbcPsbtProof,

Source§

fn dbc_output_mut<D>(&mut self) -> Option<(usize, &mut Output)>
where D: DbcPsbtProof,

Source§

fn set_opret_commitment(&mut self, idx: usize)

Source§

fn set_tapret_commitment(&mut self, idx: usize)

Source§

fn proprietary_rgb_contract_consumer_keys<'a>( &'a self, ) -> impl Iterator<Item = &'a [u8]> + 'a

Source§

fn outputs_iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut Output>
where Output: 'a,

Source§

fn proprietary_insert(&mut self, key: ProprietaryKey, value: Vec<u8>)

Source§

fn proprietary_contains_key(&self, key: &ProprietaryKey) -> bool

Source§

fn proprietary_get_value(&self, key: &ProprietaryKey) -> Option<&[u8]>

Source§

fn dbc_commit<D>(&mut self) -> Result<(MerkleBlock, D), DbcPsbtError>
where D: DbcPsbtProof, Self: Sized,

Source§

fn rgb_embed(&mut self, batch: Batch) -> Result<(), EmbedError>

Source§

fn rgb_commit(&mut self) -> Result<Fascia, CommitError>
where Self: Sized,

Source§

fn rgb_contract_ids(&self) -> Result<BTreeSet<ContractId>, FromSliceError>

Source§

fn rgb_contract_consumers( &self, contract_id: ContractId, ) -> Result<BTreeMap<Opout, OpId>, RgbPsbtError>

Source§

fn rgb_transition(&self, opid: OpId) -> Result<Option<Transition>, RgbPsbtError>

Source§

fn rgb_close_method(&self) -> Result<Option<Method>, RgbPsbtError>

Source§

fn rgb_tapret_host_on_change(&self) -> bool

Source§

fn set_rgb_close_method(&mut self, close_method: Method)

Source§

fn set_rgb_tapret_host_on_change(&mut self)

Source§

fn set_rgb_contract_consumer( &mut self, contract_id: ContractId, opout: Opout, opid: OpId, ) -> Result<bool, RgbPsbtError>

Adds information about an RGB input allocation and the ID of the state transition spending it. Read more
Source§

fn push_rgb_transition( &mut self, transition: Transition, ) -> Result<bool, RgbPsbtError>

Source§

fn rgb_bundles( &self, ) -> Result<BTreeMap<ContractId, TransitionBundle>, RgbPsbtError>

Source§

fn rgb_bundles_to_mpc( &mut self, ) -> Result<Confined<BTreeMap<ContractId, TransitionBundle>, 1, psrgbt::::RgbPsbtExt::rgb_bundles_to_mpc::{constant#0}>, RgbPsbtError>

Source§

fn proprietary_push( &mut self, key: P, value: Vec<u8>, ) -> Result<(), MpcPsbtError>

Source§

fn proprietary_contains(&self, key: &P) -> bool

Source§

fn proprietary_get(&self, key: &P) -> Option<&[u8]>

Source§

impl<Subtype> Serialize for ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8> + Serialize,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Subtype> TryFrom<Key> for ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8>,

Source§

fn try_from( key: Key, ) -> Result<ProprietaryKey<Subtype>, <ProprietaryKey<Subtype> as TryFrom<Key>>::Error>

Constructs a ProprietaryKey from a Key.

§Errors

Returns Error::InvalidProprietaryKey if key does not start with 0xFC byte.

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

impl<Subtype> Eq for ProprietaryKey<Subtype>
where Subtype: Eq + Copy + From<u8> + Into<u8>,

Source§

impl<Subtype> StructuralPartialEq for ProprietaryKey<Subtype>
where Subtype: Copy + From<u8> + Into<u8>,

Auto Trait Implementations§

§

impl<Subtype> Freeze for ProprietaryKey<Subtype>
where Subtype: Freeze,

§

impl<Subtype> RefUnwindSafe for ProprietaryKey<Subtype>
where Subtype: RefUnwindSafe,

§

impl<Subtype> Send for ProprietaryKey<Subtype>
where Subtype: Send,

§

impl<Subtype> Sync for ProprietaryKey<Subtype>
where Subtype: Sync,

§

impl<Subtype> Unpin for ProprietaryKey<Subtype>
where Subtype: Unpin,

§

impl<Subtype> UnwindSafe for ProprietaryKey<Subtype>
where Subtype: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> VerifyEq for T
where T: Eq,

Source§

fn verify_eq(&self, other: &T) -> bool

Verifies commit-equivalence of two instances of the same type.
Source§

impl<T> VerifyEq for T
where T: Eq,

Source§

fn verify_eq(&self, other: &T) -> bool

Verifies commit-equivalence of two instances of the same type.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,