Rialo-native protocolDevNet / Live reference

Small surface.Clear trust.

Follow GitHub identity verification, sponsor-approved escrow funding, policy-checked payout, and deadline refund.

Active DevNet programLive
Marketplace program
01 / Flow

Execution flow

The sponsor selects Verify target before creating a workflow PDA, locking the public PR head SHA, target branch, reward, deadline, and optional CI or approval requirements. The contributor authenticates with GitHub; Verify PR matches the numeric user ID to the public PR author before the contributor signs a separate claim PDA. The sponsor page discovers confirmed claims and shows the identity, wallet, exact terms, claim account, and source transaction. Multiple matches require an explicit choice. The app re-fetches the author ID before sponsor approval locks the beneficiary.

Approval and funding are separate transactions. Funding submits prepare_funding and fund together in one atomic transaction: storage is prepared before the exact reward is transferred. Funding then arms the native Rialo heartbeat. Claim, approval, preparation, and funding must all occur before the immutable deadline.

The native workflow rechecks the deadline and requests GitHub proof through REX without another sponsor click. Payout requires the locked policy to pass and the proof callback to execute before the deadline. Otherwise, an unpaid funded workflow follows the deadline refund branch. The detail page polls decoded state while visible and reconciles on return; browser visibility affects display updates, not native execution.

  1. 01
    PublishSponsor
    create_bounty

    Commit the public PR, head SHA, target branch, CI and review policy, exact reward, deadline, and open beneficiary state.

  2. 02
    AuthorizeContributor + sponsor
    request_claimaccept_claim

    GitHub OAuth and Verify PR are offchain application steps. request_claim records the proposal; accept_claim locks the beneficiary after the sponsor app rechecks the PR author.

  3. 03
    Lock escrowSponsor
    prepare_fundingfund

    Prepare storage and transfer the exact bounty in one atomic funding transaction, then arm native settlement.

  4. 04
    SettleRialo runtime
    run_merge_checkhandle_merge_response

    Native timers run the deadline check and request proof. The REX callback validates the report, policy, and accounts before any payout.

    VALID PROOF · BEFORE DEADLINEpaid = trueDEADLINE · NO PAYOUTrefunded = true
02 / Roles

Account roles

Sponsor
Publishes the locked terms, reviews and approves a contributor claim, and funds escrow. May request a check while active before expiry, or request refund after the deadline.
Contributor claim PDA
Records the claimant wallet, declared GitHub login and numeric user ID, and the bounty it targets. The web app verifies the author ID before the sponsor approves the proposal.
Workflow PDA
Persists immutable PR revision and policy, reward, deadline, approved beneficiary, timers, observed proof, and terminal flags.
Rialo runtime
Re-arms the native heartbeat, queries GitHub through REX, and delivers validator reports to the callback.
Beneficiary
Receives the exact committed reward only after a policy-passing proof, matching accounts, and a valid callback before the deadline.
03 / Signal

GitHub signal

The custom REX WASM verifier first reads the public PR and compares its head SHA and target branch with the locked terms. It reads CI or review endpoints only after the PR is merged and only when the corresponding policy is enabled. The callback requires all outputs in the received REX report to be usable and identical; this is a check of that report, not a claim that the app independently queried every validator in the network.

GET /repos/{owner}/{repo}/pulls/{number}
GET /repos/{owner}/{repo}/commits/{headSha}/status
GET /repos/{owner}/{repo}/commits/{headSha}/check-runs?filter=latest&per_page=100
GET /repos/{owner}/{repo}/pulls/{number}/reviews?per_page=100

CI policy. At least one status or check run must exist. Existing commit statuses must report success; latest check runs must be completed with a success, neutral, or skipped conclusion. Pending or failed signals do not pass. A response requiring check-run pagination is inconclusive.

Review policy. The verifier uses the latest decisive review per numeric reviewer ID. An approval counts only when its state is APPROVED, its commit matches the locked SHA, and GitHub reports OWNER, MEMBER, or COLLABORATOR association. COMMENTED and PENDING reviews do not count. This association check is not a separate live repository-permission lookup. Review responses requiring another page are inconclusive.

The compact MP1 proof carries the status code, observed head SHA, merge commit, CI result, approval count, and target branch. The callback rejects oversized proofs and rechecks the fields against the workflow before moving funds.

MP1 / 6The received report agrees on a policy-passing proof. Payout still requires valid accounts and a callback before the deadline.
MP1 / 1–5Unmerged PR (1), head mismatch (2), branch mismatch (3), unmet CI (4), or too few approvals (5). No payout is authorized.
INCONCLUSIVEEmpty, inconsistent, oversized, malformed, or pagination-limited results cannot authorize payout. Native checks continue until the deadline.
04 / Trust

Settlement & limits

The native heartbeat owns both terminal paths. Payout requires matching head SHA and branch, a valid merge commit, any selected CI and approval requirements, and a usable, consistent REX report processed before the deadline. Once a funded workflow reaches its deadline without payout, run_merge_check executes the sponsor refund branch. Paid and refunded are mutually exclusive outcomes; terminal guards prevent a second escrow release.

DEADLINE RULE

The deadline is an absolute time fixed by create_bounty; funding does not restart the deadline. The form interprets the date in the browser's local time zone and stores Unix milliseconds onchain. A proof callback at or after the deadline cannot pay, even if GitHub recorded the merge earlier. Leave time for claim, approval, funding, CI, and REX processing, not just the merge itself.

Timing and display. The current native heartbeat re-arms after about two seconds and requests proof on a five-second schedule, with a five-second REX collection window. These are scheduling settings, not a guaranteed merge-to-payout time. The UI reads state independently; a slow RPC or decoder error does not stop native settlement.

Manual fallbacks. check_merge schedules a fresh proof check only for an active funded workflow before expiry. It is rejected after the deadline or a terminal outcome. Sponsor refund is available after expiry; repeating it on an already-refunded workflow returns without another transfer. These controls do not bypass policy. Each terminal workflow exposes a shareable receipt with the reward, destination, remaining account balance, and decoded outcome.

POLICY PASSESAutomatic payoutValid callback before deadline
DEADLINE · UNPAIDAutomatic refundFunded escrow returns to sponsor
TERMINAL GUARDSNo double releaseAlready-refunded retries do not transfer again
AUTH BOUNDARY

GitHub OAuth verifies contributor identity when the claim is created. MergePay then issues a five-minute, one-time authorization bound to the OAuth session, numeric GitHub ID, receiving wallet, exact PR, and derived claim account. A session, wallet, or target change requires fresh verification. Sponsor review re-fetches the public PR and compares the stable numeric author ID again, failing closed if GitHub is unavailable or disagrees. These OAuth checks are application gates; the onchain program independently enforces sponsor authority, account ownership, exact terms, and the beneficiary lock. Public merge settlement uses fixed non-secret headers and requires no GitHub App installation token or private key.

MergePay remains an unaudited DevNet MVP. It trusts the tested Rialo runtime, REX validators, and GitHub's public REST responses. Its current product boundary is intentionally narrow:

  • DevNet and test RLO only
  • Public GitHub repositories only
  • One PR and beneficiary per workflow
  • Native RLO escrow only
  • Settlement does not close the workflow or return its remaining storage balance
  • Transaction and storage costs are separate from the bounty principal
  • Embedded wallet is browser-local and limited to DevNet
  • GitHub polling and REX execution are asynchronous; no instant-settlement guarantee
  • CI and reviews are payment conditions, not a guarantee of code quality or security
  • Live sponsor-side author review is enforced by the web app, not a new REX assertion in the approval instruction