Skip to content

solana-program/program-metadata

Repository files navigation

Program Metadata

Attach custom data to any program.

Overview

The Program Metadata provides the ability to attach metadata information to any program. The information is represented by a PDA account with a pre-defined derivation, e.g., it can be used to add the IDL of a program, with a PDA derived using the "idl" string.

There are two types of metadata accounts:

  • canonical: these are metadata accounts created by the program upgrade authority. They are derived from [program key, seed].
  • non-canonical (a.k.a. third-party): these are metadata account created by any authority. They are derived from [program key, authority key, seed].

While there can only be a single canonical metadata account for a pair (program, seed), there can be any number of non-canonical metadata accounts. The rationale is to allow anyone to add additional metadata to any program, but also provide a mechanism to differentiate metadata information added by the program upgrade authority.

Building

To build the program locally, first install the required packages using:

pnpm install

and then run:

pnpm programs:build

Testing

The repository includes two types of tests: program tests and JS client tests.

To run the program tests:

pnpm programs:test

To run the JS tests:

pnpm clients:js:test

License

The code is licensed under the Apache License Version 2.0

About

Attach custom data to any program

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •