public function parseBitcoinTransaction(array $tx, $protocol_version=null) {
        if ($protocol_version === null) { $protocol_version = self::DEFAULT_PROTOCOL_VERSION; }

        switch ($protocol_version) {
            case 1:
                return $this->parseBitcoinTransactionVersion1($tx);
            case 2:
                return $this->parseBitcoinTransactionVersion2($tx);
            
            default:
                throw new Exception("Unknown protocol version", 1);
        }
    }