Both: P2PKH https://en.bitcoin.it/wiki/Transaction#Pay-to-PubkeyHash and P2SH https://en.bitcoin.it/wiki/Pay_to_script_hash This is covered in BIP0016 and BIP0013, so will need to be own library. https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki