LPsLux Proposals
Governance & Impact
LP-20

Work Market

Final

On-chain funded-contribution market — bounties, escrow, contribution reputation, and sub-DAO task spaces over @luxfi/standard, white-labelled per org

LP-0020: Work Market

Abstract

The work market is the on-chain layer for funding open-source contribution: a permissionless, two-sided market where anyone posts a funded task and anyone may take it on, deliver, and be paid from escrow — with the outcome recorded to a portable contribution-reputation ledger that mints global Karma. It is not a new framework: it is a set of audited modules in @luxfi/standard, consumed by every org DAO exactly as the white-label DAO deployment pattern prescribes, white-labelled by domain. The canonical governance and work surface is work.<org>.network, which reads the on-chain market directly; the earlier <org>.vote shells converge onto it.

There is one and only one version of each contract. Reward classes (native, ERC-20, ERC-721, ERC-1155) and Karma-mint-on-completion are features of the canonical spec, not a future revision.

Motivation

  • Fund contribution on-chain. Open-source work — a GitHub issue, an audit, a design — becomes a funded bounty whose reward is held in escrow the moment it is posted. A delivered worker is always paid; a funder can always recover unclaimed funds. No trusted intermediary sits on the money path.
  • Portable, composable reputation. Every accepted completion is written to a non-transferable ledger any contract or UI can read, and bridges a flat award into global Karma — the network-wide reputation spine.
  • Converge the governance surface. The <org>.vote front-ends were shells that read zero chain state. The genuinely live surface is work.<org>.network, which reads the market as the record of what happened. This LP makes work.<org>.network canonical and folds vote into it: one surface per org, white-labelled by hostname.
  • One canonical way. The market is the same audited module set on every chain (Lux, Zoo, Hanzo, Pars); only the per-chain deployment status differs.

Architecture

The work market follows the white-label DAO deployment pattern (lp-2800) verbatim: the contracts are audited modules in the single @luxfi/standard tree; each org DAO consumes them via Foundry remappings and a brand wrapper, and deploys with the shared DeployDAO.s.sol script against its own RPC and chainID. Brands add no Solidity. This LP does not restate the deployment pattern; it specifies the work-market modules that pattern ships.

Three concerns, three orthogonal contracts:

ConcernContractResponsibility
Policy / lifecycleBountydecides when funds move and who is authorized; sole controller of Escrow and sole writer of Reputation
CustodyEscrowconservation-safe value vault; releases or refunds only on the controller's instruction
HistoryReputationappend-only, non-transferable contribution ledger; bridges completions into global Karma

Composed with three DAO modules from the same tree:

ContractResponsibility
GovernorAzorius voting-strategy execution module — the DAO's proposal and execution engine (lp-2801, lp-2802)
Fractalsub-DAO execution module: a parent DAO directly governs child DAOs, so a board or squad is a nested task space the org DAO controls (Zodiac avatar/target)
SystemDeployerdeterministic factory that stamps out and wires the module set (Safe + Governor + Fractal + Bounty/Escrow/Reputation) in one deployment

Each @luxfi/standard module registers under a single canonical registry slot; there is no successor version, by design.

Contracts

Signatures below are the canonical module interfaces (UUPS master-copy + proxy, EIP-7201 namespaced storage, nonReentrant on every state-changing entrypoint).

Bounty

Sole controller of Escrow, sole writer of Reputation. Permissionless: anyone may propose and anyone may claim. Abuse is bounded by mechanism, not an allowlist — a worker stakes to claim (returned on success, slashed on abandonment), and every stage has a deadline with a permissionless escape.

function propose(RewardSpec reward, address stakeToken, uint256 stake,
    address approver, address arbiter, uint64 claimWindow, uint64 reviewWindow,
    string issueRef) external returns (uint256 bountyId); // -> Open
function fund(uint256 bountyId) external payable;      // Open -> Funded
function claim(uint256 bountyId) external payable;     // Funded -> Claimed (worker stakes)
function submit(uint256 bountyId, string deliverableRef) external; // Claimed -> Submitted
function accept(uint256 bountyId) external;            // Submitted -> Paid (approver)
function finalize(uint256 bountyId) external;          // Submitted -> Paid (anyone, after reviewWindow)
function dispute(uint256 bountyId, string reasonRef) external;     // Submitted -> Disputed
function resolveDispute(uint256 bountyId, uint256 workerAmount,
    uint256 funderAmount, bool workerKeepsStake) external;         // Disputed -> Paid (arbiter)
function cancel(uint256 bountyId) external;            // Open/Funded -> Cancelled (funder)
function reclaim(uint256 bountyId) external;           // Claimed -> Funded (anyone, after claimWindow; slashes stake)

Anti-self-dealing invariant: the funder may not be the approver or arbiter of its own bounty — a self-dealing funder = approver = arbiter could dispute-and-slash a delivered worker. Authorization is cryptographic: msg.sender is the configured role address, so a post-quantum-signed Safe (lp-4292) is a first-class funder, approver, or arbiter with no special-casing. Views: bountyCount(), bounties(id), stateOf(id), escrow(), reputation(), treasury().

Escrow

Pure custody. One deposit holds one asset, tagged by AssetKind; the controller (Bounty) is the only mover.

function deposit(bytes32 depositId, AssetKind kind, address token,
    address funder, uint256 tokenId, uint256 amount) external payable; // controller-only
function release(bytes32 depositId, address to, uint256 amount) external; // controller-only
function refund(bytes32 depositId, address to, uint256 amount) external;  // controller-only

Conservation is enforced in one place: a deposit's remaining is debited before any outbound transfer (checks-effects-interactions) under nonReentrant, so no deposit can pay out more than it holds — including the ERC-721/1155 safeTransfer callback, which cannot re-enter to double-pay. Fee-on-transfer and rebasing ERC-20s are rejected at deposit (received ≠ nominal); unsolicited NFT transfers are rejected (the escrow holds exactly its ledgered NFTs); an ERC-721 is indivisible and moves whole.

Reputation

Append-only, non-transferable per-worker ledger; exactly one writer (the Bounty market), fixed at init. It is deliberately not a token — pure reputation any contract can read and compose.

function recordCompletion(address worker, uint256 amount, bytes32 source) external; // writer-only
function recordDisputeLoss(address worker) external;                                 // writer-only
function reputationOf(address worker) external view
    returns (uint64 completed, uint64 disputesLost, uint256 totalEarned);

recordCompletion increments the local ledger (always) and best-effort bridges Karma. Config (setKarmaController, setKarmaPerCompletion) is owner-gated to the org DAO Safe.

Bounty lifecycle state machine

Illegal transitions revert (InvalidState) — a state invariant, not a discretionary check. The State enum is canonical; ordinals are stable.

None(0) -> Open(1) --fund--> Funded(2) --claim--> Claimed(3) --submit--> Submitted(4)
                       |                    |                                 |
                    cancel               reclaim                          accept / finalize
                       v                (slash stake,                        v
                   Cancelled(8)          -> Funded)                       Paid(6, terminal)
                                                                             ^
                                          Submitted --dispute--> Disputed(7) --resolveDispute-->
StateOrdinalMeaning
None0id does not exist
Open1proposed, reward not yet escrowed
Funded2reward escrowed, awaiting a worker
Claimed3a worker staked and claimed; work in progress
Submitted4deliverable submitted, awaiting review
Accepted5reserved — payout is atomic, so the market moves Submitted -> Paid directly
Paid6reward released, stake returned — terminal
Disputed7submission contested; awaiting arbiter
Cancelled8refunded to funder before completion — terminal

Liveness escape — the load-bearing property: from Submitted, if the approver neither accepts nor disputes before reviewWindow elapses, anyone may finalize and the worker is paid. Approver silence past the window counts as acceptance. A dispute is accepted only before the window, so a delivered worker's reward and stake can never be locked forever by counterparty inaction. Symmetrically, reclaim frees a squatted claim after claimWindow and slashes the stuck stake. Windows are bounded (MAX_WINDOW = 365 days) so a hostile funder cannot overflow the deadline arithmetic to brick a delivery.

Reward types

The reward is a RewardSpec { AssetKind kind, address token, uint256 tokenId, uint256 amount }; the stake is always fungible (native or ERC-20) and stored distinctly from the reward, so the anti-grief stake mechanism is unchanged regardless of reward class.

AssetKindOrdinalReward semantics
Native0chain native coin (token == address(0)), amount = value
ERC201fungible token, amount = token amount
ERC7212single indivisible NFT (amount == 1)
ERC11553semi-fungible, amount = quantity

On dispute a fungible reward is split by the arbiter (workerAmount + funderAmount == reward); an NFT reward is indivisible — workerAmount must be 0 (funder keeps it) or the full reward (worker gets it), else the resolution reverts (NftRewardIndivisible). The stake decision (return vs slash) is orthogonal.

Karma integration

The work market is a first-class Karma activity source. This LP does not re-derive Karma's scoring, decay, or soul-bound semantics — see the Karma / KarmaController / KarmaMinter contracts in @luxfi/standard.

On the completion path, Reputation.recordCompletion(worker, amount, source) increments the local ledger and then best-effort mints a flat, owner-configurable karmaPerCompletion to the worker via KarmaController.earnKarma(account, amount, reason). The Reputation contract holds KARMA_SOURCE_ROLE on the controller; the controller holds mint authority (ATTESTOR_ROLE) on the Karma token — so the market can mint Karma only through this narrow, role-gated path and never directly.

Two invariants make this safe:

  • Best-effort, money-path safe. recordCompletion runs after the escrow has already released the reward and stake. The earnKarma call is wrapped so any failure (soft-cap reached, controller paused, role not yet granted) is caught and emitted (KarmaBridgeFailed), never bubbled. A Karma side-effect can never revert a worker's payout.
  • Once-only. source = keccak256(chainid, market, bountyId) is both the Karma reason and the once-only key, so a completion can never double-mint.

Karma amount is decoupled from the reward amount: a flat per-completion award is the only coherent, Sybil-resistant choice across incommensurable reward classes (an NFT reward has amount == 1) and prevents a self-funded whale from farming the Karma cap. Authority: the org Safe is the Karma admin and minter authority — it holds DEFAULT_ADMIN_ROLE / GOVERNOR_ROLE on the controller and configures karmaPerCompletion and the controller address on Reputation. Dispute losses are recorded locally and do not slash Karma; Karma slashing stays Safe-governed on the token, orthogonal to this market.

Ownership and security

  • Deploy identity → DAO Safe. The deployer 0x9011 deploys the module set directly on 96368 (lux-testnet), 200200 (Zoo), 494949 (Pars), and 36963 (Hanzo), then transfers contract ownership (UUPS upgrade authority) to that org's DAO Safe (1/1 0x9011). Post-transfer, upgrades and Karma-bridge config are Safe-gated.
  • Hard invariant — never 0x9011 on 96369. Lux mainnet (96369) carries no 0x9011-owned Governor or treasury. Mainnet governance is additive Safe-only; the Governor is staged post-flag-day and is intentionally dead (0 bytes) until then. 96369 holds only ownerless master-copies and singletons — Safe singleton, factory, module master copies, voting strategies, freeze guards.
  • Escrow atomicity. Value leaves the escrow through exactly one debited-first, reentrancy-guarded path; the market commits state before any external call. Payouts are atomic and conservation holds independent of any controller bug.
  • Permissionless, mechanism-bounded. No allowlist; grief is priced by the stake, the claim and review deadlines, and the finalize / reclaim escapes.
  • Anti-self-dealing. funder ≠ approver ≠ arbiter, enforced at propose.

Authentication

Authentication is delegated to Hanzo IAM as the canonical OIDC identity provider; work.<org>.network performs no per-app auth. IAM federates multiple methods behind one identity:

  • Discord and GitHub OAuth. The GitHub binding also drives issue ↔ bounty sync.
  • Phantom (EVM) and WalletConnect wallets via IAM WalletLink, using SIWE (Sign-In With Ethereum, EIP-4361) to bind a wallet to the IAM identity.

Discord, Phantom, and GitHub login are enabled and working. A worker's payout address and its IAM identity are linked through SIWE, so contribution reputation and Karma attach to a verifiable identity, not a bare address.

GitHub binding and bounty-bot

work.<org> is a task board bound to GitHub repositories (github.com/luxdao, luxfi/standard, …). A bounty is tied to a GitHub issue; issue and on-chain bounty state stay in sync via a bounty-bot service (bounties.zoo.network) driven by HMAC-signed GitHub webhooks. The service is routed and gated by a method/scope contract, asserted read-only with no secret revealed:

ProbeExpectedMeaning
GET /v1/github/webhook405route exists, POST-only
POST /v1/github/webhook (unsigned)401handler runs and rejects a missing HMAC signature
GET /v1/healthz404healthz is cluster-scoped, not public

Surface

The canonical DAO and work surface is work.<org>.network, white-labelled by hostname (Lux / Zoo / Hanzo / Pars brands; never cross-brand). It reads Bounty + Reputation straight off the org's C-Chain: a green LIVE badge proves a real chain read succeeded (the FIXTURE fallback renders only when the read fails), the board count equals on-chain bountyCount(), and paid bounties appear in the Paid column. work.zoo.network is live with bounty #0 in Paid.

Each org's governance and work surface converges onto its single work.<org>.network; vote.<org> is retired in favour of the on-chain-reading work board.

Deployments

The finished canonical (non-versioned) set, deployed via DeployWorkMarket.s.sol. The deployer 0x9011 renounces every role after handing ownership (owner, treasury, Karma-admin, slasher) to the org DAO Safe.

ChainIDStatusBountyEscrowReputationKarmaDAO Safe
Zoo200200LIVE — finished set, fill PAID0x857c9fE5A644e048FEF7194Da10fFEb356a81fFD0x5d9a3A8c1EeEfaC85178c5583425Ab25C0C208b30xE6766AF6171F437D6d3952e73402b762718c18090xA8898F8573a463C167584979dc7E2cD43c24BAdF0x229599f227231d8C90fcF1a78589F5DC4b7A6962
Pars494949LIVE — finished set, fill PAID0x79254D4A9286FBd65E7177440Be20f00934c33c20x82323cf625C3a6DE0f5fB75A2e7bD41BB82000750xD7fe65BCb3Efd85AC1E132E8b74365498E034f130x81fBD8287571E83D2a834Ae5A8B859092C45b2EA0x4CEA4ac1C874a340B06e0422E77a477463C3a542
Lux96369Staged — master copies only; Governor 0 bytes————additive Safe-only
Hanzo36963Pending — 0x9011 fund gap—————

Companion modules on Zoo and Pars: Governor (Zoo 0xc23e396acA1CbB0D0cF1debc8371eDddbf52430e, Pars 0x62Ea1B27CDD922dbAaE0572f4CD4862Ca939C24c), Fractal (Zoo 0x8C241Bcc7735AA4f21B9e488AC93B22058257264, Pars 0x0570b2c59976E87D37d3a9915750BFf131d295D6), SystemDeployer (Zoo 0xEaFFaDf661D82df7871d2E4085C39defc792A1c7, Pars 0x7803f099cdA82732e98C9f82815e7Acf18CA02C8).

On both Zoo and Pars, Reputation.writer() == Bounty, stateOf(0) == Paid, the escrow drained to 0, and 10 KARMA minted to the worker — the full propose → fund → claim → submit → accept/pay cycle is proven on-chain (Zoo accept 0x98a095649b2dc31f518b108ae50d9e1a5a88b6175e530c0651ef689c8d0b7332, Pars accept 0x647dbda4b25feb87433f6a95dd03c44fc72a569bd6644ed1af0c61c2dac0e320). The live accept under ReentrancyGuardTransient also proves EIP-1153 TSTORE works on both chains. 96369 holds only master copies until flag-day; no live work-market instance exists there.

Implementation status: PARTIAL. All four reward classes (native, ERC-20, ERC-721, ERC-1155) and the Karma bridge are in the deployed canonical set. The market runs under a native + trusted-token model; an allowlist for arbitrary untrusted reward tokens is the prerequisite for opening fully permissionless reward tokens, and is not yet built.

Conformance

The market is guarded end-to-end by the Playwright suite in luxfi/universe/e2e/. Conformance means these pass against the live orgs:

SpecAsserts
30-dao-onchain.spec.tsthe DAO / governance / work-market stack is really deployed and wired per org, read via eth_call and eth_getCode
31-vote-surfaces.spec.tsthe <org>.vote front-ends: correct brand, zero cross-brand leakage, not a white screen, Connect-Wallet present
32-work-boards.spec.tswork.<org>.network reads Bounty + Reputation from chain — LIVE badge, not FIXTURE fallback, board count == bountyCount()
33-bounty-bot.spec.tsbounties.zoo.network method/scope contract (405 / 401 / 404) — routed, alive, HMAC-gated
34-pars-chain.spec.tsPars 494949 sovereign L1 liveness; explorer renders as Pars

References

  • lp-2800 — DAO platform and white-label deployment pattern
  • lp-2801 — Azorius governance module (the execution engine)
  • lp-2802 — voting strategies
  • lp-2803 — freeze voting guard
  • lp-3002 — DLUX / vLUX governance economics
  • lp-4291 — Safe multisig substrate
  • lp-4292 — PQ-signed Safe as funder / approver / arbiter / owner
  • lp-6602 — cross-chain treasury rails

Copyright (C) Lux Industries Inc. Licensed under the MIT License.