Getting Started with Opshin
Prequisites
This guide tries to assume as little knowledge as possible but there are certain assumptions:
- You should understand Python. Opshin is basically Python so we assume some basic knowledge of Python.
Installation
Install Python 3.9 to 3.13.
Then run:
python3 -m pip install opshinCompiling Opshin Code
-
Make a file called
hello_world.pyand copy:# hello_world.py from opshin.prelude import * def validator(_: ScriptContext) -> None: print("Hello world!") -
Run this command:
opshin build hello_world.pyThis should create a
buildfolder in the current directory. Thebuildfolder should look like this:build/ └-hello_world/ ├-mainnet.addr ├-script.cbor ├-script.plutus ├-script.policy_id └-testnet.addrWe'll cover what all these files in the
hello_worldsub-folder mean later in the book.