0

Are all programs displayed in plain text?

If so, is there a way to obfuscate them so that others are not able to see the contents of the program?

5
  • 1
    Does this answer your question? Is there anything that prevents popular programs from being cloned hundreds of times by copycats?
    – Henry E
    Commented Jul 23, 2022 at 19:49
  • Have you asked the same question 4 times now?
    – sohrab
    Commented Jul 24, 2022 at 3:33
  • @sohrab - Please see where trent.sol told me, "this question is three questions. please make it three posts" after solana.stackexchange.com/questions/590/… was closed, so I followed his guidance.
    – OCDev
    Commented Jul 24, 2022 at 3:50
  • @HenryE - According to the community, it is not the same question, which is why the original was closed for not being focused. Please see my comment immediately above. I was asked to create them as separate questions.
    – OCDev
    Commented Jul 24, 2022 at 4:36
  • What has your researched led you to conclude? Most anything can be "displayed in plain text" - I don't think that is what you mean. Are you trying to ask if the source code of any Solana program account can be parsed like an open-source project publicly available on GitHub?
    – MmmHmm
    Commented Jul 25, 2022 at 23:08

2 Answers 2

4

Programs are stored by default as BPF bytecode on-chain. This in itself is not entirely readable. You can get these program's bytecode with:

Solana program dump -um <program_address> program.so

There are some ways to find a program's source though if it is Anchor-verified. If Anchor-verified, you should be able to find the source on the anchor program registry

2

You can always obfuscate your code but that will increase the cost of executing your programs' instructions. Your program is stored as bytecode on the solana blockchain that itself can be quite difficult to understand.

In the end it's a cat and mouse game.

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