Application Flow

1. User Interface & Onboarding
Build Request UI Developers log in with their Sui wallet and GitHub account, then pick a repository, branch/commit, and define their pipeline (build/test commands, artifact paths). The web app packages this into a JSON job descriptor and submits it to the backend.
Upfront Payment UI Before the build starts, the user tops up their build-credit vault on Sui. The frontend invokes Wormhole’s Native Token Transfer (NTT) API to lock tokens on the user’s home chain and mint equivalent credits on Sui.
2. Payment Processing
Token Lock/Burn The NttManager contract on the source chain locks or burns the specified amount (e.g., LogiToken or a stablecoin).
Wormhole VAA Emission A cross-chain message is emitted containing
{amount, recipientChain: SUI, recipientAddress}.Guardian Validation Wormhole’s guardian network observes the lock event, verifies it, and signs a Verifiable Action Approval (VAA).
VAA Relaying A relayer submits the VAA to the Sui NttManager via
complete_transfer(VAA).Credit Minting The Sui NttManager mints or unlocks the user’s build-credit tokens, updating their on-chain balance.
3. Backend Orchestration
Webhook & API Listener The backend (Node.js/Express) listens for GitHub push/PR webhooks or manual “start build” API calls. It verifies the user’s on-chain credit and persists the job descriptor (including config CID).
Runner Selection It queries the
RunnerRegistryMove module to list active runner operators, filtering by minimum stake, geographic proximity, and historical performance metrics.Job Assignment The backend writes a
BuildJobobject to theJobQueueMove module on Sui, embedding{repo, commit, configCID, requesterAddress}. This on-chain object triggers runner nodes to pick up the job.
4. Runner Operator Node
Node Registration & Staking Operators run a CLI command that calls
RunnerRegistry::register_runner(operatorKey, stakeAmount), locking SUI tokens and emitting aRunnerRegisteredevent.Job Polling & Execution The runner polls Sui for new
BuildJobevents via RPC. Upon detecting a job, it clones the repo at the specified commit, spins up a sandboxed container, and runs the configured build/test commands.Artifact Hashing & Attestation After completion, it computes a Merkle root of all output files, signs the payload using its operator key, and calls
Attestation::create_attestation(jobId, artifactRoot, signature). The Move module stores a tamper-proof record and emits anAttestationCreatedevent.
5. On-Chain Attestation Storage
Attestation Recording The
Attestationmodule on Sui writes the signed record into its ledger, ensuring immutability.Cross-Chain Message Emission In the same transaction, it publishes a Wormhole message carrying the attestation payload for cross-chain distribution.
6. Cross-Chain Verification
Guardian Signing Wormhole’s guardians observe the attestation message and produce a signed VAA.
Relaying to Target Chains A relayer delivers the VAA to consumer contracts on other chains (e.g., Ethereum), where they verify the guardian signatures and store the attestation for local verification.
7. Final Billing & Settlement
Usage Calculation After the build, the
Billingmodule on Sui calculates actual resource usage (CPU-seconds, memory, storage).Comparison & Top-Up / Refund
If actual usage exceeds the upfront payment, the frontend triggers an additional NTT transfer for the difference.
If usage is below the upfront payment, the excess can be retained as credit or refunded.
Settlement The
Billingmodule finalizes the job by deducting the exact cost from the user’s vault and distributing payments to the runner’s payout vault.
Key Insights
Decoupled Compute vs. Settlement: Build execution happens off-chain; staking, attestations, and billing are all on-chain in modular Move contracts.
Economic Incentives: Operators stake SUI to participate; users prepay to guarantee resource availability and prevent abuse.
Cross-Chain Interoperability: Wormhole NTT ensures seamless, secure token transfers for billing, while Wormhole Messaging propagates attestations across chains.
End-to-End Verifiability: Every build, payment, and attestation is recorded on-chain and/or via VAA, allowing trustless verification anywhere in the ecosystem.
Last updated