跳到正文

cxmza

windle

Ship or slash — onchain promises with collateral on Solana. Teams back promises, markets price them, the chain decides.

README 已保存到本站,可直接阅读

Documentation snapshot

README 快照

这篇是英文原文

下面正文是项目自己的英文 README。想读全文就用浏览器自带的整页翻译: Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」; 手机浏览器一般在菜单里。

本页保存的是公开项目资料快照,阅读过程不需要连接 GitHub。

图片:CI 图片:CodeQL

Website · App · Docs · API · How it works


What is windle

windle puts promises on the line. A team states something a program can check on Solana — “our program is deployed and executable at this address before Dec 1” — and locks collateral behind it. A YES/NO market prices the odds. At the deadline nobody votes: the program reads the chain and pays out. Ship, and the team gets its collateral back while YES is paid. Slash, and the collateral goes to NO holders.

flowchart LR
    team(["Team"]) -- "checkable claim + deadline" --> promise["Promise"]
    team -- "locks" --> collateral[("Collateralprogram-owned")]
    traders(["Traders"]) -- "buy YES / NO" --> market{{"YES / NO marketprice = odds"}}
    promise --> market
    market --> verdict{"Deadlinethe chain decides"}
    collateral --> verdict
    verdict -- "condition met" --> ship["SHIPcollateral back · YES paid"]
    verdict -- "condition missed" --> slash["SLASHcollateral to NO holders"]
PromiseA condition over onchain accounts plus a deadline. A tweet saying “mainnet soon” is not a promise; a condition a program can evaluate is.
CollateralLocked in a program-controlled account. Neither the team nor windle can withdraw it before resolution. The amount is public.
MarketBuy YES if you believe the team ships, NO if you don’t. The YES price, between 0 and 1, reads as the probability.
VerdictAfter the deadline anyone can trigger resolution; the program checks the condition against chain state. No vote, no dispute window.

Read the full design in the docs: How it works · Collateral · Market · Resolution · Payouts.

[!IMPORTANT] windle is pre-launch. The protocol programs are not deployed; markets, prices and positions on the website are illustrative demo data, and no real funds are involved anywhere. What is live today: the website, sign-in with a Solana wallet, the account API and the docs.

Screenshots

Landing — www.windle.fun
The market prices the truth — demo market, no real funds


Sign in with Solana — oauth.windle.fun
API portal — api.windle.fun

Docs — docs.windle.fun

Live

SurfaceURLWhat runs there
Websitewww.windle.funLanding — Vite + React 19 + React Three Fiber, GSAP and Motion
Appapp.windle.funProduct app — React 19, React Router 7, TanStack Query
Sign-inoauth.windle.funSign-In With Solana via Wallet Standard
Docsdocs.windle.funAstro Starlight — concepts, guides, API, legal
APIapi.windle.funFastify 5 — sessions and accounts; reference · OpenAPI 3.1
CDNcdn.windle.funBrand assets, fonts, image resizing (imgproxy)

Architecture

npm-workspaces monorepo: every surface, the API, the shared packages and the server setup live and ship together.

windle/
├─ apps/
│  ├─ web/        landing             Vite · React 19 · R3F · GSAP · Motion · Tailwind 4
│  ├─ app/        product app         Vite · React 19 · React Router 7 · TanStack Query
│  ├─ auth/       sign-in             Wallet Standard · Sign-In With Solana · R3F
│  ├─ docs/       documentation       Astro · Starlight
│  └─ api/        backend             Fastify 5 · zod · Drizzle · Postgres 17 · Redis 7
├─ packages/
│  ├─ tokens/     design tokens       Tailwind 4 @theme (OKLCH) + sRGB mirrors for three.js
│  ├─ brand/      WindleMark          React component, mark SVG, favicon source
│  └─ shared/     API contracts       zod schemas + TS types (SIWS, session, me)
└─ infra/         production          docker compose, nginx, CDN, deploy / backup scripts, runbook
PathDeploys toNotes
apps/webwww.windle.funstatic, immutable releases with atomic switch
apps/appapp.windle.funstatic SPA
apps/authoauth.windle.funstatic SPA
apps/docsdocs.windle.funstatic
apps/apiapi.windle.funcontainer on loopback behind nginx, health-gated switch
packages/*—source-only TypeScript (exports → src/*.ts); Vite, Vitest and tsx compile them in place, esbuild inlines them into the API
infrathe serversee infra/README.md and DEPLOY.md
flowchart LR
    user(("Browser")) --> cf["Cloudflare"]
    cf --> nginx["nginxTLS · CSP · rate limits"]
    nginx --> static["www · app · oauth · docsstatic releases"]
    nginx --> cdn["cdnbrand · fonts"]
    cdn --> img["imgproxy"]
    nginx --> api["apiFastify 5"]
    api --> pg[("Postgres 17")]
    api --> redis[("Redis 7sessions · nonces")]

Sign-In With Solana — how a session is created

sequenceDiagram
    autonumber
    participant W as Wallet
    participant A as oauth.windle.fun
    participant API as api.windle.fun
    A->>API: GET /v1/auth/siws/nonce
    API-->>A: single-use sign-in input
    A->>W: solana:signIn(input)
    W-->>A: signed message + signature
    A->>API: POST /v1/auth/siws/verify
    API-->>A: 200 + HttpOnly session cookie (Domain=.windle.fun)
    A->>API: GET /v1/me (credentials: include)

Signing a message cannot move funds. There are no API keys: browser clients call with credentials: "include", credentialed CORS is limited to an exact-origin allow-list, and every non-2xx body is { "error": { "code", "message", "requestId" } }. Details: API docs.

Run it locally

Requirements: Node.js ≥ 22.12 and npm 10. The frontends and all unit tests need nothing else (API tests use an in-memory store). Running the API itself (dev:api) needs a local Postgres 17 and Redis 7 — by default postgres://windle:windle@127.0.0.1:5432/windle and redis://127.0.0.1:6379/0; override with DATABASE_URL and REDIS_URL (see apps/api/.env.example).

git clone https://github.com/cxmza/windle.git
cd windle
npm ci                 # one lockfile for every workspace
CommandWhat
npm run dev:weblanding on :5173
npm run dev:appproduct app on :5174
npm run dev:authsign-in on :5175
npm run dev:docsdocs on :4321
npm run dev:apiAPI on :3001 (tsx watch)
npm run lintBiome over the whole repo (lint:fix applies safe fixes)
npm run typecheckevery workspace (tsc / astro sync && tsc)
npm testVitest in every workspace that has tests
npm run buildevery workspace → /dist
npm run e2ePlaywright for apps/web

One workspace: npm run -w @windle/. Add a dependency: npm install -w @windle/. Frontends read VITE_API_URL, VITE_APP_URL, VITE_AUTH_URL, VITE_DOCS_URL and default to the local ports above in development.

Using the shared packages

  • Tokens in a Tailwind app — in the app’s CSS entry, after @import "tailwindcss";, add @import "@windle/tokens/fonts.css";, @import "@windle/tokens/tokens.css"; and @source "/packages/brand/src"; so classes used inside shared components are generated.
  • Palette for three.js / canvas — import { BLUE, SCENE_BLUE } from '@windle/tokens';
  • Brand — import { WindleMark, WINDLE_MARK_PATH } from '@windle/brand';; SVG files: @windle/brand/favicon.svg, @windle/brand/windle-mark.svg.
  • Contracts — import { SiwsNonce, SiwsVerifyRequest, Session, Me, safeReturnTo } from '@windle/shared';
  • Inside packages, relative imports carry the .ts extension (./auth.ts); every tsconfig extends tsconfig.base.json, which allows it.

Project status

AreaState
Website, docs, brandlive
Sign-In With Solana, sessions, account APIlive (v0.1)
Product appearly shell
Protocol programs (promises, collateral, markets, resolution)design stage — see docs
Email / X / Google sign-inplanned, disabled until real credentials exist

Releases and notes: Releases. Questions and ideas: Discussions.

Security

Please do not open public issues for vulnerabilities. Report them privately through GitHub private vulnerability reporting — see SECURITY.md. Secrets never live in this repository; server-only values are generated on the server.

License

Source-available, all rights reserved. The code is public so it can be read, reviewed and learned from; it is not open source, and no right to use, copy, modify or redistribute it is granted. See LICENSE. The owner may switch to an open-source license later.

[!NOTE] Nothing on windle is financial advice. Prediction markets may be restricted where you live; read the risk notice and terms.

Official distribution

获取与安装

暂未发现可确认的官方软件包地址

当前 README 快照没有出现 npm、PyPI、Crates.io、pub.dev 等官方包页链接。本站不会根据仓库名称猜测下载地址。

本站不托管项目文件;需要安装时,请以项目维护者发布的官方文档为准。

使用前核验

本站保存公开资料用于阅读,不代表安全审计或功能背书。安装前请核对许可证、依赖来源和发布签名,不要直接运行来源不明的二进制文件或高权限脚本。