 { randomBytes, bytesToHex, hexToBytes, bytesToBase64, base64ToBytes } = Crypto.util
 { UTF8 } = Crypto.charenc
 { getSECCurveByName } = BigInteger.sec
+{ OP_HASH160, OP_EQUAL } = Bitcoin.Opcode.map
 
 TESTNET = !!~document.location.hash.indexOf('TESTNET')
 

  address = get_address script.buffer, ADDR_P2SH
  { pubkeys, script, address }

# Parse and validate base58 Bitcoin addresses
# Validates and strips the checksum, and optionally the expected version byte
parse_address = (address, version) ->


module.exports = {
  ADDR_P2SH, ADDR_PUB, ADDR_PRIV, PRIVKEY_LEN, PUBKEY_LEN, ADDR_LEN
  get_address, get_pub, parse_address, parse_pubkey, get_script_address
  create_multisig, create_out_script, random_privkey
  sign_message, verify_sig
  parse_key_string, parse_key_bytes
}
