import json


def load_keypair(filename):
    """Loads keypair from a file.

    :param str filename: File name
    :return: The loaded keypair
    :rtype: (str, str)
    """
    with open(filename, 'rt') as f:
        j = json.load(f)
    public = j['public']
    secret = j['secret']
    return (secret, '0x' + public)