nodes: 0, module; 1, function_definition; 2, function_name:get_utxoset_merkle_root; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, comment:# TODO Once ready, use the already pre-computed utxo_hash field.; 9, comment:# See common/transactions.py for details.; 10, expression_statement; 11, comment:# TODO Notice the sorted call!; 12, return_statement; 13, comment:"""Returns the merkle root of the utxoset. This implies that
          the utxoset is first put into a merkle tree.
  
          For now, the merkle tree and its root will be computed each
          time. This obviously is not efficient and a better approach
          that limits the repetition of the same computation when
          unnecesary should be sought. For instance, future optimizations
          could simply re-compute the branches of the tree that were
          affected by a change.
  
          The transaction hash (id) and output index should be sufficient
          to uniquely identify a utxo, and consequently only that
          information from a utxo record is needed to compute the merkle
          root. Hence, each node of the merkle tree should contain the
          tuple (txid, output_index).
  
          .. important:: The leaves of the tree will need to be sorted in
              some kind of lexicographical order.
  
          Returns:
              str: Merkle root in hexadecimal form.
          """; 14, assignment; 15, assignment; 16, call; 17, identifier:utxoset; 18, call; 19, identifier:hashes; 20, list_comprehension; 21, identifier:merkleroot; 22, argument_list; 23, attribute; 24, argument_list; 25, call; 26, for_in_clause; 27, call; 28, attribute; 29, identifier:get_unspent_outputs; 30, attribute; 31, attribute; 32, argument_list; 33, identifier:utxo; 34, identifier:utxoset; 35, identifier:sorted; 36, argument_list; 37, identifier:backend; 38, identifier:query; 39, identifier:self; 40, identifier:connection; 41, call; 42, identifier:digest; 43, identifier:hashes; 44, identifier:sha3_256; 45, argument_list; 46, call; 47, attribute; 48, argument_list; 49, call; 50, identifier:encode; 51, attribute; 52, argument_list; 53, string; 54, identifier:format; 55, subscript; 56, subscript; 57, string_content:{}{}; 58, identifier:utxo; 59, string; 60, identifier:utxo; 61, string; 62, string_content:transaction_id; 63, string_content:output_index
code: def get_utxoset_merkle_root(self):
          """Returns the merkle root of the utxoset. This implies that
          the utxoset is first put into a merkle tree.
  
          For now, the merkle tree and its root will be computed each
          time. This obviously is not efficient and a better approach
          that limits the repetition of the same computation when
          unnecesary should be sought. For instance, future optimizations
          could simply re-compute the branches of the tree that were
          affected by a change.
  
          The transaction hash (id) and output index should be sufficient
          to uniquely identify a utxo, and consequently only that
          information from a utxo record is needed to compute the merkle
          root. Hence, each node of the merkle tree should contain the
          tuple (txid, output_index).
  
          .. important:: The leaves of the tree will need to be sorted in
              some kind of lexicographical order.
  
          Returns:
              str: Merkle root in hexadecimal form.
          """
          utxoset = backend.query.get_unspent_outputs(self.connection)
          # TODO Once ready, use the already pre-computed utxo_hash field.
          # See common/transactions.py for details.
          hashes = [
              sha3_256(
                  '{}{}'.format(utxo['transaction_id'], utxo['output_index']).encode()
              ).digest() for utxo in utxoset
          ]
          # TODO Notice the sorted call!
          return merkleroot(sorted(hashes))