public static function fromString($key)
    {
        //   version (4) || depth (1) || parent fingerprint (4) ||
        //   child num (4) || chain code (32) || key data (33) || checksum (4)
        $payload = DecredNetwork::extendedKeyBase58Decode($key);
        $network = NetworkFactory::fromExtendedKeyVersion(substr($payload, 0, 4));
        $depth = intval(hexdec(substr($payload, 4, 1)));
        $parentFP = substr($payload, 5, 4);
        $childNum = intval(hexdec(substr($payload, 9, 4)));
        $chainCode = substr($payload, 13, 32);
        $key = substr($payload, 45, 33);
        $private = $payload[45] === "\x00";

        return new ExtendedKey($key, $chainCode, $depth, $parentFP, $childNum, $network, $private);
    }