Money Button Documentation

Money Button Documentation

  • Money Button
  • API
  • Examples
  • Paymail
  • bsv

›Paymail

Money Button

  • Money Button Overview
  • HTML
  • Javascript
  • React
  • Crypto Operations
  • Invisible Money Button
  • Paymail Signatures
  • Paymail Encryption
  • Simple Fabriik Protocol for Tokens

API

  • API Overview
  • Apps
  • Webhooks
  • Tokens
  • Currencies
  • Javascript Client
  • Authentication

    • Authentication Overview
    • OAuth
    • OAuth With JS Client

    API v1

    • Get User Identity
    • Get User Profile
    • Get User Balance
    • Get Payments
    • Get Payment By ID

    API v2

    • Get User Balances
    • Get Payments
    • Get Payment By ID
    • Get Assets
    • Create Asset
    • Modify Asset

Examples

  • Examples Overview
  • OP_RETURN Scripts
  • Assets

Paymail

  • Paymail Overview
  • Paymail Video Series
  • Paymail Introduction
  • BRFC Specifications
  • Specification Documents
  • BRFC ID Assignment
  • Service Discovery
  • Host Discovery
  • Capability Discovery
  • Public Key Infrastructure
  • Payment Addressing
  • Payment Addressing (Basic Address Resolution)
  • Payment Addressing (Payer Validation)
  • Payment Addressing (Payee Approvals)
  • Payment Addressing (PayTo Protocol Prefix)
  • Verify Public Key Owner
  • P2P Transactions
  • P2P Payment Destination
  • Recommendations

Bitcoin SV Library (bsv)

  • Bitcoin SV Library (bsv)
  • Big Numbers
  • Points (Elliptic Curves)
  • Hash Functions
  • Base 58
  • Private Keys
  • Public Keys
  • Addresses
  • ECDSA
  • Bitcoin Signed Messages
  • Signatures
  • HD Private Keys (BIP32)
  • HD Public Keys (BIP32)
  • Mnemonics (BIP39)
  • Script

Public Key Infrastructure

title: bsvalias Public Key Infrastructure
authors:
  - andy (nChain)
  - Ryan X. Charles (Money Button)
version: 1

Each paymail handle <alias>@<domain>.<tld> MUST be issued a stable ECDSA public key that SHOULD NOT be used as part of any on-chain transaction. Clients must be able to locate the public key from information within the .well-known/bsvalias configuration file:

{
  "bsvalias": "1.0",
  "capabilities": {
    "pki": "https://bsvalias.example.org/{alias}@{domain.tld}/id",
  }
}

The template values {alias} and {domain.tld} refer to the components of target paymail handle <alias>@<domain>.<tld> and must be substituted by the client before issuing a request.

PKI Flow

boundary "Client" as c
control "Paymail Service" as svc

activate c
  c --> c: Service Discovery
  ...
  c -> svc: GET <PKI URI>
  activate svc
    svc -> c: 200; application/json
  deactivate svc
deactivate c

Client Request

The capabilities.pki path returns a URI template. Clients should replace the {alias} and {domain.tld} template parameters and then make an HTTP GET request against this URI.

Standard HTTP caching headers SHOULD be supported, and clients that have previously requested the public key SHOULD NOT re-request information within any server-advertised caching window.

Server Responses

Below are the responses that have meaning to this protocol. A server may return other status codes, for example 5xx indicating some sort of server failure. Clients should treat status codes not specified as part of this specification as some sort of transient error and may retry at their leisure.

200 OK

Returned when a valid request for a known paymail handle has been received. The return message MUST have a content type of application/json. The response body MUST conform to the following schema:

{
  "bsvalias": "1.0",
  "handle": "<alias>@<domain>.<tld>",
  "pubkey": "..."
}

The public key MUST be a valid point on the secp256k1 curve, compressed, and hex-encoded. This means that the pubkey string length MUST be 66 bytes long (33 bytes binary, each byte encoded as two hex characters):

StartLengthValue
0002"Odd/even" indicator, must be either 02 or 03
0264Elliptic curve point x-coordinate

304 Not Modified

No public key rotation has taken place since the previous request, based on caching headers supplied.

404 Not Found

The paymail handle was not found by this service.

← Capability DiscoveryPayment Addressing →
  • PKI Flow
  • Client Request
  • Server Responses
    • 200 OK
    • 304 Not Modified
    • 404 Not Found
Money Button Documentation
Docs
Money ButtonAPIDesignbsv
Community
redditYoutubeTelegramTwitter
More
BlogInstagramGitHubStar
See an error in our documentation? Issue a pull request to fix it.
Copyright © 2021 Yours Inc.