Create a new PublicKey object
ed25519 public key as bytes or base-58 encoded string
StaticdefaultDefault public key value. The base58-encoded string representation is all ones (as seen below) The underlying number is 32 bytes that are all zeros
The base-58 representation of the public key as a Kit Address branded
string. Satisfies Kit's
HasAddress
interface so a PublicKey can be passed anywhere Kit accepts an
address-bearing object.
Borsh-compatible encoding (little-endian)
Return the base-58 representation of the public key as a Kit Address
branded string, suitable for passing to @solana/kit APIs or generated
program clients that expect an Address.
Return the byte array representation of the public key in big endian
Return the base-58 representation of the public key
StaticcreateDerive a program address from seeds and a program ID.
SolanaError with
SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED from
@solana/errors if crypto.subtle.digest() is unavailable.
SolanaError with
SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED from
@solana/errors if the supplied seeds exceed the PDA count limit.
StaticcreateDerive a public key from another key, a seed, and a program ID. The program ID will also serve as the owner of the public key, giving it permission to write data to the account.
StaticdecodeBorsh-compatible decoding (little-endian)
StaticdecodeBorsh-compatible unchecked decoding (little-endian)
StaticfindFind a valid program address
Valid program addresses must fall off the ed25519 curve. This function iterates a nonce until it finds one that when combined with the seeds results in a valid program address.
SolanaError with
SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED from
@solana/errors if the supplied seeds exceed the PDA count limit.
StaticisCheck that a pubkey is on the ed25519 curve.
A Solana address