Using the Stackr-CLI you can initialize a new Micro-Rollup project.
stackr init --project-name counter
This will create a new folder called counter and initialize a new Micro-Rollup project inside of it.
By default the project will be initialized with a template that includes a simple counter.
You will notice typescript throwing some missing file errors, Don’t worry this
will be taken care of in the next steps
You might need to do npm install sqlite3 in the rollup directory after the
previous step because for some odd reason bun doesn’t install it properly
The stackr.config.ts file is the main configuration file for your Micro-Rollup.
It contains rollup’s operational information like app inbox, block time, block size, verification delay etc.
It also contains the app’s domain which will be used for EIP-712 signing of the actions.
Update the private key
This private key is the operator’s private key. This is the key that will be used to sign the rollup blocks.
This key is also used to deploy the rollup inbox contract and genesis state.Add a private key which has some funds in it.
Stackr uses EIP-712 for signing the actions. The domain is used to generate the domain separator for the EIP-712 signing.
You can learn more about EIP-712 here.
stackr.config.ts
domain: { name: "<YOUR_APP_NAME>", version: "<APP_VERSION>", chainId: "<CHAIN_ID>", // use 1337 for testnet verifyingContract: deployment.app_inbox, // this is the app inbox contract address generated in the next step salt: "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", // this is a random salt }
3. Register your micro-rollup to Stackr’s on-chain registry
stackr register
This command will register your micro-rollup to Stackr’s on-chain registry.
Essentially this deploys a new rollup inbox contract for your rollup where the rollup’s transaction data will go and also generate an app-id for your micro-rollup.
The app-id and the app inbox contract addresses are stored in deployment.json file which is used by the config.
Make sure that the private key you entered has sufficient funds to cover the
deployment of the contracts
This will create a deployment.json file in the root of your project that looks like this
This command will compile your micro-rollup by parsing the state and the state transition function and
putting it all into an executable WASM binary inside the build folder.(This step is kinda boring from outside NGL, but the most technically impressive one behind the scenes,
like seriously TS -> WASM in one step? Are ya kidding me?)
This is the most exciting step. This command is similar to deploying a smart contract bytecode to Ethereum but over here
the State machine goes to Vulcan and the the attestation to genesis state and the code logic goes on Ethereum.
You have successfully deployed your first micro-rollup.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"Micro-Rollups and Stuff","colors":{"primary":"#051A21","light":"#62EDED","dark":"#051A21"},"favicon":"/favicon.svg","logo":{"light":"https://mintcdn.com/stackrlabs/72vxB1VE2VocKykz/logo/light.svg?fit=max\u0026auto=format\u0026n=72vxB1VE2VocKykz\u0026q=85\u0026s=1fc465375d8e0b8688e07b5d1d9faae0","dark":"https://mintcdn.com/stackrlabs/72vxB1VE2VocKykz/logo/dark.svg?fit=max\u0026auto=format\u0026n=72vxB1VE2VocKykz\u0026q=85\u0026s=090431bf53b15407e507ecafe0c049bf"},"navbar":{"links":[{"label":"Support","href":"mailto:gm@stackrlabs.com"}],"primary":{"type":"button","label":"Website","href":"https://stf.xyz"}},"footer":{"socials":{"twitter":"https://twitter.com/0xStackr","github":"https://github.com/stackrlabs","linkedin":"https://www.linkedin.com/company/stackr-labs/"}},"navigation":{"global":{"anchors":[{"anchor":"Community","href":"https://discord.com/invite/PY4nhg7bcc","icon":"discord"},{"anchor":"Blog","href":"https://mirror.xyz/stackrlabs.eth","icon":"newspaper"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"stackrlabs","hasAudioNarration":false,"actualSubdomain":"stackrlabs","customDomains":[],"gitSource":{"type":"github","owner":"stackrlabs","repo":"docs-deprecated","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae91deeb9dca87217175e38:success","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"Documentation","count":15},{"language":"default","tag":"Develop","count":9},{"language":"default","tag":"Setup","count":3},{"language":"default","tag":"0-to-1","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"start/building-first-rollup","slug":"/start/building-first-rollup","pageMetadata":{"title":"Building your first Micro-Rollup","description":"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps","href":"/start/building-first-rollup"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`3`,id:`1-initialize-new-project`,children:`1. Initialize new project`}),`\n`,_jsx(_components.p,{children:`Using the Stackr-CLI you can initialize a new Micro-Rollup project.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`stackr`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` init`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --project-name`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` counter`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This will create a new folder called `,_jsx(_components.code,{children:`counter`}),` and initialize a new Micro-Rollup project inside of it.\nBy default the project will be initialized with a template that includes a simple counter.`]}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`You will notice typescript throwing some missing file errors, Don’t worry this\nwill be taken care of in the next steps`})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`You might need to do `,_jsx(_components.code,{children:`npm install sqlite3`}),` in the rollup directory after the\nprevious step because for some odd reason bun doesn’t install it properly`]})}),`\n`,_jsxs(Heading,{level:`3`,id:`2-checkout-stackr-config-ts`,children:[`2. Checkout `,_jsx(_components.code,{children:`stackr.config.ts`})]}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`stackr.config.ts`}),` file is the main configuration file for your Micro-Rollup.\nIt contains rollup’s operational information like app inbox, block time, block size, verification delay etc.\nIt also contains the app’s domain which will be used for EIP-712 signing of the actions.`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Update the private key`})}),`\n`]}),`\n`,_jsx(_components.p,{children:`This private key is the operator’s private key. This is the key that will be used to sign the rollup blocks.\nThis key is also used to deploy the rollup inbox contract and genesis state.`}),`\n`,_jsx(_components.p,{children:`Add a private key which has some funds in it.`}),`\n`,_jsx(CodeBlock,{filename:`stackr.config.ts`,numberOfLines:`9`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:`operator`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` accounts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` privateKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\u003cOPERATOR_KEY>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` purpose:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` KeyPurpose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`BATCH`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` scheme:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SignatureScheme`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`ECDSA`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`]})})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`Update the EIP-712 domain`})}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Stackr uses EIP-712 for signing the actions. The domain is used to generate the domain separator for the EIP-712 signing.\nYou can learn more about EIP-712 `,_jsx(_components.a,{href:`https://eips.ethereum.org/EIPS/eip-712`,children:`here`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:`stackr.config.ts`,numberOfLines:`7`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:`domain`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cYOUR_APP_NAME>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` version`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cAPP_VERSION>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` chainId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\u003cCHAIN_ID>\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// use 1337 for testnet`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` verifyingContract`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`deployment`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app_inbox`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// this is the app inbox contract address generated in the next step`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#C8C8C8`},children:` salt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// this is a random salt`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`3-register-your-micro-rollup-to-stackr’s-on-chain-registry`,children:`3. Register your micro-rollup to Stackr’s on-chain registry`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`stackr`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` register`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This command will register your micro-rollup to Stackr’s on-chain registry.\nEssentially this deploys a new rollup inbox contract for your rollup where the rollup’s transaction data will go and also generate an app-id for your micro-rollup.\nThe app-id and the app inbox contract addresses are stored in `,_jsx(_components.code,{children:`deployment.json`}),` file which is used by the config.`]}),`\n`,_jsx(Info,{children:_jsx(_components.p,{children:`Make sure that the private key you entered has sufficient funds to cover the\ndeployment of the contracts`})}),`\n`,_jsxs(_components.p,{children:[`This will create a `,_jsx(_components.code,{children:`deployment.json`}),` file in the root of your project that looks like this`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"app_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"app_inbox\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0xa16e02e87b7454126e5e10d957a927a7f5b5d2be\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`4-compile-your-micro-rollup`,children:`4. Compile your micro-rollup`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`stackr`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` compile`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This command will compile your micro-rollup by parsing the state and the state transition function and\nputting it all into an executable WASM binary inside the `,_jsx(_components.code,{children:`build`}),` folder.`]}),`\n`,_jsx(_components.p,{children:`(This step is kinda boring from outside NGL, but the most technically impressive one behind the scenes,\nlike seriously TS -> WASM in one step? Are ya kidding me?)`}),`\n`,_jsx(Heading,{level:`3`,id:`5-deploy-your-micro-rollup`,children:`5. Deploy your micro-rollup`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`stackr`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` deploy`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`This is the most exciting step. This command is similar to deploying a smart contract bytecode to Ethereum but over here\nthe State machine goes to Vulcan and the the attestation to genesis state and the code logic goes on Ethereum.`}),`\n`,_jsx(Heading,{level:`2`,id:`that’s-it`,children:`That’s it!`}),`\n`,_jsx(_components.p,{children:`You have successfully deployed your first micro-rollup.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Building your first Micro-Rollup","description":"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps","href":"/start/building-first-rollup"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. Initialize new project","slug":"1-initialize-new-project","depth":3,"children":[]},{"title":"2. Checkout stackr.config.ts","slug":"2-checkout-stackr-config-ts","depth":3,"children":[]},{"title":"3. Register your micro-rollup to Stackr’s on-chain registry","slug":"3-register-your-micro-rollup-to-stackr’s-on-chain-registry","depth":3,"children":[]},{"title":"4. Compile your micro-rollup","slug":"4-compile-your-micro-rollup","depth":3,"children":[]},{"title":"5. Deploy your micro-rollup","slug":"5-deploy-your-micro-rollup","depth":3,"children":[]},{"title":"That’s it!","slug":"that’s-it","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"stackrlabs","siteName":"Micro-Rollups and Stuff","title":"Building your first Micro-Rollup - Micro-Rollups and Stuff","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-07T00:40:52.432Z","originalFileLocation":"start/building-first-rollup.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps\">\u003cmeta data-mint-head name=\"application-name\" content=\"Micro-Rollups and Stuff\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Building your first Micro-Rollup - Micro-Rollups and Stuff\">\u003cmeta data-mint-head property=\"og:description\" content=\"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Micro-Rollups and Stuff\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://stackrlabs.mintlify.app/start/building-first-rollup\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://stackrlabs.mintlify.site/_mintlify/api/og/v2?division=0-to-1\u0026amp;title=Building+your+first+Micro-Rollup\u0026amp;description=Setup+up+your+first+Micro-Rollup+and+take+it+for+a+spin+in+just+5+easy+steps\u0026amp;theme=9a2543184052fc2e1f6bab19\u0026amp;signature=c3c9f15a7bd0b0d4140e14e7da3948182a9c35547c0fdb6f6460f8a7905d6ab9\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Building your first Micro-Rollup - Micro-Rollups and Stuff\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://stackrlabs.mintlify.site/_mintlify/api/og/v2?division=0-to-1\u0026amp;title=Building+your+first+Micro-Rollup\u0026amp;description=Setup+up+your+first+Micro-Rollup+and+take+it+for+a+spin+in+just+5+easy+steps\u0026amp;theme=9a2543184052fc2e1f6bab19\u0026amp;signature=c3c9f15a7bd0b0d4140e14e7da3948182a9c35547c0fdb6f6460f8a7905d6ab9\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/stackrlabs/eUS6KC7KwnkKOJVM/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Micro-Rollups and Stuff\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#051A21\">\u003clink data-mint-head rel=\"canonical\" href=\"https://stackrlabs.mintlify.app/start/building-first-rollup\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/start/building-first-rollup.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://stackrlabs.mintlify.app/#organization\",\"name\":\"Micro-Rollups and Stuff\",\"url\":\"https://stackrlabs.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/stackrlabs/72vxB1VE2VocKykz/logo/light.svg?fit=max\u0026auto=format\u0026n=72vxB1VE2VocKykz\u0026q=85\u0026s=1fc465375d8e0b8688e07b5d1d9faae0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://stackrlabs.mintlify.app#website\",\"name\":\"Micro-Rollups and Stuff\",\"url\":\"https://stackrlabs.mintlify.app\",\"publisher\":{\"@id\":\"https://stackrlabs.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://stackrlabs.mintlify.app/start/building-first-rollup#webpage\",\"url\":\"https://stackrlabs.mintlify.app/start/building-first-rollup\",\"name\":\"Building your first Micro-Rollup\",\"description\":\"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps\",\"dateModified\":\"2026-01-07T00:40:52.432Z\",\"isPartOf\":{\"@id\":\"https://stackrlabs.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://stackrlabs.mintlify.app/start/building-first-rollup#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://stackrlabs.mintlify.app/start/building-first-rollup#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"0-to-1\",\"item\":\"https://stackrlabs.mintlify.app/start/start-here\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building your first Micro-Rollup\",\"item\":\"https://stackrlabs.mintlify.app/start/building-first-rollup\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://stackrlabs.mintlify.app/start/building-first-rollup#article\",\"headline\":\"Building your first Micro-Rollup\",\"name\":\"Building your first Micro-Rollup\",\"description\":\"Setup up your first Micro-Rollup and take it for a spin in just 5 easy steps\",\"url\":\"https://stackrlabs.mintlify.app/start/building-first-rollup\",\"mainEntityOfPage\":{\"@id\":\"https://stackrlabs.mintlify.app/start/building-first-rollup#webpage\"},\"dateModified\":\"2026-01-07T00:40:52.432Z\",\"publisher\":{\"@id\":\"https://stackrlabs.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://stackrlabs.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Micro-Rollups and Stuff\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Micro-Rollups and Stuff","nav":{"global":{"anchors":[{"anchor":"Community","href":"https://discord.com/invite/PY4nhg7bcc","icon":"discord"},{"anchor":"Blog","href":"https://mirror.xyz/stackrlabs.eth","icon":"newspaper"}]},"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Setup","pages":[{"title":"Dev Environment","href":"/setup/dev-environment"},{"title":"SDK Access","href":"/setup/SDK-access"},{"title":"Stackr Testnet","href":"/config/configurations"}]},{"group":"0-to-1","pages":[{"title":"Start Here","description":"Making sure stuff works nothing breaks","href":"/start/start-here"},{"title":"Building your first Micro-Rollup","href":"/start/building-first-rollup"},{"title":"Let's run it now","description":"Interact with the Micro-Rollup and build some blocks","href":"/start/running-first-rollup"}]},{"group":"Develop","pages":[{"title":"Before You Begin","href":"/develop/before-you-begin"},{"title":"State Variables","href":"/develop/state"},{"title":"Rollup State","href":"/develop/rollup-state"},{"title":"State Transition Function","href":"/develop/state-transition-function"},{"title":"Almost Micro-Rollup","href":"/develop/almost-micro-rollup"},{"title":"Stackr Config","href":"/develop/stackr-config"},{"title":"Sequencer","href":"/develop/builder-sequencer"},{"title":"Micro-Rollup","href":"/develop/micro-rollup"},{"title":"Micro-Rollup Utilities","href":"/develop/micro-rollup-utilities"}]}]}]},"basePath":"","title":"Building your first Micro-Rollup - Micro-Rollups and Stuff","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":[],"chunks":[]}