Beginner Plutus Questions

I learned so much in my Beginner Marlowe Meadow Questions threads (special thanks to @bobert & @adatainment), that I thought I should do the same for Plutus now that I am spending all my time there. Maybe it will be helpful to other beginners also.

As a raw beginner, I’ve made huge learning progress in Plutus by going over the Jelly Bean Guessing Game and Naive Lottery smart contract examples that @bobert put out: here and here. They were a little easier to dive into than the ones offered directly in Plutus Playground here.

I’m also finding that I make big breakthroughs in understanding the @bobert sample SCs as I continue noobishly learning more Haskell generally from resources like these: Learn You a Haskell and Learn Haskell in One Youtube Video.

One additional puzzle piece has been understanding the Plutus stuff I can find in the IOHK github like this:

https://github.com/input-output-hk/plutus/blob/master/wallet-api/tutorial/Tutorial.md, and
https://github.com/input-output-hk/plutus/blob/master/plutus-tx/src/Language/PlutusTx/Prelude.hs.

Now for a question. As far as those types of github files above, is there a good one to look at to understand the PlutusTx Builtins?

I found figure 13 in this Formal Specification Paper by Rebecca Valentine that covers Builtins. But I’m thinking there might be something more easily consumable in the github?

11 Likes

From what I understand the Builtins aren’t really supposed to be used by the end-user but are meant to be added to the PlutusTx Prelude (which is what a PR request I made got accepted for on the Plutus repo, to add the rest of the ByteString Builtins to the Prelude) so that there is a single unified interface. There isn’t any documentation on the Prelude as of yet (it still needs lots of work anyways), but you can read the source to see what is available and then google the haskell equivalent functions to figure out what is going on: https://github.com/input-output-hk/plutus/blob/master/plutus-tx/src/Language/PlutusTx/Prelude.hs

Otherwise in the near future (span of a couple weeks) I will be releasing a lot more educational Plutus content so stay tuned :ok_hand:

9 Likes

@bobert Massive thanks for the info on the Builtins. I’ll work through the Prelude and the Haskell equivalent functions.

Will look forward to what you put out next.

3 Likes

Yesterday, I posted an idea for a DApp in the DApp idea thread. It would be a Simple Resource Allocation Voting Contract that would allow for this:

  1. funds are locked in the SC,
  2. users offer various options,
  3. users vote on the various options,
  4. votes are tallied, and
  5. funds go to the address that offered the winning option.

It’s not really something I would particularly want to use, or even see in use necessarily…I still remember the DAO recursive call attack. But, I thought it would be a good way to better understand voting mechanics.

Instead of waiting for someone to show me how to do it, I thought I would just take a stab at it as a learning project.

Obviously, I’m a raw beginner at coding and this thing is riddled with conceptual and technical mistakes. But, if anyone wants to take a peek at it and give me some pointers, that would be awesome:

4 Likes

Howdy!

Looking to learn some Plutus. Checked out the eBook, started the Udemy course etc… All sources warn that the content is out of date and to use caution. With that in mind, should I hold off learning until the next revision comes out or will it be small changes that won’t affect the majority of what I would learn if I take the time to go through all the training now? If it is recommended to wait a bit, any thoughts or guesses as to an approximate timeline before updated materials become available? If there does happen to be an up to date resource available that I just haven’t found yet please do point me in that direction. Much appreciated!

Thanks!

Hi Mark. Probably best to wait for a bit. There will be a bit more information about timelines at the Cardano Virtual Summit.

1 Like

Sorry @mraybin for this delayed answer. Like @michaelpj indicated there were (and still are) quite a few changes to the resources. At the moment I think the best way to start the journey is the testnet sites. You will find all relevant links there, make sure to try out the playgrounds as well as the new videos from the Virtual Summit early July:

If you really want to learn something right now, in my eyes it still makes sense to dig into the old resources that you mentioned, and of course Haskell in general, so I’m posting this for visibility:

A great resource to start for people that did programming in the past is the Haskell book: http://learnyouahaskell.com/introduction#about-this-tutorial

Plutus book: https://leanpub.com/plutus-smart-contracts

The outdated free Udemy course for Marlowe: (domain-specific language on top of Plutus, but the course brings you closer to many concepts)

The outdated one for Plutus:

3 Likes

Thanks @adatainment! I actually did start the Udemy Plutus course but there were enough differences between what was being displayed vs what was in the playground that I jumped to the http://learnyouahaskell.com/introduction#about-this-tutorial . I’ve been playing around with that for the past few weeks. It’s pretty easy to follow.

1 Like

I cannot guarantee anything, but I would expect these documentations and courses to be delivered soon. http://learnyouahaskell.com is indeed a lovely and in some way entertaining resource to learn Haskell.

Hi mate I see you classing yourself as a raw beginner back in Jan 19. I would just like to ask did you have any programming experience before starting this and also how are you getting on now which is 2 years on from this post? Thanks.

Hi BigDug,

I would say that I am definitely not any kind of model student as far as learning Plutus or coding in general goes. But, I am happy to describe my mediocre progress over the last few years. Hahahaha

I think prior to starting in on Marlowe and Plutus, I had only done the Khan Academy javascript course and played around in some solidity learning tools like Crypto Zombies. Then, I went through the two Udemy courses above, a course that Bobert (above) put out, and the IOHK ebook on Plutus.

That all just convinced me that I needed to invest some time into Haskell. I started with the “Learn You a Haskell” website and a few (really long) youtube videos. I didn’t make much progress there. So, I launched into “Haskell Programming from First Principles”. That is the book that Charles is always recommending. I bought the 1257 page ebook.

I’ve just been hacking away at it in my free time. I read every single paragraph, do every single exercise (there are a lot of them), and actually execute the exercises in ghci. I think I’ve gone through about 350 pages like that. I’ve definitely had to take some really long breaks from that book due to time commitments. But, over the last two months, I really put a lot of effort into starting over at page 1 and getting all the way to page 350.

I’ve definitely learned a lot about Haskell, functional programming, and coding in general. As a result, Plutus makes a lot more sense. For the first time, I can now write code in Haskell to accomplish some basic tasks. Given some not-too-advanced Haskell code, I can often figure out what’s going on if I can go back to old chapters in the book and review those concepts. I sort of have a basic grasp that allows me to slowly figure non-advanced stuff out if I have access to a textbook. But, I still totally suck compared to even the lowliest of proficient Haskell programmers.

Right now I’m going back and re-reading the IOHK Plutus book and also watching the ADA Makerspace youtube channels to try to re-engage in Plutus with my new basic knowledge of Haskell. We’ll see how that goes. I’m sure it will just show me that I need to go back and finish the other 900 pages of the big Haskell book. Hahaha.

1 Like

Hi JBlock,

Thanks for getting back in touch. Interesting to read you views on this. I have also done some JS and Solidity through Ivan on Tech but am getting drawn more and more into the Cardano world. Also thank for a list of resources to use. Do you think that this is possible to become a smart contracts developer as I am struggling to find any real sources on this and do you know if you needs to know any web development like React as is needed for Solidity?

I think it’s totally possible to become a Cardano smart contract developer from the starting point of guys like you and I. Not at all easy…but possible. I like that since it seems like the most valuable things always require the most work to achieve. Dan Gable said: “You only deserve what you earn.”

I think if someone put 8 hours per day into it, they could get there surprisingly fast. If someone was working full time at their real job but putting in two hours every night, I think it would also be surprising how fast they could get there. Maybe I’m an optimist. But, these languages and systems were written by humans who just put in the time. I also think any human of above average intelligence could learn them with a little time.

I’m only 350/1257 pages through that gigantic Haskell book, and I already feel like I have the beginnings of most of the basic tools I need to begin coding smart contracts in Plutus. I definitely wouldn’t be a great (or even good) smart contract developer. But, I feel like I have already worked on a lot of the basics tools I’ll need. The pieces I’m still extremely blurry on are mainly the blockchain specific pieces of Plutus that aren’t already a part of Haskell. Again, not trying to oversell my very meager skillset or understanding. I’m just happy about the progress I’ve made compared to a few years ago.

On yesterday’s AMA, Charles indicated that Lars Brunjes is going to run something like a 500 person class for 4-6 weeks to turn out a cadre of Plutus developers. It sounds like we’ll have to apply to get in to that program and that it will be pretty strenuous. I’m not even sure if they’ll allow people like you and I with no programming background. But, that might be interesting.

Your question about the front end user side is a really good one. Others probably know way more about that than me. But, the question I have been asking myself for the last few years is this: “What will fill the role of the metamask of the Cardano ecosystem?”. Will it be something built inside Daedalus and Yoroi or a completely separate browser extension/app/dApp/or etc? I think it was on the last Cardano 360 show that I heard something that made me believe that Sebastian and those guys at Emurgo may be working on something that will fit this role right now.

But, I almost feel like I need to know the answer to that question before I even start thinking about the front end user stuff. Maybe everyone else already knows and I’m just in the dark. Hahahaha.

Definitely take anything I say with a grain of salt. But, I’m also very interested in the questions you are exploring.

Maybe we’ll get lucky and someone in the know will pitch in here with some good info.

2 Likes

Thanks once again. Yes hopefully someone would comment and fill in the blanks as that would be really useful. Best of luck mate.

Good luck to you too!