<p>You can start with cloning <a href="https://github.com/input-output-hk/plutus-starter" rel="nofollow noreferrer">https://github.com/input-output-hk/plutus-starter</a></p>
<p>and follow the readme in that repo</p>

CC BY-SA 4.0
2023-03-18T02:26:40.243Z
2023-03-18T02:26:40.243Z
Erwin Kurnia
<p>Since this question was posted Plutus-alternatives have been developed by the community that allow doing DApp development in JavaScript only. One such library is <a href="https://github.com/hyperion-bt/Helios" rel="nofollow noreferrer">https://github.com/hyperion-bt/Helios</a></p>
<p><a href="https://www.hyperion-bt.org/Helios-Book/api/picoswap/index.html" rel="nofollow noreferrer">https://www.hyperion-bt.org/Helios-Book/api/picoswap/index.html</a> is a step-by-step guide on how to implement a simple marketplace. The example code can be found <a href="https://github.com/hyperion-bt/PicoSwap" rel="nofollow noreferrer">here</a>, and a demo is hosted <a href="https://www.hyperion-bt.org/PicoSwap" rel="nofollow noreferrer">here</a></p>

CC BY-SA 4.0
2022-11-28T04:03:18.667Z
Helios seems very interesting, although my confidence in the project decline the second I saw they chose to build `Helios` in JavaScript.
CoderMan
CC BY-SA 4.0
2022-11-28T06:55:50.907Z
There isn't really an alternative for javascript if you want to build pure client-side DApps
Christian Schmitz
CC BY-SA 4.0
2023-02-09T00:43:57.597Z
The fact that the Helios compiler uses javascript to compile to plutus untyped core is a huge advantage and allows for the dynamic compiling to plutus core on any architecture that supports javascript  (browser, mobile devices, etc).   The helios language itself is a functional programming language, so you get all the benefits of a strongly typed functional programming language for writing your smart contracts, but you can compile it almost anywhere.
lley154
CC BY-SA 4.0
2023-04-09T16:32:41.877Z
doesn't answer the question
zing
CC BY-SA 4.0
2023-04-10T01:13:45.423Z
People who are struggling with Plutus should know there are easier alternatives
Christian Schmitz
CC BY-SA 4.0
2022-11-28T02:05:47.970Z
2022-11-28T02:05:47.970Z
Christian Schmitz
<p>A well formatted question deserves a well formatted answer! I will go into some depths, but also keep some things at a “magical” level. This is a long read so take your time!</p>
<p>Before we start, it is good to note that most of the Cardano stack is written in Haskell, and thus, managing a Plutus project is just managing a Haskell project. There are multiple ways of doing this, just a plain Cabal project or one of the many Nix ways of building (cabal2nix, Haskell.nix and many others). Now there are good reason to use these Nixs ways (most notably reproducibility and caching), but in this answer I will focus on a more understandable way of just using GHC + cabal on Ubuntu 22.04 (not the minimal install).</p>
<p>A disclaimer, building everything yourself requires lots of ram (you can also re-run the <code>cabal run</code> command if you run out of memory mid-process). The good thing, however, once build you have these Haskell artifact locally prebuilt in your <code>~/.cabal/</code> folder.</p>
<p><strong>The dependencies</strong></p>
<p>Before we can even build a general all-purpose Haskell/plutus project, we need some basic building tools necessary to even start compiling! These mainly consist of the following tools,</p>
<ul>
<li>OS dependent dependencies</li>
<li>GHC and Cabal</li>
<li>A special version of libsodium</li>
<li>A special version of libsecp256k1</li>
</ul>
<p><strong>OS dependent dependencies</strong></p>
<p>To build everything, you at least need these dependencies</p>
<pre class="lang-bash prettyprint-override"><code>sudo apt-get update -y &amp;&amp; sudo apt-get upgrade -y
sudo apt-get install automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 curl libtool postgresql libpq-dev autoconf -y
</code></pre>
<p>Note that translating these OS dependent dependencies to other operating systems is hard and out of the scope of this post (this is why you might want nix). They may also change in the future as the project might add new dependencies.</p>
<p><strong>GHC and Cabal</strong></p>
<p>It is recommended by IOG to use GHC version 8.10.7 and Cabal version 3.6.2.0. These can be installed via GHCUP via,</p>
<pre class="lang-bash prettyprint-override"><code>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
</code></pre>
<p>You can press <em>enter</em> for all question the installer asks. Then reload your terminal (to make <code>ghcup</code> appear in your path) and,</p>
<pre class="lang-bash prettyprint-override"><code>ghcup install ghc 8.10.7
ghcup set ghc 8.10.7
ghcup install cabal 3.6.2.0
ghcup set cabal 3.6.2.0
</code></pre>
<p>Reload your terminal again to make these appear in your path and set</p>
<pre class="lang-bash prettyprint-override"><code>cabal configure --with-compiler=ghc-8.10.7
</code></pre>
<p><strong>A special version of libsodium</strong></p>
<p>Libsodium is a tool chain (written for performance) for cryptographic derivatives, for example you can create signatures and hashes with it. We require a particular version of it that adds VRF cryptography to it (used for the Cardano consensus mechanism). Installing this can be done via,</p>
<pre class="lang-bash prettyprint-override"><code>git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout 66f017f1
./autogen.sh
./configure
make
sudo make install
</code></pre>
<p>In addition to this add the following to your <code>~/.bashrc</code> and reload your terminal again to add it to your path</p>
<pre class="lang-bash prettyprint-override"><code>export LD_LIBRARY_PATH=&quot;/usr/local/lib:$LD_LIBRARY_PATH&quot;
export PKG_CONFIG_PATH=&quot;/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH&quot;
</code></pre>
<p><strong>A special version of libsecp256k1</strong></p>
<p>Since the Vasil hard fork Cardano has the secp256K1 signature scheme available in plutus. This allows for the validation of Bitcoin signatures and will make it easier to build bridges. Bitcoin is not the only blockchain that use this signature scheme, many others do. So to install this library (again a particular audited version) you use,</p>
<pre class="lang-bash prettyprint-override"><code>git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
git checkout ac83be33
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
make check
sudo make install
</code></pre>
<p><strong>A preconfigure project</strong></p>
<p>We are ready to build a Plutus project! Before I tell how you can set up such a project, I want to share an already set up <a href="https://github.com/perturbing/example-project-basic" rel="noreferrer">example</a>. This so that you can test that you correctly installed the dependencies above. To run this example you use</p>
<pre class="lang-bash prettyprint-override"><code>git clone https://github.com/perturbing/example-project-basic.git
cd example-project-basic
cabal update
cabal run
</code></pre>
<p>I would like to reiterate, if you do not have sufficient ram available, for example because you run this example in a VM, you can <code>cabal run</code> again if your memory overflows. This example ran for me in a vm with 10gb ram.</p>
<p><strong>Now how is this project setup?</strong></p>
<p>This project and its structure is not constructed arbitrarily. It is namely derived from the latest release of the <a href="https://github.com/input-output-hk/plutus-apps/releases/tag/v1.0.0" rel="noreferrer">plutus-apps</a> repository. This repository and its management of dependencies is chosen because it imports and exposes almost all important Haskell packages written for Cardano.</p>
<p>Now, how to concretely set up and copy the essential bits of this repo? It consists of the following steps.</p>
<p>To start we execute</p>
<pre class="lang-bash prettyprint-override"><code>mkdir my-plutus-project
cd my-plutus-project
cabal init
touch cabal.project
</code></pre>
<p>You could also use the flag <code>--interactive</code> for a more detailed set up with <code>cabal init</code>.</p>
<p>Next, we copy the <code>cabal.project</code> file of plutus-apps from its latest release (do not pick the main branch, consider this is unstable). Currently, the latest version of this file is <a href="https://github.com/input-output-hk/plutus-apps/blob/7952b9d30d15779a7fd8103bdbc9612d5df18ec2/cabal.project" rel="noreferrer">this</a>. Next, we need to adjust some pieces of this file to make it work for us.</p>
<p>The first thing to change, this <code>cabal.project</code> file does not import the <code>plutus-apps</code> repo (since it was part of the original one). So, we need to add that by changing the code that declared the to build packages of the plutus-apps repo. It also does not declare our new build artifacts of our cabal project, we have to change the exposed packages it has to build. Both can be achieved by changing,</p>
<pre class="lang-haskell prettyprint-override"><code>packages: cardano-streaming
          doc
          freer-extras
          marconi
          marconi-mamba
          playground-common
          pab-blockfrost
          plutus-chain-index
          plutus-chain-index-core
          plutus-contract
          plutus-contract-certification
          plutus-example
          plutus-ledger
          plutus-ledger-constraints
          plutus-pab
          plutus-pab-executables
          plutus-script-utils
          plutus-tx-constraints
          plutus-use-cases
          rewindable-index
</code></pre>
<p>to</p>
<pre class="lang-haskell prettyprint-override"><code>packages: ./

source-repository-package
    type: git
    location: https://github.com/input-output-hk/plutus-apps
    tag: the_latest_release_tag_used_here_CHANGE_ME!!!
    subdir: 
          cardano-streaming
          doc
          freer-extras
          marconi
          marconi-mamba
          playground-common
          pab-blockfrost
          plutus-chain-index
          plutus-chain-index-core
          plutus-contract
          plutus-contract-certification
          plutus-example
          plutus-ledger
          plutus-ledger-constraints
          plutus-pab
          plutus-pab-executables
          plutus-script-utils
          plutus-tx-constraints
          plutus-use-cases
          rewindable-index
</code></pre>
<p>Next up, we can add to our executables and/or libraries on which modules they depend. For example, we might add to our <code>my-plutus-project.cabal</code> file that the executable depends on</p>
<pre class="lang-haskell prettyprint-override"><code>    build-depends:    base ^&gt;=4.14.3.0
                    , aeson
                    , bytestring
                    , containers
                    , cardano-api
                    , data-default
                    , plutus-ledger
                    , plutus-ledger-api
                    , plutus-ledger-constraints
                    , plutus-script-utils
                    , plutus-tx-plugin
                    , plutus-tx
                    , text
                    , serialise
</code></pre>
<p>And lastly, we can write our <code>app/Main.hs</code> file to execute some functions for us. A simple <code>cabal update</code> and a <code>cabal run</code> will execute your <code>Main.hs</code> executable.</p>
<p><strong>Some last words</strong>
This is a long answer, and in no way is complete. I advise anyone who is eager to learn more about Haskell to take the Haskell <a href="https://github.com/input-output-hk/haskell-course/" rel="noreferrer">course</a> from IOG (it also covers cabal!). I hope this gets you started!</p>

CC BY-SA 4.0
2022-12-20T15:59:18.860Z
2022-12-20T15:59:18.860Z
Fermat
<p>I'm from ETH's ecosystem and recently just decided to get into Cardano development, specifically Plutus dev work thanks to Demeter.Run, and after going through the Plutus starters on there, I noticed there weren't any guides on how to start a <strong>fresh</strong> project from <strong>scratch</strong>. I did a speedrun through the latest iteration of the Plutus Pioneer course and found out that most of the work was either done in the Playground, the Repl, or built from the top of an existing project(which still doesn't add up to me).</p>
<p>Tried moving some sample .hs code from Plutus-apps and Alonzo-testnet repos hoping to compile and submit them for my own experience and only ended up fighting with GHC and Cabal errors because the sample code used other dependencies and structures different from the secondhand project I was guided to build on top of.</p>
<p>I don't want to start a project by piggybacking on some already existing files and .cabal and .project configs with specs I don't know/understand.</p>
<p>If I was starting a NodeJs project I'd begin with <code>npm init</code> then go from there</p>
<p>My question is, how can I start a new Plutus project from scratch such that I know</p>
<ol>
<li>how to setup my .cabal file dependencies</li>
<li>how to setup what's needed for the .project file</li>
<li>where to input my fresh code (or borrowed code from Plutus-apps samples to test) because there's the &quot;main.hs&quot; in the app folder which I learned from Haskell but Plutus samples put their .hs code files in the &quot;src&quot; folder, the &quot;main.hs&quot; in the app folder contains something completely different.</li>
<li>how to compile my .hs to .plutus</li>
</ol>
<p>Everything that comes after these 4 steps i.e. submitting that new .plutus file to the chain (serialised) and building Tx's I know how to do.</p>
<p>I am using Demeter.Run and working from the Terminal and Cardano-CLI from the workspaces, I am under the impression every dependency from IOHK/IOG is setup. I don't know nix and the plutus starter samples didn't need that so hope to progress that way.</p>
<p>I have very minimal Haskell but learning the basics hasn't been tough but I'm good with front-end Javascript and some Solidity.</p>
<p>Please be as detailed/technical as you like, thank you.</p>
<p>Note: I went through the previous questions posed in the links below but still did not get it.</p>
<p><a href="https://cardano.stackexchange.com/questions/7794/starting-a-new-plutus-project">Starting a new Plutus Project</a></p>
<p><a href="https://cardano.stackexchange.com/questions/7339/how-to-start-a-new-project">How to Start a New Project</a></p>

CC BY-SA 4.0
2022-11-05T11:54:20.637Z
This is a great question. It would be great if there is a guide that show every step from zero to a working dapp on testnet. Plutus Pioneer Program doesn't provide the complete picture. Plutus Playground doesn't compile most of the time. I previously thought it's just me.
Adam
<plutus><cardano-cli><smart-contract><haskell><cabal>
How to properly start a new Plutus project, from scratch
# How to properly start a new Plutus project, from scratch

(Asked by: username_0 on 2022-11-03)

I'm from ETH's ecosystem and recently just decided to get into Cardano development, specifically Plutus dev work thanks to Demeter.Run, and after going through the Plutus starters on there, I noticed there weren't any guides on how to start a **fresh** project from **scratch**. I did a speedrun through the latest iteration of the Plutus Pioneer course and found out that most of the work was either done in the Playground, the Repl, or built from the top of an existing project(which still doesn't add up to me).

Tried moving some sample .hs code from Plutus-apps and Alonzo-testnet repos hoping to compile and submit them for my own experience and only ended up fighting with GHC and Cabal errors because the sample code used other dependencies and structures different from the secondhand project I was guided to build on top of.

I don't want to start a project by piggybacking on some already existing files and .cabal and .project configs with specs I don't know/understand.

If I was starting a NodeJs project I'd begin with `npm init` then go from there

My question is, how can I start a new Plutus project from scratch such that I know

1. how to setup my .cabal file dependencies
2. how to setup what's needed for the .project file
3. where to input my fresh code (or borrowed code from Plutus-apps samples to test) because there's the "main.hs" in the app folder which I learned from Haskell but Plutus samples put their .hs code files in the "src" folder, the "main.hs" in the app folder contains something completely different.
4. how to compile my .hs to .plutus

Everything that comes after these 4 steps i.e. submitting that new .plutus file to the chain (serialised) and building Tx's I know how to do.

I am using Demeter.Run and working from the Terminal and Cardano-CLI from the workspaces, I am under the impression every dependency from IOHK/IOG is setup. I don't know nix and the plutus starter samples didn't need that so hope to progress that way.

I have very minimal Haskell but learning the basics hasn't been tough but I'm good with front-end Javascript and some Solidity.

Please be as detailed/technical as you like, thank you.

Note: I went through the previous questions posed in the links below but still did not get it.

[Starting a new Plutus Project](https://cardano.stackexchange.com/questions/7794/starting-a-new-plutus-project)

[How to Start a New Project](https://cardano.stackexchange.com/questions/7339/how-to-start-a-new-project)

**Tags:** plutus, cardano-cli, smart-contract, haskell, cabal
> **Comments:**
> **username_1**: This is a great question. It would be great if there is a guide that show every step from zero to a working dapp on testnet. Plutus Pioneer Program doesn't provide the complete picture. Plutus Playground doesn't compile most of the time. I previously thought it's just me.  

---

## 3 answers

### Answer by username_7 on 2022-12-20. Score: 5

A well formatted question deserves a well formatted answer! I will go into some depths, but also keep some things at a “magical” level. This is a long read so take your time!
Before we start, it is good to note that most of the Cardano stack is written in Haskell, and thus, managing a Plutus project is just managing a Haskell project. There are multiple ways of doing this, just a plain Cabal project or one of the many Nix ways of building (cabal2nix, Haskell.nix and many others). Now there are good reason to use these Nixs ways (most notably reproducibility and caching), but in this answer I will focus on a more understandable way of just using GHC + cabal on Ubuntu 22.04 (not the minimal install).
A disclaimer, building everything yourself requires lots of ram (you can also re-run the cabal run command if you run out of memory mid-process). The good thing, however, once build you have these Haskell artifact locally prebuilt in your ~/.cabal/ folder.
The dependencies
Before we can even build a general all-purpose Haskell/plutus project, we need some basic building tools necessary to even start compiling! These mainly consist of the following tools,

OS dependent dependencies
GHC and Cabal
A special version of libsodium
A special version of libsecp256k1

OS dependent dependencies
To build everything, you at least need these dependencies
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install automake build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev libsystemd-dev zlib1g-dev make g++ tmux git jq wget libncursesw5 curl libtool postgresql libpq-dev autoconf -y

Note that translating these OS dependent dependencies to other operating systems is hard and out of the scope of this post (this is why you might want nix). They may also change in the future as the project might add new dependencies.
GHC and Cabal
It is recommended by IOG to use GHC version 8.10.7 and Cabal version 3.6.2.0. These can be installed via GHCUP via,
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

You can press enter for all question the installer asks. Then reload your terminal (to make ghcup appear in your path) and,
ghcup install ghc 8.10.7
ghcup set ghc 8.10.7
ghcup install cabal 3.6.2.0
ghcup set cabal 3.6.2.0

Reload your terminal again to make these appear in your path and set
cabal configure --with-compiler=ghc-8.10.7

A special version of libsodium
Libsodium is a tool chain (written for performance) for cryptographic derivatives, for example you can create signatures and hashes with it. We require a particular version of it that adds VRF cryptography to it (used for the Cardano consensus mechanism). Installing this can be done via,
git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout 66f017f1
./autogen.sh
./configure
make
sudo make install

In addition to this add the following to your ~/.bashrc and reload your terminal again to add it to your path
export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

A special version of libsecp256k1
Since the Vasil hard fork Cardano has the secp256K1 signature scheme available in plutus. This allows for the validation of Bitcoin signatures and will make it easier to build bridges. Bitcoin is not the only blockchain that use this signature scheme, many others do. So to install this library (again a particular audited version) you use,
git clone https://github.com/bitcoin-core/secp256k1
cd secp256k1
git checkout ac83be33
./autogen.sh
./configure --enable-module-schnorrsig --enable-experimental
make
make check
sudo make install

A preconfigure project
We are ready to build a Plutus project! Before I tell how you can set up such a project, I want to share an already set up example. This so that you can test that you correctly installed the dependencies above. To run this example you use
git clone https://github.com/perturbing/example-project-basic.git
cd example-project-basic
cabal update
cabal run

I would like to reiterate, if you do not have sufficient ram available, for example because you run this example in a VM, you can cabal run again if your memory overflows. This example ran for me in a vm with 10gb ram.
Now how is this project setup?
This project and its structure is not constructed arbitrarily. It is namely derived from the latest release of the plutus-apps repository. This repository and its management of dependencies is chosen because it imports and exposes almost all important Haskell packages written for Cardano.
Now, how to concretely set up and copy the essential bits of this repo? It consists of the following steps.
To start we execute
mkdir my-plutus-project
cd my-plutus-project
cabal init
touch cabal.project

You could also use the flag --interactive for a more detailed set up with cabal init.
Next, we copy the cabal.project file of plutus-apps from its latest release (do not pick the main branch, consider this is unstable). Currently, the latest version of this file is this. Next, we need to adjust some pieces of this file to make it work for us.
The first thing to change, this cabal.project file does not import the plutus-apps repo (since it was part of the original one). So, we need to add that by changing the code that declared the to build packages of the plutus-apps repo. It also does not declare our new build artifacts of our cabal project, we have to change the exposed packages it has to build. Both can be achieved by changing,
packages: cardano-streaming
          doc
          freer-extras
          marconi
          marconi-mamba
          playground-common
          pab-blockfrost
          plutus-chain-index
          plutus-chain-index-core
          plutus-contract
          plutus-contract-certification
          plutus-example
          plutus-ledger
          plutus-ledger-constraints
          plutus-pab
          plutus-pab-executables
          plutus-script-utils
          plutus-tx-constraints
          plutus-use-cases
          rewindable-index

to
packages: ./

source-repository-package
    type: git
    location: https://github.com/input-output-hk/plutus-apps
    tag: the_latest_release_tag_used_here_CHANGE_ME!!!
    subdir: 
          cardano-streaming
          doc
          freer-extras
          marconi
          marconi-mamba
          playground-common
          pab-blockfrost
          plutus-chain-index
          plutus-chain-index-core
          plutus-contract
          plutus-contract-certification
          plutus-example
          plutus-ledger
          plutus-ledger-constraints
          plutus-pab
          plutus-pab-executables
          plutus-script-utils
          plutus-tx-constraints
          plutus-use-cases
          rewindable-index

Next up, we can add to our executables and/or libraries on which modules they depend. For example, we might add to our my-plutus-project.cabal file that the executable depends on
    build-depends:    base ^>=4.14.3.0
                    , aeson
                    , bytestring
                    , containers
                    , cardano-api
                    , data-default
                    , plutus-ledger
                    , plutus-ledger-api
                    , plutus-ledger-constraints
                    , plutus-script-utils
                    , plutus-tx-plugin
                    , plutus-tx
                    , text
                    , serialise

And lastly, we can write our app/Main.hs file to execute some functions for us. A simple cabal update and a cabal run will execute your Main.hs executable.
Some last words
This is a long answer, and in no way is complete. I advise anyone who is eager to learn more about Haskell to take the Haskell course from IOG (it also covers cabal!). I hope this gets you started!


---

### Answer by username_3 on 2022-11-28. Score: 4

Since this question was posted Plutus-alternatives have been developed by the community that allow doing DApp development in JavaScript only. One such library is <https://github.com/hyperion-bt/Helios>

<https://www.hyperion-bt.org/Helios-Book/api/picoswap/index.html> is a step-by-step guide on how to implement a simple marketplace. The example code can be found [here](https://github.com/hyperion-bt/PicoSwap), and a demo is hosted [here](https://www.hyperion-bt.org/PicoSwap)

> **Comments:**
> **username_4**: Helios seems very interesting, although my confidence in the project decline the second I saw they chose to build `Helios` in JavaScript.  
> **username_3**: There isn't really an alternative for javascript if you want to build pure client-side DApps  
> **username_5**: The fact that the Helios compiler uses javascript to compile to plutus untyped core is a huge advantage and allows for the dynamic compiling to plutus core on any architecture that supports javascript  (browser, mobile devices, etc).   The helios language itself is a functional programming language, so you get all the benefits of a strongly typed functional programming language for writing your smart contracts, but you can compile it almost anywhere.  
> **username_6**: doesn't answer the question  
> **username_3**: People who are struggling with Plutus should know there are easier alternatives  

---

### Answer by username_2 on 2023-03-18. Score: 0

You can start with cloning <https://github.com/input-output-hk/plutus-starter>

and follow the readme in that repo


---

