code: def chain_to_bitcoin_network(chain):
      
      if chain == Chain.bitcoin_mainnet:
          return SYS_NETWORK_BITCOIN_MAINNET
      elif chain == Chain.bitcoin_testnet:
          return SYS_NETWORK_BITCOIN_TESTNET
      elif chain == Chain.bitcoin_regtest:
          return SYS_NETWORK_BITCOIN_REGTEST
      else:
          message = 'This chain cannot be converted to a bitcoin netcode; chain='
          if chain:
              message += chain.name
          else:
              message += '<NULL>'
          raise UnknownChainError(message)
docs: Used or bitcoin.SelectParams
      :param chain:
      :return: