Here at the Solana.Blog and at the Solhackers community, we pride ourselves on helping each other BUIDL cool shit on the Solana ecosystem! It is with great pleasure to introduce Fruity Pineapple Dude/Dev, a developer who shed sweat and tears in the Solana Hackathon team Hiro LaunchDAO. This is his community guest post, please share the love on twitter or comment below!
The Solana Hackathon was nowhere near my first encounter with blockchain from a developer perspective. I have worked as a Python developer the past three years and I am pursuing a bachelors in electrical engineering and information technology. I also have around three years of experience with Solidity and I’ve written many smart contracts for EVM based blockchains (Ethereum, BSC, etc.) as a hobby/side hustle. I was learning Rust (the language for Solana smart contracts) for almost a month prior to the Hackathon but it was my first time learning a low-level programing language. Thus, I only had a very basic understanding of Rust at the beginning of the Hackathon.
Crypto is my passion (and 90% of my net worth). I always look out for new Layer 1 Blockchains but out of laziness I’ve never bothered to build a smart contract on non-EVM based blockchain. At least, not until I read about Solana.
Solana quickly became my favorite blockchain from a technical perspective and I was beyond happy to see the hype Solana gained this year. Of course, I do believe in a multichain future, but I personally see no point in building on a Blockchain nobody ever uses or even knows about. So I pulled the trigger and wrote a message in the Solana Discord saying that I’m looking for team to join for the Hackathon. I explicitly mentioned that I had zero experience with building on Solana; because I didn’t want to bother teams who were looking for an experienced Solana Developer. I hadn’t signed up for the Airtable where most teams were looking for Devs.
Regardless, I did receive messages from teams looking for a dev in the first day and a few more messages the days after. Many of the projects who contacted me already had a pretty big community. Some even had investors. I had calls with most of them and was split for choice because many great projects wanted to work with me. Most offered a payment in form of their tokens. One (maybe two) offered to pay me in fiat instead. In the end I have decided to join the HIRO LaunchDAO team.
There’s a massive demand for developers who want to build on Solana. Big investors are quietly watching the progress of the Solana ecosystem closely and looking for projects to invest in. If you are interested in building on Solana but have no clue what to build, don’t worry. There are many projects with great ideas looking for Devs to join them. If you are like me and also feel the Solana Summer coming, then the best time to start building is now.
Even if you end up not liking Solana (which I highly doubt), knowing Rust is another valuable Skill and if you already work as a software developer or want to purse a career as a developer, you won’t regret learning Rust. According to Stackoverflow, Rust is not only the most loved language, Rust developers also receive among the highest salaries in the industry. Some of the biggest companies in the world like Google or Microsoft use Rust and it will be used in the Linux kernel. This means if you are new to Rust and Solana you will learn two future-proof skills at the same time.
“HIRO is a LaunchDAO that provides crowdfunded financial and strategic investment in startups”– Droo (a great team member, co-founder, and friend of mine).
HIRO can be viewed as decentralized VC fund or a launchpad with a decentralized project selection. The core of Hiro is a meritocratic DAO which makes investment decision. Those DAO participants will basically manage the money of users who deposit into a pool. We quickly agreed that we don’t have the time to finish our product during the Hackathon so we decided to use the 3 weeks to develop an MVP (Minimum Viable Product) with the following features:
- USDC pool (“War Chest”): Users can deposit USDC and get back pool tokens which represent their stake in the pool. They are able to trade back their pool tokens at any time.
- Reputation System: A score (“REP”) assigned to each DAO participant which show how qualified the person is to make decisions. Good decisions increase the score, bad decisions decrease it. (I’ll ignore the logic behind that, all you need to know is that you pay for a DAO vote in REP and receive back more REP if you voted in favor of the correct majority)
- Team application: Teams can apply to get funded by HIRO. They have to submit how much money they need and how many tokens we get in exchange.
- DAO: Voting power depends on the Reputation score, not on how many HIRO tokens someone holds. For now, the DAO can only vote “yes” or “no” for teams who requested funding. If the DAO decides to fund a project, USDC will be transferred from the War Chest to the team.
At beginning there was only the vision. We had many meetings, and did a lot of wireframing. We had to ditch many ideas because they were not technical feasible.
In the end we managed to complete the MVP in the time we got! Something I didn’t expected at the beginning. We were two Devs working on the Solana programs (that’s how smart contracts are called on Solana). I think its impressive what we two achieved in only three weeks without previous Solana experience. Just imagine fast you will be able to write meaningful programs once you gained some experience!
I started with the official Solana Docs. They are ok to look things up, but are nothing I would recommend to start with. Luckily, I found a really good tutorial by PaulX in the official Hackathon resources, which explained the concepts how Solana and Solana programs work and went step by step through the code of an escrow program. It only took me a few minutes of reading the tutorial to realize that what I plan to do will be different from what I’m used to do. Take a look at the picture below. That’s the flow of a program and we have to code all this stuff ourselves. Solana is not like Ethereum where you write a function which than can be directly called.
Not gonna lie, I was a bit confused at first but also very enthusiastic.
It took me a few hours to finish the tutorial but after that I finally had a basic understanding of how to build a program. I was almost ready to start coding but in order to get a better understanding of more complex concepts I decided to take a look at the solana-program-library, a Github repository which contains many example programs written by the Solana team. I picked the token-swap program and analyzed its code. It’s a Uniswap like AMM which also features liquidity pools. I picked it in hope to find out how to implement the War Chest which I did.
I finally started working on the MVP. At this point I already felt quite comfortable coding on my own but I ran into problems from time to time. The Developer support in the Solana Discord is pretty active and plenty of the asked questions received an answer. Many people from the Solana contributor team did a good job during the Hackathon but I want to give special thanks to Chase, Starry and Trent who helped us developers out the most (in my opinion).
It was very time intensive to get started and there a few recommendations I want to give to everyone who wants to start building on Solana.
I wish I would have learned about Anchor earlier. It’s a framework which make a lot of things easier for developers, especially for the ones who are used to Solidity. Its safes a lot of time when it comes to building the client.
There’s another active Solana developer community, beside the official Discord, called Solhack. They have a well-organized Discord Server where resources get shared and questions get answered in addition to their website which features some useful courses. The Solhack Discord server seems more beginner friendly than the official Solana one.
Don’t worry too much about your Rust. It’s one of the more complicated languages but you only need a very basic understanding of Rust in order to get started. I do would recommend to read “Rust by Example” before you start but if you just want to start writing your Solana program, get familiar with the syntax, the memory management and head over to the Solana part.
Don’t underestimate the time it will take to get started. You probably won’t learn how write a complex Solana program on a weekend especially if you have never worked in Rust or with blockchains before. It took me a week just to get started. I view the entry barrier is pretty high. This is not only due to the fact that building on Solana is quite complicated, but also to a large extent due to the lack of guides and the poor docs. Fortunately, the letter is changing at a rapid speed.
Many of my developer friends clown me for this but I use Windows. This can lead to many problems when working with Solana. I would recommend to simply use Linux. I made the mistake to install the WSL on the same drive as Windows which lead to a few easily avoidable errors.
We had a hard time figuring out how to do the REP system. If you want to assign a value to a user’s address, it common practice in Solidity to use mapping. Rust supports hash maps but we were unsure how to use them since there’s a limited amount of data each account can store and want to be scalable. I tried out a few things and realized that HashMap doesn’t work how I expected. I didn’t bother looking how to use them correctly for Solana because it’s much easier to simply have a user account for each user which will store the REP score. Understanding how to store data in an account is one of the most important things to write Solana programs. It’s also easy to do this so better ditch the idea of using mapping for everything. By the way, every program can access the REP score of a user if it knows how to unpack the data stored in the user account.
Every blockchain comes with different possibilities and limitations. It’s important to keep those limitations in mind while developing a smart contract. Solana is fast and cheap so transaction fees can be ignored. That’s what everyone loves about Solana and it opens many opportunities. The two main limitation on Solana are the data an account can store and the computing limit for each transaction. I ran out of computing power once because of a bad design choice I made. It’s not hard to work around those limitation once you got used to them but make sure you don’t forget about them.
The beginning was hard but I overall I had a lot of fun during the Hackathon and I’ll continue building on Solana. The more I work on Solana the more I love it. It was challenging to write my first Solana program but also very rewarding once I was able to interact with it and let my program interact with other programs I wrote. It feels great to early enough to actually have impact and I think it’s crazy to see that few lines of code can make something possible that was unthinkable 20 years ago– or even three years ago with Ethereum.