Skip to main content

Crate elements

Crate elements 

Source
Expand description

§Rust Elements Library

Extensions to rust-bitcoin to support deserialization and serialization of Elements transactions and blocks.

Re-exports§

pub extern crate bitcoin;
pub extern crate encoding;
pub extern crate hashes;
pub extern crate hex;
pub extern crate secp256k1_zkp;

Re-exports§

pub use crate::address::Address;
pub use crate::address::AddressError;
pub use crate::address::AddressParams;
pub use crate::confidential::RangeProof;
pub use crate::confidential::SurjectionProof;
pub use crate::issuance::AssetBlindingNonce;
pub use crate::issuance::AssetBlindingNonceDecoder;
pub use crate::issuance::AssetBlindingNonceDecoderError;
pub use crate::issuance::AssetBlindingNonceEncoder;
pub use crate::issuance::AssetEntropy;
pub use crate::issuance::AssetEntropyDecoder;
pub use crate::issuance::AssetEntropyDecoderError;
pub use crate::issuance::AssetEntropyEncoder;
pub use crate::issuance::AssetId;
pub use crate::issuance::AssetIdDecoder;
pub use crate::issuance::AssetIdDecoderError;
pub use crate::issuance::AssetIdEncoder;
pub use crate::issuance::ContractHash;
pub use crate::locktime::LockTime;
pub use crate::schnorr::SchnorrSig;
pub use crate::schnorr::SchnorrSigError;
pub use crate::script::Script;
pub use crate::sighash::SchnorrSighashType;
pub use crate::hash_types::*;

Modules§

address
Addresses
blech32
Blech32-Encoding (Elements Segwit) Support
confidential
Confidential Commitments
dynafed
Dynamic Federations
encode
Consensus-encodable types
genesis
Helpers to calculate the genesis block for a given network.
hash_types
File defines types for hashes used throughout the library.
issuance
Asset Issuance
locktime
Provides type LockTime that implements the logic around nLockTime/OP_CHECKLOCKTIMEVERIFY.
opcodes
Opcodes
pset
Partially Signed Elements Transactions (PSET)
schnorr
Schnorr Bitcoin keys.
script
Script
sighash
BIP143 Implementation
taproot
Taproot

Structs§

AssetIssuance
Description of an asset issuance in a transaction input
AssetIssuanceDecoder
Decoder for the AssetIssuance type.
AssetIssuanceDecoderError
Decoder error for the AssetIssuance type.
AssetIssuanceEncoder
Encoder for the AssetIssuance type.
Block
Elements block
BlockHeader
Elements block header
CtLocation
Data structure for Unifying inputs and pseudo-inputs.
DynafedRoot
The Merkle root of a set of dynafed parameters.
OutPoint
A reference to a transaction output
PeginData
Parsed data from a transaction input’s pegin witness
PeginDataDecoder
A decoder for the PeginData type.
PeginDataEncoder
An encoder for the PeginWitness type.
PeginWitness
A pegin witness, which must be either a stack of 6 well-formed pieces of pegin data, or an empty witness stack.
PeginWitnessDecoder
Decoder for the PeginWitness type.
PeginWitnessDecoderError
Error type for the decoding of PeginData or PeginWitness.
PeginWitnessEncoder
Encoder for the PeginWitness type.
PegoutData
Information about a pegout
RangeProofMessage
The Rangeproof message
Sequence
Bitcoin transaction input sequence number.
SequenceDecoder
Decoder for the Sequence type.
SequenceDecoderError
Decoder error for the Sequence type.
SequenceEncoder
Encoder for the Sequence type.
Transaction
Elements transaction
TransactionDecoder
Decoder for the Transaction type.
TransactionDecoderError
Decoder error for the Transaction type.
TransactionEncoder
Encoder for the Transaction type.
TxIn
A transaction input, which defines old coins to be consumed
TxInDecoder
Decoder for the TxIn type.
TxInDecoderError
Decoder error for the TxIn type.
TxInEncoder
Encoder for the TxIn type.
TxInWitness
Transaction input witness
TxInWitnessDecoder
Decoder for the TxInWitness type.
TxInWitnessDecoderError
Decoder error for the TxInWitness type.
TxInWitnessEncoder
Encoder for the TxInWitness type.
TxOut
Transaction output
TxOutDecoder
Decoder for the TxOut type.
TxOutDecoderError
Decoder error for the TxOut type.
TxOutEncoder
Encoder for the TxOut type.
TxOutSecrets
Information about Transaction Input Asset
TxOutWitness
Transaction output witness
TxOutWitnessDecoder
Decoder for the TxOutWitness type.
TxOutWitnessDecoderError
Decoder error for the TxOutWitness type.
TxOutWitnessEncoder
Encoder for the TxOutWitness type.
Witness
The Witness is the data used to unlock bitcoin since the SegWit upgrade.
WitnessDecoder
The decoder for the Witness type.
WitnessDecoderError
An error when consensus decoding a Witness.
WitnessEncoder
The encoder for the Witness type.

Enums§

BlindError
Errors encountered when blinding transaction outputs.
BlockExtData
Data related to block signatures
ConfidentialTxOutError
Errors encountered when constructing confidential transaction outputs.
CtLocationType
Inputs or pseudo-inputs.
EcdsaSighashType
Hashtype of a transaction, encoded in the last byte of a signature Fixed values so they can be casted as integer types for encoding
SurjectionInput
Data structure used to provide inputs to SurjectionProof methods.
TxOutError
Transaction Output related errors
UnblindError
Errors encountered when unblinding TxOuts.
VerificationError
Transaction Verification Errors

Traits§

ReadExt
Extensions of Read to decode data as per Bitcoin consensus.
WriteExt
Extensions of Write to encode data as per Bitcoin consensus.

Functions§

fast_merkle_root
Compute the Merkle root of the give hashes using mid-state only.