2

I see for the moment two way to write solana program the first one using the solana_program crate only following the structure dictate on the solana doc and the second using anchor, Im wondering what are the benefits writing solana program using only the solana_program crate ?

1 Answer 1

1

This is a question of opinion, but the main difference is that Anchor is a framework. A framework will do a lot of things for you, but not let you do everything as a result. Here are a few random pros for each:

Anchor:

  • defines an IDL consumable by any client
  • adds safety checks for free
  • reduces boilerplate

Non-anchor:

  • use any serialization format
  • not restricted by any account checks
  • reduce compute usage by doing anything you need, e.g. selectively serializing back into accounts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.