opshin | Cardano Developer Portal (2024)

opshin is a programming language for developing smart contracts on the Cardano blockchain.Its syntax is 100% valid Python code and it ensures that contracts evaluate on-chainexactly as their Python counterpart.This allows unit tests and verification of the Python code using standard tooling available for Python development.Existing IDEs, linters and language servers may be re-used as well.Note that the type system of opshin is much stricter than the type system of Python, so that many optimizations can be implemented and an elevated level of security is provided.

The language interacts closely with the python library PyCardano.The internal data structures are defined with data types compatible to the library and allow a tight combination of off- and on-chain code, all written in Python.

A complete example on a small written contract and off-chain code to deploy it on-chain can be found in the opshin-starter-kit repository.It contains code that will compile the contract and deploy it to the preview testnet, runnable in demeter.run, in your browser.

from opshin.prelude import *


@dataclass()
class WithdrawDatum(PlutusData):
pubkeyhash: bytes


def validator(datum: WithdrawDatum, redeemer: None, context: ScriptContext) -> None:
sig_present = False
for s in context.tx_info.signatories:
if datum.pubkeyhash == s:
sig_present = True
assert sig_present, "Required signature missing"

It checks the presence of a specific signature in the transaction to approve spending funds.We can compile the contract like this

The result is a directory filled with the contract address, policy ID and data that will be used by off-chain libraries to interact with the contract.

opshin | Cardano Developer Portal (2024)
Top Articles
Who Runs The World? Women Control 85% Of Purchases, 29% Of STEM Roles
Debit card will not add to Samsung Wallet
Is Sam's Club Plus worth it? What to know about the premium warehouse membership before you sign up
What spices do Germans cook with?
Workday Latech Edu
Rondale Moore Or Gabe Davis
EY – все про компанію - Happy Monday
Heska Ulite
Dark Souls 2 Soft Cap
Cube Combination Wiki Roblox
Tamilblasters 2023
3656 Curlew St
Craigslist Greenville Craigslist
Thotsbook Com
Grace Caroline Deepfake
Hoe kom ik bij mijn medische gegevens van de huisarts? - HKN Huisartsen
Foodland Weekly Ad Waxahachie Tx
111 Cubic Inch To Cc
Boston Gang Map
Ups Access Point Lockers
Wausau Obits Legacy
Crawlers List Chicago
Dover Nh Power Outage
Glover Park Community Garden
Employee Health Upmc
Shreveport City Warrants Lookup
Https E22 Ultipro Com Login Aspx
As families searched, a Texas medical school cut up their loved ones
Free T33N Leaks
Penn State Service Management
Miles City Montana Craigslist
10 Best Quotes From Venom (2018)
How Do Netspend Cards Work?
Kacey King Ranch
+18886727547
Craigs List Tallahassee
Dentist That Accept Horizon Nj Health
Reborn Rich Ep 12 Eng Sub
Skyrim:Elder Knowledge - The Unofficial Elder Scrolls Pages (UESP)
How to play Yahoo Fantasy Football | Yahoo Help - SLN24152
Omaha Steaks Lava Cake Microwave Instructions
Tsbarbiespanishxxl
Wal-Mart 140 Supercenter Products
Valls family wants to build a hotel near Versailles Restaurant
Child care centers take steps to avoid COVID-19 shutdowns; some require masks for kids
Aloha Kitchen Florence Menu
Bellelement.com Review: Real Store or A Scam? Read This
Craiglist.nj
Rubmaps H
7 Sites to Identify the Owner of a Phone Number
Craigs List Sarasota
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 6237

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.