Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Useful Utility functions

Jörn Franke edited this page Nov 12, 2017 · 11 revisions

The hadoopcryptoledger library has some useful utility methods that are relevant when working with cryptoledgers.

  • Bitcoin
    • getTransactionHash to calculate the hash of a transaction (txid). This is useful to link addresses from transaction inputs to addresses for transaction output.
    • getTransactionHashSegwit to calculate the hash of a transaction including Segwit information (wtxid). This is useful to link addresses from transaction inputs to addresses for transaction output.
    • reverseByteArray to reverse the order of a given byte array. For example, if you want to search for a transaction hash provided by getTransactionHash in a public blockchain explorer (e.g. http://blockchain.info) then you need to reverse it
    • getPaymentDestination to get the payment destination described in the output script of a transaction
  • Namecoin
    • getNameOperation - to get the type of Namecoin name operation (e.g. new, firstupdate or update) in a transaction. Note that not all Namecoin transactions contain name operations.
    • extractNamecoinField - in case the transaction contains a Namecoin name operation of type firstupdate or update then this method enables you to pull further information, such as domain name or identity (e.g. d/example) as well as the associated configuration (e.g. ip addresses, sub domains etc.).
  • Ethereum

Clone this wiki locally