func PrivateKeyFromBase58(privateKeyBase58Encoded string) (*PrivateKey, error) {
	privateKeyDecoded := util.FromBase58(privateKeyBase58Encoded)
	if 0 == len(privateKeyDecoded) {
		return nil, fault.CannotDecodePrivateKey
	}
	keyVariant, keyVariantLength := util.FromVarint64(privateKeyDecoded)
	if 0 == keyVariantLength || keyVariant&publicKeyCode == publicKeyCode {
		return nil, fault.NotPrivateKey
	}
	keyAlgorithm := keyVariant >> algorithmShift
	if keyAlgorithm >= algorithmLimit {
		return nil, fault.InvalidKeyType
	}
	isTest := 0 != keyVariant&testKeyCode
	keyLength := len(privateKeyDecoded) - keyVariantLength - checksumLength
	if keyLength <= 0 {
		return nil, fault.InvalidKeyLength
	}
	checksumStart := len(privateKeyDecoded) - checksumLength
	checksum := sha3.Sum256(privateKeyDecoded[:checksumStart])
	if !bytes.Equal(checksum[:checksumLength], privateKeyDecoded[checksumStart:]) {
		return nil, fault.ChecksumMismatch
	}
	switch keyAlgorithm {
	case ED25519:
		if keyLength != ed25519.PrivateKeySize {
			return nil, fault.InvalidKeyLength
		}
		priv := privateKeyDecoded[keyVariantLength:checksumStart]
		privateKey := &PrivateKey{
			PrivateKeyInterface: &ED25519PrivateKey{
				Test:       isTest,
				PrivateKey: priv,
			},
		}
		return privateKey, nil
	case Nothing:
		if 2 != keyLength {
			return nil, fault.InvalidKeyLength
		}
		priv := privateKeyDecoded[keyVariantLength:checksumStart]
		privateKey := &PrivateKey{
			PrivateKeyInterface: &NothingPrivateKey{
				Test:       isTest,
				PrivateKey: priv,
			},
		}
		return privateKey, nil
	default:
		return nil, fault.InvalidKeyType
	}
}
PrivateKeyFromBase58 - this converts a Base58 encoded string and returns an private key

one of the specific private key types are returned using the base "PrivateKeyInterface"
interface type to allow individual methods to be called.
package account
import (
	"bytes"
	"golang.org/x/crypto/ed25519"
	"golang.org/x/crypto/sha3"
	"github.com/bitmark-inc/bitmarkd/fault"
	"github.com/bitmark-inc/bitmarkd/util"
)
type PrivateKey struct {
	PrivateKeyInterface
}
type PrivateKeyInterface interface {
	Account() *Account
	KeyType() int
	PrivateKeyBytes() []byte
	Bytes() []byte
	String() string
	IsTesting() bool
	MarshalText() ([]byte, error)
}
type ED25519PrivateKey struct {
	Test       bool
	PrivateKey []byte
}
type NothingPrivateKey struct {
	Test       bool
	PrivateKey []byte
}