func AccountFromBase58(accountBase58Encoded string) (*Account, error) {
	accountDecoded := util.FromBase58(accountBase58Encoded)
	if 0 == len(accountDecoded) {
		return nil, fault.CannotDecodeAccount
	}
	keyVariant, keyVariantLength := util.FromVarint64(accountDecoded)
	if 0 == keyVariantLength || keyVariant&publicKeyCode != publicKeyCode {
		return nil, fault.NotPublicKey
	}
	keyAlgorithm := keyVariant >> algorithmShift
	if keyAlgorithm >= algorithmLimit {
		return nil, fault.InvalidKeyType
	}
	isTest := 0 != keyVariant&testKeyCode
	keyLength := len(accountDecoded) - keyVariantLength - checksumLength
	if keyLength <= 0 {
		return nil, fault.InvalidKeyLength
	}
	checksumStart := len(accountDecoded) - checksumLength
	checksum := sha3.Sum256(accountDecoded[:checksumStart])
	if !bytes.Equal(checksum[:checksumLength], accountDecoded[checksumStart:]) {
		return nil, fault.ChecksumMismatch
	}
	switch keyAlgorithm {
	case ED25519:
		if keyLength != ed25519.PublicKeySize {
			return nil, fault.InvalidKeyLength
		}
		publicKey := accountDecoded[keyVariantLength:checksumStart]
		account := &Account{
			AccountInterface: &ED25519Account{
				Test:      isTest,
				PublicKey: publicKey,
			},
		}
		return account, nil
	case Nothing:
		if 2 != keyLength {
			return nil, fault.InvalidKeyLength
		}
		publicKey := accountDecoded[keyVariantLength:checksumStart]
		account := &Account{
			AccountInterface: &NothingAccount{
				Test:      isTest,
				PublicKey: publicKey,
			},
		}
		return account, nil
	default:
		return nil, fault.InvalidKeyType
	}
}
AccountFromBase58 - this converts a Base58 encoded string and returns an account

one of the specific account types are returned using the base "AccountInterface"
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"
)
const (
	Nothing = iota  
	ED25519 = iota
	algorithmLimit = iota
)
const checksumLength = 4
const (
	publicKeyCode = 0x01  
	testKeyCode   = 0x02  
	_             = 0x04  
	_             = 0x08  
)
const algorithmShift = 4
type Account struct {
	AccountInterface
}
type AccountInterface interface {
	KeyType() int
	PublicKeyBytes() []byte
	CheckSignature(message []byte, signature Signature) error
	Bytes() []byte
	String() string
	MarshalText() ([]byte, error)
	IsTesting() bool
	IsZero() bool
}
type ED25519Account struct {
	Test      bool
	PublicKey []byte
}
type NothingAccount struct {
	Test      bool
	PublicKey []byte
}