func KeyOwner(address sdk.AccAddress, denomID, tokenID string) []byte {
	key := append(PrefixOwners, delimiter...)
	if address != nil {
		key = append(key, []byte(address.String())...)
		key = append(key, delimiter...)
	}
	if address != nil && len(denomID) > 0 {
		key = append(key, []byte(denomID)...)
		key = append(key, delimiter...)
	}
	if address != nil && len(denomID) > 0 && len(tokenID) > 0 {
		key = append(key, []byte(tokenID)...)
	}
	return key
}
KeyOwner gets the key of a collection owned by an account address
package types
import (
	"bytes"
	"errors"
	sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
	ModuleName = "nft"
	StoreKey = ModuleName
	QuerierRoute = ModuleName
	RouterKey = ModuleName
)
var (
	PrefixNFT        = []byte{0x01}
	PrefixOwners     = []byte{0x02}  
	PrefixCollection = []byte{0x03}  
	PrefixDenom      = []byte{0x04}  
	PrefixDenomName  = []byte{0x05}  
	delimiter = []byte("/")
)
func SplitKeyOwner(key []byte) (address sdk.AccAddress, denomID, tokenID string, err error) {
	key = key[len(PrefixOwners)+len(delimiter):]
	keys := bytes.Split(key, delimiter)
	if len(keys) != 3 {
		return address, denomID, tokenID, errors.New("wrong KeyOwner")
	}
	address, _ = sdk.AccAddressFromBech32(string(keys[0]))
	denomID = string(keys[1])
	tokenID = string(keys[2])
	return
}
func SplitKeyDenom(key []byte) (denomID, tokenID string, err error) {
	keys := bytes.Split(key, delimiter)
	if len(keys) != 2 {
		return denomID, tokenID, errors.New("wrong KeyOwner")
	}
	denomID = string(keys[0])
	tokenID = string(keys[1])
	return
}