The Proposed 402-Receipts Standard

In the current version, the Receipt Definitions are communicated only in the Receipts-Accepts Header .

Definition

Receipt Definition

A Receipt Definition is an XML object which tells a Client what receipts would be accepted in order to access the relevant resource. Note that the root of a Receipt Definition is a definitions element, which is a list of definitions.

Example
<definitions xmlns="https://402.TBD">
  <definition>
    <domain>https://www.example.com/</domain>
    <item>/page.html</item>
    <signers>
      <signer>https://receipts.dmn.network/path</signer>
    </signers>
    <ttl>2720000</ttl>
    <costs>
      <cost>
        <units>USD</units>
        <amount>0.05</amount>
      </cost>
    </costs>
  </definition>
  <definition>
    <domain>https://www.example.com/</domain>
    <item></item>
    <signers>
      <signer>https://receipts.dmn.network/path</signer>
    </signers>
    <ttl>2720000</ttl>
    <costs>
      <cost>
        <units>USD</units>
        <amount>3.00</amount>
      </cost>
    </costs>
  </definition>
</definitions>

See the documentation for Accepts Headers for another example.

Schema

XML Schema for Receipt Definition XML objects.

Namespace: https://402.TBD
Tag Description Children/Type
Root elements:
definitions

The root element of a Receipt Definition xml fragment.

see below
Element types:
definitions

A list of definitions.

List of definition
definition

To access the resource, a receipt matching one of these descriptions is needed. A definition tag will either contain a single none tag, or all the other child tags.

  • none
OR
  • domain
  • item
  • signers
  • ttl
  • fresh
  • costs
none

A <definition><none></none></definition> element indicates that while any of the other defined receipts would be accepted, no receipt is required. none has no children or contents.

string
  • length: 0
domain

For an HTTPS resource, this must be the full domain name of the resource’s address.

string
    item

    This will typically be the path of the HTTP resource, but it could be anything. An empty item tag indicates that any list of receipts matching the rest of the definition and totaling to the cost will suffice.

    string
      signers

      A list of signers (Notaries) from which receipts would be accepted.

      List of signer
      signer

      The absolute canonical HTTPS url identifying a Notary. Any one of the listed Notaries is sufficient.

      anyURI
        ttl

        An integer representing the maximum age in seconds of a Signed Receipt that will be accepted. Two independent conventions are recommended as “normal”: The ttl should be 2720000, comfortably covering a month. The ttl should be the same for all items in a given domain.

        unsignedInt
          costs

          A list of cost elements. If multiple costs are listed in a single definition, they should probably represent similar monetary values; costs is a list to accommodate multiple currencies.

          List of cost
          cost

          Usually an expression of monetary value. Notaries may use the plan option to represent receipts for which money is not a good model.

          • units
          • amount
          OR
          • plan
          units

          A currency code. ISO4217 codes are recommended.

          string
            amount

            A decimal number amount of that currency’s major units. For example, six US cents would be 0.06, not 6.

            decimal
              plan

              An identifier which is assumed to mean something to the various parties involved.

              string