starknet

Installation
SKILL.md

StarkNet Development Guide

StarkNet is a permissionless validity rollup (ZK-rollup) on Ethereum. Smart contracts are written in Cairo, a provable computation language that compiles to Sierra (Safe Intermediate Representation) and then to CASM (Cairo Assembly) for execution. Every account on StarkNet is a smart contract — there are no EOAs.

What You Probably Got Wrong

AI agents trained on EVM patterns make critical errors when generating StarkNet/Cairo code. Fix these first.

  • StarkNet is NOT EVM-compatible — Cairo is a completely different language from Solidity. There is no msg.value, no payable, no receive(). ETH is an ERC-20 token on StarkNet, transferred via the ETH token contract like any other token.
  • felt252 is not uint256 — The native type is felt252, a field element modulo a 252-bit prime. It wraps on overflow (not revert). For safe arithmetic or values > 252 bits, use u256 (which is a struct of two u128 values internally).
  • Every account is a smart contract — There are no externally owned accounts. Deploying your first contract requires a pre-funded account contract. Account contracts implement __validate__ and __execute__ entrypoints.
  • Deployment is two steps: declare then deploy — First you declare the contract class (uploading the code). Then you deploy instances of that class. Multiple contracts can share one class hash. This is fundamentally different from EVM's single CREATE/CREATE2.
  • There is no constructor keyword — Cairo contracts use a #[constructor] attribute on a function. It runs once at deployment and cannot be called again.
  • Sierra compilation is mandatory — You write Cairo, Scarb compiles to Sierra (safe bytecode), and the sequencer compiles Sierra to CASM. You never deploy raw Cairo. Sierra guarantees provability — every execution path can be proven.
  • Transaction fees are paid in STRK or ETH — StarkNet supports fee payment in either STRK (native token) or ETH. The fee token is specified per transaction.
  • Storage is felt252-based, not 32-byte slots — StarkNet storage maps felt252 keys to felt252 values. Complex types like Map<K, V> use Pedersen hashing of the key + variable address for slot computation.
  • Function selectors use sn_keccak — Unlike Solidity's 4-byte keccak256 selectors, StarkNet uses sn_keccak(function_name) which is the first 250 bits of keccak256.

Quick Start

Installs
1
First Seen
Aug 4, 2026
starknet — justaname-id/cryptoskills