Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAsciiBaseDomain ¶
GetAsciiBaseDomain gets the ASCII base domain for a given string.
func VerifyDomainNameOwnership ¶
func VerifyDomainNameOwnership(ctx context.Context, owner *common.Account, domain string) (bool, error)
VerifyDomainNameOwnership verifies a public key owns a domain. It is the official DomainValidator implementation.
todo: this needs caching todo: improve testing so we don't have to go out to app.getcode.com
Types ¶
type BlockchainMessage ¶
type BlockchainMessage struct { Type BlockchainMessageType Version uint8 Flags uint32 SenderDomain string // Subdomains are allowed, but unused. There could be something there as a feature. ReceiverAccount *common.Account Nonce []byte EncryptedMessage []byte }
BlockchainMessage is an encrypted message, plus associated metadata, sent over the blockchain.
func DecodeBlockchainMessage ¶
func DecodeBlockchainMessage(payload []byte) (*BlockchainMessage, error)
DecodeBlockchainMessages attempts to decode a byte payload into a BlockchainMessage
func NewNaclBoxBlockchainMessage ¶
func NewNaclBoxBlockchainMessage( senderDomain string, plaintextMessage string, sender *common.Account, receiver *common.Account, ) (*BlockchainMessage, error)
NewNaclBoxBlockchainMessage returns a new BlockchainMessage using a NCAL box where the shared key is derived using ECDH.
func (*BlockchainMessage) Encode ¶
func (m *BlockchainMessage) Encode() ([]byte, error)
Encode encodes the BlockchainMessage into a format compatible with the Solana memo instruction.
type BlockchainMessageType ¶
type BlockchainMessageType uint8
const (
NaclBoxBlockchainMessage BlockchainMessageType = iota
)
type DomainVerifier ¶
DomainVerifier is a validation function to verify if a public key is owned by a domain. Implementations are not responsible for verifying the owner account via a signature, and must occur at the system requiring domain verification.