Skip to content

tochicool/bitcoin-taro

Repository files navigation

bitcoin-taro

Warning: This library is highly experimental and should be used for education purposes with caution. For reference implementation, see: https://github.com/lightninglabs/taro.

Work in progress Haskell library implementing parts of the Taproot Asset Representation Overlay (Taro) protocol:

  • Asset Tree Representation (Encoding ⇔ Decoding)
  • Asset Creation
  • Asset Burning
  • Asset Transfers
  • Asset Universes
  • Multi-Hop Taro Asset Transfer
  • Address Representation (Encoding ⇔ Decoding)
  • Sending
  • Spending
  • The Empty Hash Map
  • Lookup / Insert / Delete elements
  • Create / Verify Merkle Proofs
  • Compress / Decompress Merkle Proofs
  • Caching Optimizations
  • Proof File Representation (Encoding ⇔ Decoding)
  • Proof File Verification
  • Asset Universes
  • Asset Multiverses
  • Pocket Universes
  • Input Mapping
  • Output Mapping
  • State Transition Validation

Differences from the BIPs

The spec is still being developed so the BIPs may be out of date with the reference implementation. As library aims to track the behaviour of the reference implementation, here are some notable differences and elaborations from the BIPs (I think) the library has come across and has tried to replicate here:

BIP-TARO

  • genesis_outpoint.index is in Big Endian, not in little endian as in the bitcoin wire format
  • previous_asset_witnesses has length prefix in BigSize, rather than u16
  • keys are encoding with their parity bytes: lightninglabs/taproot-assets#187

BIP-TARO-ADDR

  • bech32m encoding relaxes the 90 character length limit defined in BIP-173
  • the TLV type asset_type is removed as it is now embedded in asset_genesis

BIP-TARO-MS-SMT

  • compression_bits of the CompressedProof is serialised in after compacting the bits into bytes.

BIP-TARO-PROOF-FILE

  • asset_inclusion_proof.proof_version is the 1 byte asset_version, not the 4 byte proof_version
  • taro_inclusion_proof.proof_version is the 1 byte asset_version, not the 4 byte proof_version
  • taproot_exclusion_proof.bip86 = 2 1 byte field added

About

Haskell library for the Bitcoin TARO protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published