Crate elements

source ·
Expand description

§Rust Elements Library

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



  • Addresses
  • Blech32-Encoding (Elements Segwit) Support
  • Confidential Commitments
  • Dynamic Federations
  • Consensus-encodable types
  • File defines types for hashes used throughout the library. These types are needed in order to avoid mixing data of the same hash format (like SHA256d) but of different meaning (transaction id, block hash etc).
  • Hex Encoding and Decoding
  • Asset Issuance
  • Provides type LockTime that implements the logic around nLockTime/OP_CHECKLOCKTIMEVERIFY.
  • Opcodes
  • Partially Signed Elements Transactions (PSET)
  • Schnorr Bitcoin keys.
  • Script
  • BIP143 Implementation
  • Taproot





  • Compute the Merkle root of the give hashes using mid-state only. The inputs must be byte slices of length 32. Note that the merkle root calculated with this method is not the same as the one computed by a normal SHA256(d) merkle root.