Skip to content

About

Dogecoin payment links, pay pages, tip pages and tip jars: the whole request lives in the link. Static files, no account.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DogeJS

DogeJS Payment Links and Tip Jars

Get paid with a link: payment links, pay pages, tip pages and tip jars whose whole request lives in the link. No server, no account.

Live demo · Documentation · All DogeJS projects

A payment request page with its QR code

What it does

  • Makes a payment link or invoice in under a minute: your address, an optional amount and note, then copy the link or show the QR code. The whole request lives in the link.
  • Makes a tip page and tip jar: a page with preset amounts, a Tip in DOGE button, a goal bar and a poster you can print.
  • Needs no website, no account and no fees. The money goes straight to your own wallet.
  • Checks the address on every page and says plainly that a name or note in a link is not verified.
  • Optionally watches for the payment (through a server you give it or the free public service) and can show a fiat price from CoinGecko.

Try it

Make a link on the live page, or start a tip jar: https://dogejs.com/link/ and https://dogejs.com/tip/

A link looks like https://dogejs.com/p/#1.<the whole request>. To host your own copies, build the page scripts and serve them with their HTML and CSS:

npm install && npm run build   # writes dist/link.js, p.js, tip.js and t.js

Screenshots

A tip jar with preset amounts and a Tip in DOGE button.

A tip jar with preset amounts and a Tip in DOGE button.

Make a link in under a minute: your address, what it is for, then copy or share.

Make a link in under a minute: your address, what it is for, then copy or share.

Make a tip jar: a name, a message, amounts and a goal.

Make a tip jar: a name, a message, amounts and a goal.

Install

Nothing is on npm yet. Clone the repository and build:

git clone https://github.com/DogeJS-Dev/payment-links.git
cd payment-links
npm install      # also installs core and backends from their git tags
npm run build    # the four page scripts in dist/, and the helper library dist/index.mjs

The four pages are self-contained scripts. The helper library (link encoding and decoding, money maths, address checks) has no DOM at import time:

import { generatePrivateKey, getPublicKey, p2pkhAddress, testnet } from '@dogejs/core';
import { encodePayLink, decodePayLink } from '@dogejs/links';

const address = p2pkhAddress(getPublicKey(generatePrivateKey()), testnet);
const fragment = encodePayLink({
  network: 'testnet', address,
  amount: { kind: 'doge', koinu: 2_000_000_000n }, // 20 DOGE, as integer koinu
  note: 'Coffee', invoice: '', name: '', due: '', server: '',
});
const back = decodePayLink(fragment);
console.log(back.ok, back.ok && back.link.amount.koinu, back.ok && back.link.note); // true 2000000000n Coffee

How it works

A pay link carries a versioned, checksummed fragment after the #, which a browser never sends to a server, so the request stays between the sender and the person who opens it. Malformed input comes back as { ok: false, reason }, never as a half-read request. Money is integer koinu and fiat amounts are integer cents.

The source the four pages share with shop-mode and watch is in shared/. This repository holds the canonical copy; the other two carry identical vendored copies. See shared/README.md for how to sync them.

The package reference is in docs/REFERENCE.md.

Works with

  • Built on core and backends.
  • Tip pages come with a Tip in DOGE button you can embed on your own site.
  • Same family as shop-mode (in person) and watch (follow addresses).

Status

Version 0.7.1. It is not published to npm yet. It has had no external security review. It is tested with unit tests and in a headless browser against fake servers. Payment and tip detection has not been run against a real Esplora or electrs-doge server (the community servers were unreachable during development), and nothing has been run against the real Dogecoin network. Anyone who can edit a link can change its address: share links over a channel you trust and check the address on the page. The free public service it can use for main network links (BlockCypher) is free and public, not run by DogeJS, and was built from captured responses; it has never been used with a real payment.

Contributing

Bug reports, ideas and pull requests are welcome. Read the contributing guide first: small, tested, explained.

npm install
npm run build
npm run typecheck
npm test

Report a security problem privately to hello@dogejs.com, never in a public issue. See SECURITY.md.

The maintainers keep one combined development workspace for all DogeJS projects and publish each project from it as a repository of its own. An accepted pull request is applied there and appears here with the next release.

Licence

MIT, see LICENSE. Bundled third-party code, where there is any, is listed in THIRD_PARTY_LICENSES.

About

Dogecoin payment links, pay pages, tip pages and tip jars: the whole request lives in the link. Static files, no account.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages