Hosting a PayID on Github Pages

hammertoe

Matt Hamilton

Posted on June 20, 2020

Hosting a PayID on Github Pages

I wrote a blog the other day about how to statically host a PayID on your own site, if you maintain one:

A friend and colleague, Si, asked me if you could host one on a Github Pages site.

My first thought was probably not due to not having control of the content-type header that is set...

...but turns out you can. So in this video I briefly explain what you need to do to serve up a PayID from Github Pages.

In short:

  1. You need to create a Github Pages repository if you don't already have one. These are named after your username. So if your username is hammertoe then your github pages repository needs to be hammertoe.github.io and will then be served up on https://hammertoe.github.io

  2. You need to create a file in the repository named after then local part of the PayID (before the $). So I want my PayID to be pay$hammertoe.github.io and so I need to create a file called pay. And in that file I have put the PayID information. This is a JSON block that describes my payment destination. e.g.

{
  "addresses": [
    {
      "paymentNetwork": "XRPL",
      "environment": "MAINNET",
      "addressDetailsType": "CryptoAddressDetails",
      "addressDetails": {
        "address": "X75nEw5QD8Ej8jWt7EkJXHoVAV9YCtjuUSJppADpNtPKdim"
      }
    }
  ],
  "payId": "pay$hammertoe.github.io"
}
Enter fullscreen mode Exit fullscreen mode

You can have multiple address blocks, so you can reference multiple payment systems, e.g. XRP, BTC, SWIFT, etc.

Commit. Push. And you are done!

Now anyone with a PayID compatible wallet (such as Xumm, below) or payment system can search for your PayID and it will resolve to the payment information contained in the PayID file you put on Github.

Screenshot of Xumm payment wallet searching a PayID

💖 💪 🙅 🚩
hammertoe
Matt Hamilton

Posted on June 20, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related