Skip to content

A very basic PoC of how to embed Anchor IDLs inside program binaries on the Solana block chain

License

Notifications You must be signed in to change notification settings

abklabs/poc-idl-embedding

Repository files navigation

IDL Embedding Proof Of Concept

Introduction

This project shows a rough proof-of-concept of how to embed Anchor IDLs inside deployed programs on the Solana block chain. It uses new ELF sections to store additional meta-data about the program, as well as the Anchor IDL itself. The manifest serves as the root description for discovering other traits about the binary, that are outside the scope of the ELF standard.

This is part of a bigger solution we're building, but it demonstrates how we're starting to think about the problem of including more information inside deployed programs.

Future Considerations

  • Compressed sections using SHF_COMPRESSED rather than plain-text.
  • Better definition of the manifest structure (e.g. JSON schema).

Prerequisites

In order to try this demo, you need the following in your path:

Running The Demo

  1. Install npm packages i.e. pnpm install

  2. Run the build i.e. ./build

  3. Run a Solana test validator e.g. solana-test-validator

  4. Deploy the Anchor project i.e. (cd counter_anchor && anchor deploy)

  5. Run the demo e.g. ANCHOR_WALLET=$HOME/.config/solana/id.json npx tsx run.ts idpSeYFgfK6oheFdXciWNDZHmmDwuHvetG4gJWTwopX

You should see the Anchor program's IDL discovered from the binary in the validator, and instructions should be executed against it.

About

A very basic PoC of how to embed Anchor IDLs inside program binaries on the Solana block chain

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published