The parts of HelloPie and how one payment goes from a chat message to a Base transaction.
The parts
One payment, call by call
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"HelloPie","description":"Documentation for HelloPie: AI agents on Base whose money rules sit outside the model.","colors":{"primary":"#3E5C00","light":"#D8F04A","dark":"#3E5C00"},"logo":{"light":"/logo/light.svg","dark":"/logo/dark.svg","href":"https://docs.hellopie.xyz"},"favicon":"/favicon.svg","background":{"color":{"light":"#F3F2EE","dark":"#11110F"}},"navbar":{"links":[{"href":"https://trust.hellopie.xyz","label":"Trust"},{"href":"https://status.hellopie.xyz","label":"Status"},{"href":"https://github.com/Lexirieru/hellopie","type":"github"}]},"footer":{"socials":{"x":"https://x.com/hellopieai","github":"https://github.com/Lexirieru/hellopie"}},"fonts":{"family":"Geist"},"integrations":{"telemetry":{"enabled":false}},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"hasAudioNarration":false,"customDomains":[],"gitSource":{"type":"github","owner":"local","repo":"local","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"local","isBase":true},"buildId":"local","clientVersion":"0.0.4458"},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":true,"isLoggedInCli":false,"mintExport":{}},"customCss":[{"filePath":"style.css","content":":root{--hn-scrollbar-thumb: rgb(22 22 20 / 0.22);--hn-scrollbar-thumb-hover: rgb(22 22 20 / 0.38)}html.dark{--hn-scrollbar-thumb: rgb(242 241 236 / 0.22);--hn-scrollbar-thumb-hover: rgb(242 241 236 / 0.38)}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background:transparent}::-webkit-scrollbar-button{display:none}::-webkit-scrollbar-thumb{border-radius:9999px;background:var(--hn-scrollbar-thumb)}::-webkit-scrollbar-thumb:hover{background:var(--hn-scrollbar-thumb-hover)}@supports (-moz-appearance: none){*{scrollbar-width:thin;scrollbar-color:var(--hn-scrollbar-thumb) transparent}}:root{--hn-node: #ffffff;--hn-node-line: #e0ded6;--hn-ours: #f6fadf;--hn-ours-line: #c4d968;--hn-text: #161614;--hn-sub: #5c5a54;--hn-edge: #b9b6ad;--hn-dot: #5b7a00;--hn-pill: #f3f2ee;--hn-group: rgb(22 22 20 / 0.03);--hn-group-line: #d6d3c9;--hn-bad: #bf3220}html.dark{--hn-node: #1a1a18;--hn-node-line: #2e2e2b;--hn-ours: rgb(216 240 74 / 0.07);--hn-ours-line: rgb(216 240 74 / 0.35);--hn-text: #f2f1ec;--hn-sub: #a6a39b;--hn-edge: #4c4b46;--hn-dot: #d8f04a;--hn-pill: #11110f;--hn-group: rgb(242 241 236 / 0.025);--hn-group-line: #2e2e2b;--hn-bad: #ff6a55}.hn-diagram{margin:24px 0 8px}.hn-canvas{display:block;width:100%;height:auto;overflow:visible;font-family:inherit}.hn-node{fill:var(--hn-node);stroke:var(--hn-node-line);stroke-width:1}.hn-ours{fill:var(--hn-ours);stroke:var(--hn-ours-line)}.hn-title{fill:var(--hn-text);font-size:13px;font-weight:600}.hn-sub{fill:var(--hn-sub);font-size:11px}.hn-mono{font-family:ui-monospace, SFMono-Regular, Menlo, monospace;font-size:10.5px}.hn-edge{fill:none;stroke:var(--hn-edge);stroke-width:1.5}.hn-dashed{stroke-dasharray:4 4}.hn-head{fill:none;stroke:var(--hn-edge);stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.hn-dot{fill:var(--hn-dot)}.hn-pill{fill:var(--hn-pill);stroke:var(--hn-node-line);stroke-width:1}.hn-label{fill:var(--hn-sub);font-size:10.5px;font-weight:500}.hn-group{fill:var(--hn-group);stroke:var(--hn-group-line);stroke-width:1;stroke-dasharray:5 5}.hn-glabel{fill:var(--hn-sub);font-size:11px;font-weight:600}.hn-life{stroke:var(--hn-node-line);stroke-width:1;stroke-dasharray:3 5}.hn-num{fill:var(--hn-node);stroke:var(--hn-edge);stroke-width:1}.hn-numtext{fill:var(--hn-sub);font-size:9.5px;font-weight:600}.hn-note{fill:var(--hn-ours);stroke:var(--hn-ours-line);stroke-width:1}.hn-notetext{fill:var(--hn-text);font-size:11px;font-weight:500}.hn-alt{fill:var(--hn-sub);font-size:11px;font-weight:600}.hn-alt.hn-bad,.hn-steps .hn-bad{fill:var(--hn-bad);color:var(--hn-bad)}.hn-badline{stroke:var(--hn-bad)}.hn-label.hn-bad{fill:var(--hn-bad)}.hn-start{fill:var(--hn-edge)}.hn-badfill{fill:var(--hn-bad)}.hn-frame{fill:var(--hn-group);stroke:var(--hn-group-line);stroke-width:1;stroke-dasharray:5 5}.hn-frame-split{stroke:var(--hn-group-line);stroke-width:1;stroke-dasharray:5 5}@media (prefers-reduced-motion: reduce){.hn-dot{display:none}}.hn-diagram .hn-narrow{display:none}@media (max-width: 767px){.hn-diagram .hn-wide{display:none}.hn-diagram .hn-narrow{display:block}.hn-diagram .hn-steps.hn-narrow{display:flex}}.hn-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px;counter-reset:hn}.hn-step{counter-increment:hn;display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding-left:30px;position:relative}.hn-step::before{content:counter(hn);position:absolute;left:0;top:1px;width:20px;height:20px;border-radius:999px;border:1px solid var(--hn-edge);color:var(--hn-sub);font-size:11px;font-weight:600;display:flex;align-items:center;justify-content:center}.hn-chip{font-size:12px;font-weight:600;padding:2px 8px;border-radius:999px;background:var(--hn-node);border:1px solid var(--hn-node-line);color:var(--hn-text)}.hn-chip-ours{background:var(--hn-ours);border-color:var(--hn-ours-line)}.hn-arrow{color:var(--hn-sub);font-size:12px}.hn-steptext{flex-basis:100%;font-size:14px;color:var(--hn-text)}.hn-steps-alt{font-size:12px;font-weight:600;color:var(--hn-sub);padding-top:4px}.hn-steps-note{font-size:13px;color:var(--hn-text);background:var(--hn-ours);border:1px solid var(--hn-ours-line);border-radius:10px;padding:8px 12px}.hn-tech td:first-child{padding-left:96px!important;text-indent:-84px}.hn-logo,.hn-logo-space{display:inline-block;width:72px;height:18px;margin:0 8px 0 0;vertical-align:-4px;text-indent:0}.hn-logo{object-fit:contain;object-position:left center}.hn-word{height:16px;vertical-align:-3px}.hn-mark{height:22px;vertical-align:-6px}.hn-on-dark{display:none}html.dark .hn-on-light{display:none}html.dark .hn-on-dark{display:inline-block}html.dark .hn-invert{filter:invert(1)}@media (max-width: 767px){.hn-tech td:first-child{padding-left:12px!important;text-indent:0}.hn-logo-space{display:none}.hn-logo{display:block;margin:0 0 6px}.hn-logo.hn-on-dark{display:none}html.dark .hn-logo.hn-on-light{display:none}html.dark .hn-logo.hn-on-dark{display:block}}.hn-icons td:first-child{padding-left:48px!important;text-indent:-36px}.hn-icons .hn-logo,.hn-icons .hn-logo-space{width:24px;height:24px;margin-right:8px;vertical-align:-7px}@media (max-width: 767px){.hn-icons td:first-child{padding-left:48px!important;text-indent:-36px}.hn-icons .hn-logo,.hn-icons .hn-logo-space{display:inline-block;margin:0 8px 0 0}}table thead:not(:has(th:not(:empty))){display:none}"}]}
{"page":{"pagePath":"how-it-works","slug":"/how-it-works","pageMetadata":{"title":"How it works","description":"The parts of HelloPie and how one payment goes from a chat message to a Base transaction.","href":"/how-it-works"},"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: \"The parts of HelloPie and how one payment goes from a chat message to a Base transaction.\"\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];const __snippet_ACTORS_1uub5r5=[`Owner`,`Mind`,`NEAR AI Cloud`,`Backend`,`Mind account`,`Base`];const __snippet_STEPS_1uub5r5=[{f:0,t:1,text:`\"Pay 1.50 USDC to 0xAb12…cd34\"`},{f:1,t:2,text:`model call (streamed)`},{f:2,t:1,text:`tool call check_address`,back:true},{f:1,t:5,text:`RPC: code and balances of 0xAb12…cd34`},{f:5,t:1,text:`plain wallet, balances`,back:true},{f:2,t:1,text:`tool call send_payment`,back:true},{note:1,text:`requireApproval: the run pauses (unless an owner rule covers it)`},{f:1,t:0,text:`approval card: amount, recipient, checks`,back:true},{f:0,t:3,text:`Approve`},{f:3,t:1,text:`resume the run`},{f:1,t:3,text:`/internal/v1/wallet/send_payment (wallet token)`},{note:3,text:`daily cap checked here, off chain`},{alt:`Inside the daily cap and the role's allowlist`},{f:3,t:4,text:`ERC-20 transfer via the Mind role (relayer broadcasts)`},{f:4,t:5,text:`transaction`},{f:5,t:3,text:`tx hash`,back:true},{f:3,t:1,text:`sent + txHash`,back:true},{alt:`Over the daily cap (backend), or a target not allowed (on chain)`,bad:true},{f:4,t:3,text:`TargetNotWhitelisted / NoPermission`,back:true,bad:true},{f:3,t:1,text:`limit_exceeded / not_allowed`,back:true,bad:true},{end:true},{f:1,t:0,text:`receipt (or \"refused, no money moved\")`,back:true},{f:1,t:2,text:`fetch signatures + attestation`},{note:1,text:`run.verified: the badge shows only if every step matches the attested key`},{f:3,t:5,text:`Credits.charge for the reply (unique ref)`}];const PaymentSteps=()=>{const W=800;const gutter=40;const colX=i=>gutter+64+i*128;const row=34;let y=60;const rows=__snippet_STEPS_1uub5r5.map(s=>{const r={s,y};y+=s.end?14:s.alt?28:row;return r});const height=y+16;const altStart=rows.find(r=>r.s.alt\u0026\u0026!r.s.bad);const altElse=rows.find(r=>r.s.alt\u0026\u0026r.s.bad);const altEnd=rows.find(r=>r.s.end);let n=0;return _jsxs(`div`,{className:`hn-diagram not-prose`,children:[_jsxs(`svg`,{viewBox:`0 0 ${W} ${height}`,className:`hn-canvas hn-wide`,role:`img`,\"aria-label\":`One payment, call by call: the steps listed below for phones and screen readers.`,children:[__snippet_ACTORS_1uub5r5.map((a,i)=>_jsxs(`g`,{children:[_jsx(`line`,{x1:colX(i),y1:42,x2:colX(i),y2:height-6,className:`hn-life`}),_jsx(`rect`,{x:colX(i)-56,y:6,width:`112`,height:`34`,rx:`10`,className:i===1||i===3?`hn-node hn-ours`:`hn-node`}),_jsx(`text`,{x:colX(i),y:27.5,textAnchor:`middle`,className:`hn-title`,children:a})]},a)),altStart\u0026\u0026altEnd?_jsxs(`g`,{children:[_jsx(`rect`,{x:gutter+4,y:altStart.y+2,width:W-gutter-8,height:altEnd.y-altStart.y+4,rx:`12`,className:`hn-frame`}),altElse?_jsx(`line`,{x1:gutter+4,y1:altElse.y+2,x2:W-4,y2:altElse.y+2,className:`hn-frame-split`}):null]}):null,rows.map(({s,y},i)=>{if(s.end)return null;if(s.alt)return _jsxs(`text`,{x:gutter+16,y:y+19,className:s.bad?`hn-alt hn-bad`:`hn-alt`,children:[s.bad?`Otherwise: `:``,s.alt]},i);if(s.note!==undefined)return _jsxs(`g`,{children:[_jsx(`rect`,{x:colX(s.note)-56,y:y+5,width:W-colX(s.note)+56-120,height:`24`,rx:`8`,className:`hn-note`}),_jsx(`text`,{x:colX(s.note)-44,y:y+21,className:`hn-notetext`,children:s.text})]},i);n+=1;const x1=colX(s.f),x2=colX(s.t),dir=x2>x1?1:-1,yy=y+24;const w=s.text.length*5.7;const cx=Math.min(W-6-w/2,Math.max(gutter+8+w/2,(x1+x2)/2));return _jsxs(`g`,{children:[_jsx(`circle`,{cx:gutter/2,cy:yy-4,r:`9`,className:`hn-num`}),_jsx(`text`,{x:gutter/2,y:yy-.5,textAnchor:`middle`,className:`hn-numtext`,children:n}),_jsx(`circle`,{cx:x1,cy:yy,r:`3`,className:s.bad?`hn-start hn-badfill`:`hn-start`}),_jsx(`line`,{x1,y1:yy,x2:x2-dir*2,y2:yy,className:`hn-edge ${s.back?`hn-dashed`:``} ${s.bad?`hn-badline`:``}`}),_jsx(`path`,{d:`M${x2-dir*8},${yy-4} L${x2},${yy} L${x2-dir*8},${yy+4}`,className:`hn-head ${s.bad?`hn-badline`:``}`}),_jsx(`text`,{x:cx,y:yy-8,textAnchor:`middle`,className:s.bad?`hn-label hn-bad`:`hn-label`,children:s.text})]},i)})]}),_jsx(`ol`,{className:`hn-narrow hn-steps`,children:__snippet_STEPS_1uub5r5.filter(s=>!s.end).map((s,i)=>s.alt?_jsxs(`li`,{className:s.bad?`hn-steps-alt hn-bad`:`hn-steps-alt`,children:[s.bad?`Otherwise: `:``,s.alt]},i):s.note!==undefined?_jsx(`li`,{className:`hn-steps-note`,children:s.text},i):_jsxs(`li`,{className:`hn-step`,children:[_jsx(`span`,{className:`hn-chip ${s.f===1||s.f===3?`hn-chip-ours`:``}`,children:__snippet_ACTORS_1uub5r5[s.f]}),_jsx(`span`,{className:`hn-arrow`,\"aria-label\":`to`,children:`→`}),_jsx(`span`,{className:`hn-chip ${s.t===1||s.t===3?`hn-chip-ours`:``}`,children:__snippet_ACTORS_1uub5r5[s.t]}),_jsx(`span`,{className:`hn-steptext ${s.bad?`hn-bad`:``}`,children:s.text})]},i))})]})};const __snippet_anchor_1uub5r5=(n,side,f=.5)=>side===`l`?[n.x,n.y+n.h*f,-1,0]:side===`r`?[n.x+n.w,n.y+n.h*f,1,0]:side===`t`?[n.x+n.w*f,n.y,0,-1]:[n.x+n.w*f,n.y+n.h,0,1];const __snippet_link_1uub5r5=(e,a,b)=>{const[x1,y1,dx1,dy1]=__snippet_anchor_1uub5r5(a,e.fs,e.ff);const[x2,y2,dx2,dy2]=__snippet_anchor_1uub5r5(b,e.ts,e.tf);const k=Math.max(28,Math.hypot(x2-x1,y2-y1)*.4);const c1=[x1+dx1*(e.k1??k),y1+dy1*(e.k1??k)];const c2=[x2+dx2*(e.k2??k),y2+dy2*(e.k2??k)];const t=e.t??.5,u=1-t;const at=(p,q,r,s2)=>u*u*u*p+3*u*u*t*q+3*u*t*t*r+t*t*t*s2;const mid=[at(x1,c1[0],c2[0],x2),at(y1,c1[1],c2[1],y2)];return{d:`M${x1},${y1} C${c1[0]},${c1[1]} ${c2[0]},${c2[1]} ${x2},${y2}`,mid,end:[x2,y2,dx2,dy2]}};const __snippet_Node_1uub5r5=({n})=>_jsxs(`g`,{children:[_jsx(`rect`,{x:n.x,y:n.y,width:n.w,height:n.h,rx:`12`,className:n.ours?`hn-node hn-ours`:`hn-node`}),_jsx(`text`,{x:n.x+14,y:n.y+(n.sub?22:n.h/2+4.5),className:`hn-title`,children:n.title}),(n.sub||[]).map((line,i)=>_jsx(`text`,{x:n.x+14,y:n.y+38+i*14,className:n.mono?`hn-sub hn-mono`:`hn-sub`,children:line},i))]});const __snippet_Edge_1uub5r5=({e,nodes,i})=>{const{d,mid,end}=__snippet_link_1uub5r5(e,nodes[e.from],nodes[e.to]);const[x,y,dx,dy]=end;const ax=-dx,ay=-dy,px=-ay,py=ax;const head=`M${x+dx*7+px*4},${y+dy*7+py*4} L${x},${y} L${x+dx*7-px*4},${y+dy*7-py*4}`;const w=e.label?e.label.length*5.6+12:0;return _jsxs(`g`,{children:[_jsx(`path`,{d,className:e.dashed?`hn-edge hn-dashed`:`hn-edge`}),_jsx(`path`,{d:head,className:`hn-head`}),e.dashed?null:_jsx(`circle`,{r:`2.6`,className:`hn-dot`,children:_jsx(`animateMotion`,{dur:`${2.6+i%4*.35}s`,begin:`${i*.45%2.4}s`,repeatCount:`indefinite`,path:d})}),e.label?_jsxs(`g`,{children:[_jsx(`rect`,{x:mid[0]-w/2,y:mid[1]-9,width:w,height:`18`,rx:`9`,className:`hn-pill`}),_jsx(`text`,{x:mid[0],y:mid[1]+3.5,textAnchor:`middle`,className:`hn-label`,children:e.label})]}):null]})};const __snippet_Group_1uub5r5=({g})=>_jsxs(`g`,{children:[_jsx(`rect`,{x:g.x,y:g.y,width:g.w,height:g.h,rx:`16`,className:`hn-group`}),_jsx(`text`,{x:g.end?g.x+g.w-14:g.x+14,y:g.y+20,textAnchor:g.end?`end`:`start`,className:`hn-glabel`,children:g.label})]});const __snippet_Canvas_1uub5r5=({width,height,nodes,edges,groups,label,className})=>_jsxs(`svg`,{viewBox:`0 0 ${width} ${height}`,className:`hn-canvas ${className}`,role:`img`,\"aria-label\":label,children:[(groups||[]).map((g,i)=>_jsx(__snippet_Group_1uub5r5,{g},i)),edges.map((e,i)=>_jsx(__snippet_Edge_1uub5r5,{e,nodes,i},i)),Object.values(nodes).map((n,i)=>_jsx(__snippet_Node_1uub5r5,{n},i))]});const __snippet_ARCH_LABEL_1uub5r5=`HelloPie's parts. The owner chats and approves in the web app or Telegram, which talk to the backend API; the owner's own wallet signs in (SIWE), tops up credits and owns the Mind's Bloxchain governed account. The backend sends each Mind's config and skills to the engine (Mastra): one generic Mind agent, tools granted by equipped skills, and Builder workflows with Autopilot. The engine calls NEAR AI Cloud for every model call, the buy marketplace catalog, Composio for apps, and the Base RPC for read-only checks. The backend checks the owner's daily cap, then its relayer broadcasts money moves through the Mind's role on the governed account, which enforces the contract and function allowlist on Base; it also charges each reply on the Credits contract, and uploads Intel quotes to Phala's TEE Explorer.`;const Architecture=()=>{const D={web:{x:0,y:30,w:132,h:54,title:`Web app`,sub:[`chat, approve`],ours:true},tg:{x:0,y:98,w:132,h:54,title:`Telegram bot`,sub:[`chat, approve`],ours:true},owner:{x:0,y:166,w:132,h:54,title:`Owner's wallet`,sub:[`signs in, owns account`]},be:{x:200,y:64,w:150,h:70,title:`Backend API`,sub:[`SIWE sign-in,`,`runs, approvals`],ours:true},agent:{x:445,y:40,w:150,h:56,title:`Mind agent`,sub:[`persona, memory, skills`],ours:true},tools:{x:445,y:110,w:150,h:56,title:`Tools`,sub:[`only equipped skills`],ours:true},wf:{x:445,y:180,w:150,h:56,title:`Workflows`,sub:[`Builder, Autopilot`],ours:true},nai:{x:670,y:16,w:150,h:54,title:`NEAR AI Cloud`,sub:[`TEE inference`]},market:{x:670,y:82,w:150,h:54,title:`buy marketplace`,sub:[`x402 services`]},composio:{x:670,y:148,w:150,h:54,title:`Composio`,sub:[`Gmail, Calendar, more`]},rpc:{x:670,y:214,w:150,h:54,title:`Base RPC`,sub:[`address, tx checks`]},chain:{x:0,y:344,w:132,h:54,title:`Base Sepolia`,sub:[`transactions`]},account:{x:200,y:336,w:150,h:70,title:`Bloxchain account`,sub:[`Mind role,`,`allowlist on chain`]},phala:{x:445,y:336,w:150,h:70,title:`Phala TEE`,sub:[`Explorer`]},credits:{x:670,y:336,w:150,h:70,title:`Credits contract`,sub:[`pay as you go`]}};const E=[{from:`web`,fs:`r`,to:`be`,ts:`l`,tf:.35},{from:`tg`,fs:`r`,to:`be`,ts:`l`,tf:.65},{from:`be`,fs:`r`,ff:.35,to:`agent`,ts:`l`,label:`config + skills`,t:.45},{from:`tools`,fs:`l`,to:`be`,ts:`r`,tf:.75,label:`wallet routes`,dashed:true,t:.5},{from:`agent`,fs:`b`,to:`tools`,ts:`t`},{from:`wf`,fs:`t`,to:`tools`,ts:`b`},{from:`agent`,fs:`r`,to:`nai`,ts:`l`,label:`model calls`},{from:`tools`,fs:`r`,ff:.3,to:`market`,ts:`l`,label:`catalog`},{from:`tools`,fs:`r`,ff:.55,to:`composio`,ts:`l`},{from:`tools`,fs:`r`,ff:.8,to:`rpc`,ts:`l`},{from:`owner`,fs:`b`,to:`account`,ts:`t`,tf:.25,label:`owns`,t:.45},{from:`be`,fs:`b`,ff:.6,to:`account`,ts:`t`,tf:.65,label:`relayer request`},{from:`account`,fs:`l`,to:`chain`,ts:`r`},{from:`be`,fs:`b`,ff:.85,to:`phala`,ts:`t`,k1:170,k2:40,label:`Intel quote`,t:.72},{from:`be`,fs:`b`,ff:.95,to:`credits`,ts:`t`,k1:185,k2:40,label:`charge`,dashed:true,t:.8}];const DG=[{x:430,y:0,w:180,h:250,label:`Engine (Mastra)`}];const M={web:{x:0,y:0,w:108,h:40,title:`Web app`,ours:true},tg:{x:122,y:0,w:108,h:40,title:`Telegram`,ours:true},owner:{x:244,y:0,w:116,h:40,title:`Owner wallet`},be:{x:50,y:92,w:180,h:70,title:`Backend API`,sub:[`SIWE sign-in,`,`runs, approvals`],ours:true},agent:{x:24,y:244,w:150,h:56,title:`Mind agent`,sub:[`persona, memory`],ours:true},tools:{x:186,y:244,w:150,h:56,title:`Tools`,sub:[`equipped skills`],ours:true},wf:{x:186,y:314,w:150,h:56,title:`Workflows`,sub:[`Builder, Autopilot`],ours:true},nai:{x:0,y:432,w:172,h:54,title:`NEAR AI Cloud`,sub:[`TEE inference`]},market:{x:188,y:432,w:172,h:54,title:`buy marketplace`,sub:[`x402 services`]},composio:{x:0,y:498,w:172,h:54,title:`Composio`,sub:[`Gmail, Calendar`]},rpc:{x:188,y:498,w:172,h:54,title:`Base RPC`,sub:[`address, tx checks`]},account:{x:0,y:610,w:172,h:54,title:`Bloxchain account`,sub:[`owned by the owner`]},chain:{x:188,y:610,w:172,h:54,title:`Base Sepolia`},phala:{x:0,y:676,w:172,h:54,title:`Phala TEE`,sub:[`Explorer`]},credits:{x:188,y:676,w:172,h:54,title:`Credits contract`,sub:[`pay as you go`]}};const ME=[{from:`web`,fs:`b`,to:`be`,ts:`t`},{from:`tg`,fs:`b`,to:`be`,ts:`t`,label:`chat, approve`},{from:`be`,fs:`b`,to:`agent`,ts:`t`,label:`config + skills`},{from:`agent`,fs:`r`,to:`tools`,ts:`l`},{from:`wf`,fs:`t`,to:`tools`,ts:`b`},{from:`agent`,fs:`b`,to:`nai`,ts:`t`,label:`model calls`,t:.72},{from:`tools`,fs:`r`,to:`market`,ts:`t`,tf:.88,k1:22,k2:70},{from:`account`,fs:`r`,to:`chain`,ts:`l`}];const MG=[{x:10,y:206,w:340,h:176,label:`Engine (Mastra)`,end:true},{x:-6,y:586,w:372,h:152,label:`Wallet, proofs and credits (from the backend)`}];return _jsxs(`div`,{className:`hn-diagram not-prose`,children:[_jsx(__snippet_Canvas_1uub5r5,{width:820,height:410,nodes:D,edges:E,groups:DG,label:__snippet_ARCH_LABEL_1uub5r5,className:`hn-wide`}),_jsx(__snippet_Canvas_1uub5r5,{width:360,height:740,nodes:M,edges:ME,groups:MG,label:__snippet_ARCH_LABEL_1uub5r5,className:`hn-narrow`})]})};function _createMdxContent(props){const _components={hr:`hr`,..._provideComponents(),...props.components},{Heading,_MdxComponentBoundary}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`the-parts`,children:`The parts`}),`\n`,_jsx(_MdxComponentBoundary,{name:`Architecture`,children:_jsx(Architecture,{})}),`\n`,_jsx(Heading,{level:`2`,id:`one-payment-call-by-call`,children:`One payment, call by call`}),`\n`,_jsx(_MdxComponentBoundary,{name:`PaymentSteps`,children:_jsx(PaymentSteps,{})}),`\n`,_jsx(_components.hr,{})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{__snippet_ACTORS_1uub5r5,__snippet_STEPS_1uub5r5,PaymentSteps,__snippet_anchor_1uub5r5,__snippet_link_1uub5r5,__snippet_Node_1uub5r5,__snippet_Edge_1uub5r5,__snippet_Group_1uub5r5,__snippet_Canvas_1uub5r5,__snippet_ARCH_LABEL_1uub5r5,Architecture,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":"How it works","description":"The parts of HelloPie and how one payment goes from a chat message to a Base transaction.","href":"/how-it-works"}}},"mdxSourceWithNoJs":null,"noJsSplices":[[159,12279,"undefined;const __snippet_STEPS_1uub5r5=undefined;const PaymentSteps=()=>null;const __snippet_anchor_1uub5r5=()=>null;const __snippet_link_1uub5r5=()=>null;const __snippet_Node_1uub5r5=()=>null;const __snippet_Edge_1uub5r5=()=>null;const __snippet_Group_1uub5r5=()=>null;const __snippet_Canvas_1uub5r5=()=>null;const __snippet_ARCH_LABEL_1uub5r5=undefined;const Architecture=()=>null;function _create"]]},"mdxExtracts":{"tableOfContents":[{"title":"The parts","slug":"the-parts","depth":2,"children":[]},{"title":"One payment, call by call","slug":"one-payment-call-by-call","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/localhost/4279fdd7e324880f/title.js"],"subdomain":"localhost","siteName":"HelloPie","title":"How it works - HelloPie","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"originalFileLocation":"how-it-works.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=\"The parts of HelloPie and how one payment goes from a chat message to a Base transaction.\">\u003cmeta data-mint-head name=\"application-name\" content=\"HelloPie\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/favicons/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicons/favicon-32x32.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicons/favicon-16x16.png\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicons/favicon.ico\">\u003cmeta data-mint-head property=\"og:title\" content=\"How it works - HelloPie\">\u003cmeta data-mint-head property=\"og:description\" content=\"The parts of HelloPie and how one payment goes from a chat message to a Base transaction.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"HelloPie\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://local./how-it-works\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"How it works - HelloPie\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"The parts of HelloPie and how one payment goes from a chat message to a Base transaction.\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/favicons/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"HelloPie\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3E5C00\">\u003clink data-mint-head rel=\"canonical\" href=\"https://local./how-it-works\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/how-it-works.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"HelloPie\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"HelloPie\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/how-it-works.md","siteName":"HelloPie","nav":{"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Introduction","href":""},{"title":"Quickstart","description":"Try HelloPie in the web app with your wallet, or drive it with curl through the public API.","href":"/quickstart"},{"title":"How it works","href":"/how-it-works"},{"title":"Tech stack","description":"What is used where: Base, Bloxchain, ERC-8004, ENS, Uniswap, x402, LI.FI, NEAR AI Cloud, Mastra and the rest.","href":"/tech-stack"}]},{"group":"Concepts","pages":[{"title":"Minds and templates","href":"/minds"},{"title":"Skills and tools","href":"/skills"},{"title":"Wallet, limits and approvals","href":"/wallet-and-approvals"},{"title":"Pay as you go","href":"/credits"},{"title":"Agent identity","href":"/identity"},{"title":"Verified replies","href":"/verified-replies"},{"title":"Privacy: what is kept","href":"/privacy"},{"title":"Security: audited and attacked by the team","href":"/security"},{"title":"Autopilot and Builder","href":"/autopilot"},{"title":"Telegram","href":"/telegram"},{"title":"Connections and keys","href":"/connections"},{"title":"The agent","href":"/agent"}]},{"group":"Features","pages":[{"title":"What HelloPie built for the hackathon","href":"/tracks"},{"title":"Hire an agent (buy marketplace)","href":"/agent-market"},{"title":"Contract check before paying","href":"/contract-check"},{"title":"Payments CSV","href":"/payments-csv"}]},{"group":"API","pages":[{"title":"API reference","href":"/api-reference"},{"title":"API overview","href":"/api"},{"title":"Streaming events","href":"/events"},{"title":"Errors","href":"/errors"},{"title":"Status","href":"/status"}]},{"group":"Smart contracts","pages":[{"title":"Receipts and smart contracts","href":"/contracts"}]},{"group":"More","pages":[{"title":"Run locally","href":"/run-locally"},{"title":"Connectors","href":"/connectors"},{"title":"Testnet phase and roadmap","href":"/hackathon-phase"}]}]},{"tab":"Endpoints","pages":[{"title":"Endpoints","href":"/api-reference/system/health-of-the-backend-and-the-engine"}]}]},"basePath":"","title":"How it works - HelloPie","buildId":"bf4acad72252","dynamics":[],"chunks":[]}