---
title: "Discussion on \"BUIDL a Solana Program - Explained for a Web2 Dev\" | Hashnode"
description: "Discussion on \"BUIDL a Solana Program - Explained for a Web2 Dev\". How to build a Solana Program, simply explained to blockchain beginners, code and example included."
url: "https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [BUIDL a Solana Program - Explained for a Web2 Dev](https://blog.developerdao.com/buidl-a-solana-program-explained-for-a-web2-dev?utm_source=hashnode&utm_medium=feed)

How to build a Solana Program, simply explained to blockchain beginners, code and example included.

Mar 15, 2022 · 20 min read · blog.developerdao.com  
Updated Jun 23, 2023  
Read the article

-   [#solana](https://hashnode.com/tag/solana)
-   [#blockchain](https://hashnode.com/tag/blockchain)
-   [#web3](https://hashnode.com/tag/web3)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[mwrites](https://hashnode.com/@mwrites)

@mwrites · The Matrix

  
[View profile](https://hashnode.com/@mwrites)

## Responses 5

Markdown supported · ⌘↵ to post

[Hamza Sajid](https://hashnode.com/@HamzaSajid)

[Apr 1, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/6246cf2fc794c505604c2caf)

Program Result not found in scope anyone can guide me?

[mwrites](https://hashnode.com/@mwrites)

[Apr 1, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/6246cf2fc794c505604c2caf#reply-6246cfbbc794c505604c2ccb)

I think, that is related to the new anchor version: try replacing ProgramResult by Result<()>

[Alexandre Mignon](https://hashnode.com/@AlexMGN)

[Mar 22, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/623926e05df27d5ca212f801)

So I'm surprised by this tutorial. In principle, it works. Thanks to your tutorial I managed to create a site where people can pay ( :') ) to send jokes.

Today I am 24 hours after the realization of your tutorial to try to go further and I realize that I am still not able to fly of my own wings on Solana. So you'll tell me that it's normal and that you have to make tutorials, but what worries me is that I've already made several haha.

So in fact, I said to myself: "Look, it's cool, we can send our message. Oops I was wrong. I would like to delete it". So I challenged myself to add what is necessary to the program to be able to delete it. But blank page. I have no logic of what I should do.

Overall I have the tracks. Since each joke is an account, I have to close that account. And I thought ok, I have the account for this joke, I just have to send it to the program and that's it! (Thought of Web2 with a simple API) but actually not at all. I realize that I don't know how to think about a Smart Contract.

The different macros (and fortunately in this tutorial we don't need PDAs), when to take references (the problem comes from Rust and not from the tutorial, I've been cramming the Rust documentation for 3 days now), the use of context in the main function etc..

Solana gymnastics is not so obvious. And even if we understand that "everything is account" it doesn't unlock the ultimate logic.

The same goes for editing the message. Impossible to build the function.

It's terrible because I've understood a lot of things since I've been training in Solana:

-   Everything is account (In a Todo-list for example, the list is an account but each item inside is an account too)
-   It is necessary to have a Signer when a private key is needed (generating a paying transaction)
-   Roughly, a blockchain is like a DB, and a program is like an API (data processing, CRUD, ...)
-   PDAs are accounts without private keys linked to a program. This gives authority to the program.
-   Anchor is a framework allowing the development of Smart Contract on Solana, with multiple macros to simplify the writing of Rust
-   Web3 allows interaction with a program. The gymnastics is also new but is very close to Web2

And yet, despite all this, I am still unable to think about the logic of a smart contract. If I had to delete this project, I wouldn't be able to start it again (except maybe the use of anchor init :') )

[mwrites](https://hashnode.com/@mwrites)

[Mar 31, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/623926e05df27d5ca212f801#reply-6245fee716cdedfe9f7c9c13)

Salut Alexandre!

Sorry for the late reply, I was thinking for several days about how to answer this best. Since I am writing about Solana, this is actually the same question I am asking myself every day. I hope this answer will help you.

The fact that you cannot write anything from scratch is very very normal.

Why is that? You can't really start from scratch, because it is not a blank canvas 🖼. It's not a python or js script that you open and you start playing with variables, that would be just making rust code. When writing smart contracts in Ethereum or in Solana we are working with the platform we are targeting.

📱 Let's think about Android, iOS or MacOS, when you write a program for these platforms you need to understand how the platform works, otherwise you can't really achieve anything than printing logs. That is the same with Ethereum or Solana we are working on top of that platform so we need to understand how to work with it, how to talk with it.

The bullets points you mentioned are 🎯 to understand how to do the Solana gymnastic. If you understand these it means you are ready to take the next step!

So what is the next step? The next step is to keep learning how to discuss with Solana. It's about learning the platform system calls.

⚓️ The problem is Anchor, the difficulty here (and I am wondering myself if I will keep writing Anchor programs in the future) is that Anchor hides all these APIs. So it all feels very magic, and you have no ingredients to collect!

To start from scratch, you should know the building blocks of Solana. As you do tutorials you are supposed to collect the ingredients that will help you make new dishes (dapps) on your own. But Anchor is too magical and hide all of these ingredients (Solana system calls).

What now? You need to collect these ingredients and go further than Anchor:

-   You already know the most important ingredient which is accounts, without this you can't achieve anything.
-   You can collect more of these ingredients here: [solanacookbook.com](https://solanacookbook.com/)

Unfortunately, there is not a ton of references for these ingredients for now, the way I have been doing it is to look at interesting projects: [solana.com/ecosystem](https://solana.com/ecosystem)

Then find their github and understand how:

-   A Token Swap works.
-   A NFT works.
-   etc...

And by understanding how it works, I mean cut all the noise! 80% of the code is just noise, moving accounts around etc... The key is to find the solana system call that do the hard work:

-   Create Accounts (you already know this).
-   Create a token.
-   Transfer a token.
-   Mint / Burn.
-   Etc..

💪 Stay strong and keep building! Excited to see what you will do!

If you want to do more than just storing decentralized data and actually do something that can only be acheived with blockchains, you might want to take a look at my new article: [blog.matanwrites.com/solana-staking-program](https://blog.matanwrites.com/solana-staking-program)

[mwrites](https://hashnode.com/@mwrites)

[Mar 17, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/62337c13bef4c71aa6f0cea6)

**Installing Solana on M1:**

The build tools evolve quickly, on M1 you might run into an issue when using `solana-test-validator` or other obscure build issues later.

So, install and build Solana from source following the instructions of the [official doc](https://docs.solana.com/cli/install-solana-cli-tools#build-from-source) or [even the github](https://github.com/solana-labs/solana/blob/master/README.md#building) which is often more up to date.

[Huifeng Jiao](https://hashnode.com/@jhfnetboy)

[Mar 18, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/62337c13bef4c71aa6f0cea6#reply-62341c11bef4c71aa6f0d751)

OK, thank you for your reply. I will follow the links you reference. And later I will write an article to record my learning on Solana~

[Huifeng Jiao](https://hashnode.com/@jhfnetboy)

[Mar 16, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/6231f433dc2913039c754778)

Hi, my friend, kindly, I apply for reprinting your article on my Wechat channel, translating it into Chinese. I am a starter on Crypto dev, want to learn something about Solona.

Waiting for your answers.

[rathermercurial](https://hashnode.com/@rathermercurial)

[Mar 15, 2022](https://hashnode.com/posts/buidl-a-solana-program-explained-for-a-web2-dev/6230a8be1ea5cdf031552eb9/comment/6230ddae1ea5cdf031553477)

Solana _is_ Web 2.0
