{"id":21917275,"url":"https://github.com/solana-developers/idl-program","last_synced_at":"2025-10-09T15:30:31.626Z","repository":{"id":265103902,"uuid":"894165931","full_name":"solana-developers/idl-program","owner":"solana-developers","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-09T17:30:58.000Z","size":407,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-12T21:03:39.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solana-developers.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-25T21:46:38.000Z","updated_at":"2025-06-09T17:31:02.000Z","dependencies_parsed_at":"2024-12-27T06:45:37.858Z","dependency_job_id":null,"html_url":"https://github.com/solana-developers/idl-program","commit_stats":null,"previous_names":["woody4618/idl-program","solana-developers/idl-program"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/solana-developers/idl-program","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fidl-program","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fidl-program/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fidl-program/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fidl-program/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solana-developers","download_url":"https://codeload.github.com/solana-developers/idl-program/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solana-developers%2Fidl-program/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001649,"owners_count":26083147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T19:29:28.345Z","updated_at":"2025-10-09T15:30:26.605Z","avatar_url":"https://github.com/solana-developers.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Program Metadata\n\nA program to store metadata and IDL for Solana programs.\n\n## Installation \u0026 Usage\n\nThere is no need to install the CLI you can just run it with npx:\n\n```bash\nnpx solana-program-metadata\n```\n\n### Commands\n\n#### IDL Commands\n\nUpload IDL from a JSON file. This will write the IDL compressed to the metadata account:\n\n```bash\nnpx solana-program-metadata idl upload \u003cfile\u003e \u003cprogram-id\u003e \\\n  [-k \u003ckeypair-path\u003e] \\\n  [-u \u003crpc-url\u003e] \\\n  [-p \u003cpriority-fees\u003e]\n```\n\nUpload IDL from URL. This will write a URL to a json file to the metadata account:\n\n```bash\nnpx solana-program-metadata idl upload-url \u003curl\u003e \u003cprogram-id\u003e \\\n  [-k \u003ckeypair-path\u003e] \\\n  [-u \u003crpc-url\u003e] \\\n  [-p \u003cpriority-fees\u003e]\n```\n\nDownload IDL to file:\n\n```bash\nnpx solana-program-metadata idl download \u003cprogram-id\u003e [output-file] \\\n  [-u \u003crpc-url\u003e]\n```\n\n#### Metadata Commands\n\nYou can also upload metadata for you program. This is the recommended format of the metadata json file. Similar to security.txt.\n\n```json\n{\n  \"name\": \"MyProgramName\",\n  \"logo\": \"https://upload.wikimedia.org/wikipedia/en/b/b9/Solana_logo.png\",\n  \"description\": \"Example program for meta data\",\n  \"notification\": \"On the first of january we will release a new version! Please update your SDKS!!!!\",\n  \"sdk\": \"https://github.com/solana-developers/js_sdk\",\n  \"project_url\": \"https://github.com/solana-developers/\",\n  \"contacts\": [\n    \"email:security@example.com\",\n    \"discord:MyProgram#1234\",\n    \"twitter:@MyProgram\"\n  ],\n  \"policy\": \"https://example.com/security-policy\",\n  \"preferred_languages\": [\"en\", \"de\"],\n  \"encryption\": \"https://example.com/pgp-key\",\n  \"source_code\": \"https://github.com/solana-developers/\",\n  \"source_release\": \"v0.1.0\",\n  \"source_revision\": \"abc123def456\",\n  \"auditors\": [\"Audit Firm A\", \"Security Researcher B\"],\n  \"acknowledgements\": \"https://example.com/security-acknowledgements\",\n  \"expiry\": \"2024-12-31\",\n  \"version\": \"0.1.0\"\n}\n```\n\nUpload metadata from JSON file:\n\n```bash\nnpx solana-program-metadata metadata upload \u003cfile\u003e \u003cprogram-id\u003e \\\n  [-k \u003ckeypair-path\u003e] \\\n  [-u \u003crpc-url\u003e] \\\n  [-p \u003cpriority-fees\u003e]\n```\n\nUpload metadata from URL:\n\n```bash\nnpx solana-program-metadata metadata upload-url \u003curl\u003e \u003cprogram-id\u003e \\\n  [-k \u003ckeypair-path\u003e] \\\n  [-u \u003crpc-url\u003e] \\\n  [-p \u003cpriority-fees\u003e]\n```\n\nDownload metadata to file:\n\n```bash\nnpx solana-program-metadata metadata download \u003cprogram-id\u003e [output-file] \\\n  [-u \u003crpc-url\u003e]\n```\n\n### Options\n\n- `-k, --keypair \u003cpath\u003e`: Path to keypair file (optional, defaults to local Solana config)\n\n* `-u, --url \u003cstring\u003e`: Custom RPC URL (optional)\n* `-ul, --url-local`: Use localhost RPC (default)\n* `-ud, --url-devnet`: Use Devnet RPC\n* `-um, --url-mainnet`: Use Mainnet RPC\n\n- `-p, --priority-fees \u003cnumber\u003e`: Priority fees per compute unit (optional, defaults to 100000)\n\n- `-a, --add-signer-seed`: Add signer's public key as additional seed. This will create not associated metadata which needs this seed to be found instead of just using the seeds \"idl\", \"metadata\" and the program id. (optional, defaults to false)\n\n### Examples\n\n```bash\n# Upload IDL using default keypair that is the program authority\nnpx solana-program-metadata idl upload ./target/idl/my_program.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A\n\n# Upload metadata with custom keypair to devnet\nnpx solana-program-metadata metadata upload ./metadata.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A \\\n  -k ./my-keypair.json \\\n  -ud\n\n# Upload metadata with non-associated PDA (using signer's pubkey as additional seed creating a non associated metadata account)\nnpx solana-program-metadata metadata upload-url https://example.com/metadata.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A \\\n  --add-signer-seed\n\n# Download associated metadata (default)\nnpx solana-program-metadata metadata download 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A ./my-metadata.json\n\n# Download non-associated metadata (requires signer's pubkey)\nnpx solana-program-metadata metadata download 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A ./my-metadata.json \\\n  -s tes5FTVnmJAeq2Nb1Uv15pqiRuPdCHmCSThVbUNfe37\n\nnpx solana-program-metadata idl upload tests/testidl.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A \\\n  -k tests/wallet2.json -ud\n\nnpx solana-program-metadata metadata upload tests/metadata.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A \\\n  -k tests/wallet2.json -ud\n\nnpx solana-program-metadata metadata upload-url https://raw.githubusercontent.com/solana-developers/idl-program/refs/heads/main/tests/metadata.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A \\\n  -k tests/wallet2.json -ud\n\n# Export transaction for multisig\nnpx solana-program-metadata metadata upload metadata.json \u003cPROGRAM_ID\u003e \\\n  -k \u003cKEYPAIR\u003e \\\n  --export-transaction\n\n```\n\n## JavaScript Usage\n\n```typescript\nawait uploadIdlUrl(url, programId, keypair, rpcUrl, priorityFees);\n```\n\nor\n\n```typescript\nawait uploadIdlByJsonPath(\n  pathToJsonFile,\n  programId,\n  keypair,\n  rpcUrl,\n  priorityFees\n);\n```\n\nThen you can retrieve the IDL or URL using:\n\n```typescript\nawait fetchIDL(programId, rpcUrl);\n```\n\nand the metadata using:\n\n```typescript\nawait fetchProgramMetadata(programId, rpcUrl);\n```\n\n### Non-Associated PDAs\n\nWhen using the `-a, --add-signer-seed` option, the program will add the signer's public key as an additional seed when deriving the PDA. This creates a non-associated PDA that is unique to that signer, allowing multiple metadata entries for the same program. Note that these can not easily be found anymore by just using the seeds \"idl\", \"metadata\" and the program id.\nThis can be useful though if there is some entity that wants to upload metadata for a program but does not have the authority to do so.\n\n## TODO\n\n- move upgrade authority to multisig and deploy program to mainnet\n- Add test case for bigger 10mb IDLs.\n- Write Web3js@2 cli using codama (generated client is already in the codama folder) (Good first issue)\n- validate URL parameters (e.g. no trailing slashes, starts with https:// etc.)\n\n## Done\n\n- add check for authority in program\n- add close account instruction\n- refactor to make the program more metadata instead of only IDL focused\n- Should we add a seed to IdlAccount?\n- Add Support for non canonical PDAs. Needed? Will make the program more complex.\n- Add URL support\n- Add programId to PDA seeds\n- Close Buffer account when done with it\n- Remove signer from the PDA seeds and use the program authority check in program instead!\n  - Now canonical IDL can actually be found by only the program id \\o/\n- Realloc when IDL becomes bigger or smaller than initially allocated\n- Move realloc into set buffer and combine with close buffer\n- Test case of \u003c 10240 bytes IDL\n- Enable tests for other ppl using a devnet program and hardcoded key for tests\n- Remove anchor dependency from JS\n- Add priority fees to transactions\n- Add support for any program meta data using a dynamic seed string instead of hardcoded \"idl\"\n- Add Test case for uploading program Logo meta data\n- Add delete authority instruction\n- Add change authority instruction\n- Create JS library and CLI\n- Create Rust CLI (assignee @wealthineer)\n- add metadata init command\n- local rpc url from solana config\n\n## Local development\n\nYou can test the cli commands like this:\n\n```bash\nnpm run cli -- idl upload ../tests/testidl.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A  -k \"../tests/wallet2.json\"\n\nnpm run cli -- metadata upload ../tests/metadata.json 6XzaKuAwqP7Nn37vwRdUqpuzNX6K8s1ADE6tHXSZG17A  -k \"../tests/wallet2.json\"\n```\n\nRun tests\n\n```bash\nanchor test --detach\n```\n\nLike this you will be able to work locally without deploying the program to the network.\n\n\n## Changelog\n\n### 1.1.0 (2024-12-20)\n\n#### Added\n- New CLI Commands\n  - `list-pdas`: View all metadata PDAs controlled by your authority\n  - `list-buffers`: View all buffer accounts controlled by your authority\n  - `close-buffer`: Recover rent from buffer accounts\n  - `close-pda`: Close metadata PDA accounts and recover rent\n- Multisig Support\n  - Added `--export-transaction` flag for Squads integration\n  - Returns base58 and base64 encoded transactions for multisig execution\n\n#### Improved\n- Account Structure\n  - Separated `MetadataBuffer` from `MetadataAccount2` for better type safety\n  - Added program ID to buffer accounts for better tracking\n- CLI Output\n  - Enhanced listing displays with program ID, data length, and data type\n  - Better formatted console output\n- Error Handling\n  - More descriptive error messages\n  - Better validation of inputs\n\n#### Technical\n- Refactored account listing logic into reusable functions\n- Improved TypeScript type definitions\n- Better code organization and maintainability\n\n### 1.0.0\nInitial release\n- Basic metadata and IDL storage functionality\n- CLI interface for managing program metadata\n- Support for JSON and URL-based uploads\n\n- **Breaking**: Changed metadata account structure. Users must:\n  1. Close existing metadata accounts using `close1` instruction\n  2. Create new metadata accounts with updated structure\n  3. Seed derivation changed to have the dynamic seed at the end for security reasons\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolana-developers%2Fidl-program","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolana-developers%2Fidl-program","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolana-developers%2Fidl-program/lists"}