Skip to main content

starknet_getCompiledCasm RPC Method

Get the contract class definition associated with the given class hash, compiled to CASM.

Updated on
Jul 30, 2026

Parameters

class_hash
string
REQUIRED

The hash of the contract class whose CASM will be returned

Returns

result
object

The compiled contract class with the following fields:

bytecode
array

The CASM bytecode of the compiled class

compiler_version
string

The version of the Cairo compiler used to compile the class

entry_points_by_type
object

The entry points of the compiled class, grouped into the CONSTRUCTOR, EXTERNAL and L1_HANDLER keys. Each entry point has the following fields

selector
string

A unique identifier of the entry point (function) in the program

offset
integer

The offset of the instruction in the class's bytecode

builtins
array

The list of builtins used by the entry point, for example 'range_check' or 'pedersen'

hints
array

The hints of the compiled class, given as [bytecode index, list of hints] pairs. Each hint is an object keyed by its type, for example 'TestLessThanOrEqual' or 'AllocSegment', whose value holds the hint's operands

prime
string

The prime field of the Cairo VM

bytecode_segment_lengths
array

(Optional) A list of sizes of segments in the bytecode, each segment is hashed individually when computing the bytecode hash. Only returned for classes compiled with Sierra 1.5.0 or above

Request
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free