Are all programs plainly visible within the blockchain? Is there a way to prevent that when writing your program to protect the investment of development effort? If not, what would keep a popular program from being quickly cloned hundreds of times by copycats?
-
2this question is three questions. please make it three posts– trent.solCommented Jul 22, 2022 at 4:41
-
Thank you for the good suggestion. I have created the 3 separate questions to replace this one: 1. solana.stackexchange.com/questions/685/… 2. solana.stackexchange.com/questions/686/… 3. solana.stackexchange.com/questions/687/…– OCDevCommented Jul 24, 2022 at 4:21
1 Answer
Are all programs plainly visible within the blockchain?
Yes. If a program is deployed, it is visible (e.g. on an explorer) and can be downloaded by anyone, and then re-deployed. For instance, solana -u m program dump JUP2jxvXaqu7NQY1GmNF4m1vodw12LVXYxbFL2uJvfo jup.so
will let you download the Jupiter Aggregator binary, which you can then re-deploy if you wish and have 8 SOL to spare.
Is there a way to prevent that when writing your program to protect the investment of development effort?
Well it's already in binary form so it's already "obfuscated" to some extent. Of course people with the right experience and tooling can glean significant info on the logic behind, even then. Unsure if there is anything worthwhile that can be done additionally in terms of obfuscation.
If not, what would keep a popular program from being quickly cloned hundreds of times by copycats?
The effort required to reverse-engineer the logic, which varies drastically depending on factors such as:
- is the project OS
- are detailed docs available
- is a SDK available
- is the program logic complex
- does the program require off-chain dependencies (e.g. cranks)
Any potentially valuable project should consider the logic/codebase as copyable, and dedicate focus to establishing moats separate from the codebase or yes, copycats might eat the cake after you've baked it.