func byteSliceTox3dhPub(pub []byte) (x3dh.PublicKey, error) {
	var x3dhPub x3dh.PublicKey
	if len(pub) != 32 {
		return x3dhPub, errors.New("got invalid x3dh public key (must have 32 bytes length)")
	}
	copy(x3dhPub[:], pub[:])
	return x3dhPub, nil
}
convert a byte sequence to an x3dh public key
package chat
import (
	"encoding/hex"
	"errors"
	"time"
	"fmt"
	db "github.com/Bit-Nation/panthalassa/db"
	bpb "github.com/Bit-Nation/protobuffers"
	x3dh "github.com/Bit-Nation/x3dh"
	proto "github.com/golang/protobuf/proto"
	dr "github.com/tiabc/doubleratchet"
	ed25519 "golang.org/x/crypto/ed25519"
)