Branchwell

Paywell / website / open / index.html

1<!doctype html>
2<html lang="en">
3<head>
4<meta charset="utf-8">
5<meta name="viewport" content="width=device-width,initial-scale=1">
6<title>Open code | Paywell</title>
7<meta name="description" content="All of Paywell is open: the team app, the server, the database, the wallet, the rating links, the logo and the pay model. Copy any of it, free, no permission needed.">
8<link rel="canonical" href="https://paywell.company/open/">
9<meta property="og:type" content="website"><meta property="og:site_name" content="Paywell">
10<meta property="og:title" content="Open code | Paywell"><meta property="og:description" content="All of Paywell is open: the team app, the server, the database, the wallet, the rating links, the logo and the pay model. Copy any of it, free, no permission needed.">
11<meta property="og:url" content="https://paywell.company/open/"><meta property="og:image" content="https://paywell.company/img/og.jpg">
12<meta name="twitter:card" content="summary_large_image">
13<meta name="theme-color" content="#0f3d2e">
14<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='9' fill='%230f3d2e'/%3E%3Ccircle cx='16' cy='14.5' r='8.5' fill='%23e0a526'/%3E%3Ccircle cx='16' cy='14.5' r='6.6' fill='none' stroke='%230f3d2e' stroke-opacity='.35' stroke-width='1'/%3E%3Cpath d='M16 9.6l1.5 3.1 3.4.5-2.5 2.4.6 3.4-3-1.6-3 1.6.6-3.4-2.5-2.4 3.4-.5z' fill='%230f3d2e'/%3E%3Cpath d='M8.5 25.5c2.2 1.6 4.7 2.4 7.5 2.4s5.3-.8 7.5-2.4' fill='none' stroke='%237fd1a3' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E">
15<link rel="manifest" href="/app/manifest.webmanifest">
16<link rel="stylesheet" href="/assets/site.css">
17</head>
18<body>
19<a class="skip" href="#main">Skip to content</a>
20<div class="wrap">
21<header class="top"><a class="brand" href="/"><svg viewBox="0 0 32 32" aria-hidden="true"><rect width="32" height="32" rx="9" fill="#0f3d2e"/><circle cx="16" cy="14.5" r="8.5" fill="#e0a526"/><circle cx="16" cy="14.5" r="6.6" fill="none" stroke="#0f3d2e" stroke-opacity=".35" stroke-width="1"/><path d="M16 9.6l1.5 3.1 3.4.5-2.5 2.4.6 3.4-3-1.6-3 1.6.6-3.4-2.5-2.4 3.4-.5z" fill="#0f3d2e"/><path d="M8.5 25.5c2.2 1.6 4.7 2.4 7.5 2.4s5.3-.8 7.5-2.4" fill="none" stroke="#7fd1a3" stroke-width="2.2" stroke-linecap="round"/></svg>Paywell</a><nav class="main" aria-label="Main"><a href="/how-it-works/">How it works</a><a href="/fair-pay/">Fair pay</a><a href="/learn/">Bitcoin basics</a><a href="/rate/">Rate a visit</a><a href="/app/">Team app</a><a href="/open/" aria-current=page>Open code</a><a href="/careers/">Careers</a></nav></header>
22</div>
23<main id="main">
24<div class="wrap">
25<section class="hero">
26<div>
27<p class="eyebrow">Open code</p>
28<h1>Take it. It’s yours too.</h1>
29<p class="lede">Every line of Paywell is public and free to copy, change and use, for any reason, with no permission needed. The code, the database, the designs, the logo and the full pay model are all here. We give it away on purpose: fair pay should be easy for every company to start.</p>
30<div class="btns"><a class="btn" href="https://github.com/projectatomai/hosting-research">See it all on GitHub</a><a class="btn o" href="/research/">Read the research</a></div>
31</div>
32<div class="art"><img src="/img/open.webp" width="1536" height="1024" alt="A laptop on a workbench showing code beside a notebook with a hand-drawn diagram of the bonus formula" loading="lazy"></div>
33</section>
34</div>
35
36<section class="sec"><div class="wrap prose">
37<h2>What’s open</h2>
38<div class="scroll"><table class="t">
39<tr><th>File</th><th>What it does</th><th>Get it</th></tr>
40<tr><td><b>paywell-app.js</b></td><td>Team app server: passkey sign-up and sign-in (WebAuthn checked on our server), teams, setup links, daily check-ins, scores, daily bonus math, chat, rating links, and the test-network Bitcoin proxy.</td><td><a href="/open/src/paywell-app.js.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/domain-sites/functions/paywell-app.js">Source</a></td></tr><tr><td><b>paywell-api.js</b></td><td>Customer rating links (signed, one use, 14 days) and the wallet vault that stores a passkey-locked backup we cannot open.</td><td><a href="/open/src/paywell-api.js.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/domain-sites/functions/paywell-api.js">Source</a></td></tr><tr><td><b>schema.sql</b></td><td>The whole database: teams, people, passkeys, sessions, check-ins, ratings, chat, vault.</td><td><a href="/open/src/schema.sql.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/tools/paywell-gen/schema.sql">Source</a></td></tr><tr><td><b>app.js</b></td><td>The team app in the browser: screens, passkeys, wallet lock (PRF + HKDF + AES-GCM), check-ins, payments, chat.</td><td><a href="/open/src/app.js.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/domain-sites/paywell.company/app/app.js">Source</a></td></tr><tr><td><b>wallet-src.js</b></td><td>The wallet: BIP39 words, BIP84 addresses, building and signing payments, QR codes. Built with audited open libraries (@scure).</td><td><a href="/open/src/wallet-src.js.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/tools/paywell-gen/app-src/wallet-src.js">Source</a></td></tr><tr><td><b>rate.js</b></td><td>The customer rating page.</td><td><a href="/open/src/rate.js.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/domain-sites/paywell.company/assets/rate.js">Source</a></td></tr><tr><td><b>bonus_diagram.html</b></td><td>The daily bonus diagram used on this site and on every brand’s fair pay page.</td><td><a href="/open/src/bonus_diagram.html.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/tools/paywell-gen/bonus_diagram.html">Source</a></td></tr><tr><td><b>logo.svg</b></td><td>Our logo: a gold coin with a rating star, over a smile.</td><td><a href="/open/src/logo.svg.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/tools/paywell-gen/logo.svg">Source</a></td></tr><tr><td><b>build.py</b></td><td>Builds every page of this website.</td><td><a href="/open/src/build.py.txt">Read it here</a> · <a href="https://github.com/projectatomai/hosting-research/blob/main/tools/paywell-gen/build.py">Source</a></td></tr>
41</table></div>
42<p>Everything is dedicated to the public domain (CC0 for words and pictures, the Unlicense for code). You don’t need to credit us.</p>
43
44<h2>How it fits together</h2>
45<ol class="steps">
46<li><b>A website, nothing to install</b><span>The site, the team app and the rating pages are plain web pages served from the edge. They work on any phone or computer, and you can add the app to your home screen.</span></li>
47<li><b>Passkeys only</b><span>Sign-in uses WebAuthn passkeys: your face, fingerprint or screen lock. There are no passwords to steal. Our server checks every passkey signature itself.</span></li>
48<li><b>A small database</b><span>One SQLite database (Cloudflare D1) holds teams, people, check-ins, ratings and chat. Sessions are stored only as a fingerprint (hash) of the token.</span></li>
49<li><b>A wallet we can’t open</b><span>The wallet is made in your browser. Its backup words are locked with a key that only your passkey can produce (the WebAuthn PRF extension), then stored with us as a sealed box.</span></li>
50<li><b>Signed rating links</b><span>Each visit gets a link signed by the server (HMAC-SHA256). It works once, for 14 days, and can’t be faked or reused.</span></li>
51<li><b>The math is public</b><span>Score = customer reviews 60% + peer check-ins 40%, from 0 to 100. Daily bonus = score × tier shares × the value of one share. Tiers: Explorer 1, Builder 1½, Guide 2.</span></li>
52</ol>
53
54<h2>Run your own copy</h2>
55<ol>
56<li>Copy the <code>domain-sites</code> folder and the <code>tools/paywell-gen</code> folder from the repository.</li>
57<li>Create a D1 database and load <code>schema.sql</code> into it.</li>
58<li>Deploy to Cloudflare Pages with that database bound as <code>PAYWELL_DB</code>.</li>
59<li>Change the domain name in <code>paywell-app.js</code> (it’s the passkey website ID), and you have your own Paywell.</li>
60</ol>
61<div class="callout"><b>Before real money moves.</b> Test mode uses Bitcoin’s test network. Paying real wages needs a licensed payroll provider, normal tax withholding and reporting, and the money transmitter rules in each state. Our <a href="/research/">research page</a> lists the sources.</div>
62</div></section>
63</main>
64<div class="wrap"><footer class="site">Paywell <span aria-hidden="true">·</span> <a href="/careers/">Careers</a></footer></div>
65</body>
66</html>