PACTUS PAGES The yellow pages of the chain

pactus-profile/1

A public profile for a Pactus account: a small JSON file that the account commits to with a PIP-50 anchor. Any explorer, wallet or directory can read it and check it against the chain, with no server to trust.

Status
Stable. In use by Pactus Pages on mainnet and testnet. Version 1 only gains optional fields; any other change becomes pactus-profile/2.
Schema
pactus-profile-1.schema.json (JSON Schema 2020-12)
Requires
PIP-50 (native state anchoring)

The key words MUST, MUST NOT, SHOULD and MAY are used as in RFC 2119.

1. Anchoring

An account publishes its profile with a PIP-50 set anchor transaction whose fields are:

FieldValue
anchor_type1 (service manifest)
root_hash BLAKE2b-256 of the exact bytes of the file (32 bytes). This is the PAC-ANCHOR-1 root of a single blob, so the file is never re-serialized before hashing.
manifest_uri Where the file is, in at most 128 bytes: ipfs://<cid> (optionally followed by /path) or an https:// URL. IPFS is RECOMMENDED: a raw-leaf CIDv1 with the BLAKE2b-256 multihash has the same digest as root_hash.

Each account has one anchor slot, so it has at most one profile. To change the profile, publish the new file and set the anchor again. To remove it, delete the anchor.

2. The file

The file MUST be a JSON object encoded as UTF-8, with no byte-order mark, and at most 16 384 bytes. Lengths below are counted in Unicode code points. All text is plain text: it is never interpreted as HTML or Markdown.

FieldTypeRules
schemastringRequired. Exactly "pactus-profile/1".
namestringRequired. 1–80, not only whitespace.
category string Required. One of shops, community, development, services, validators, other.
biostringOptional. At most 280.
locationstringOptional. At most 80, free form (e.g. "Madrid, ES").
linksarrayOptional. At most 12 objects { "label", "url" }.
links[].labelstringRequired. At most 40.
links[].url string Required. At most 300. https: or mailto: only, with no credentials (user:pass@).

Example

{
  "schema": "pactus-profile/1",
  "name": "Example Shop",
  "category": "shops",
  "bio": "Coffee and pastries. We take PAC.",
  "location": "Madrid, ES",
  "links": [
    { "label": "Web", "url": "https://example.com" },
    { "label": "Email", "url": "mailto:hello@example.com" }
  ]
}

3. Reading a profile

A profile is written by whoever owns the account, so readers MUST treat it as untrusted input.

  1. Read the account's anchor. Continue only if anchor_type is 1.
  2. Fetch manifest_uri. Readers SHOULD stop after a size limit (Pactus Pages uses 256 KiB) and a timeout. Browsers SHOULD NOT fetch an https:// URI whose host is localhost, a private or link-local address or an IP literal, and SHOULD NOT follow its redirects, so that an anchor cannot make viewers probe their own network.
  3. Compute BLAKE2b-256 of the bytes received. If it differs from root_hash, the profile MUST NOT be shown as the account's.
  4. Parse the JSON. If schema is not "pactus-profile/1", it is not a profile of this version.
  5. Ignore fields this spec does not define. Show an unknown category as other.
  6. Render text as text only. Readers SHOULD remove control, bidirectional and zero-width characters, which can make one link look like another, and SHOULD show only https: and mailto: links without credentials.

How listings are ordered or highlighted (Pactus Pages features accounts with 100 PAC or more locked) is up to each reader.

4. Versioning

New optional fields MAY be added to version 1. Readers ignore them until they know them. A change that would make existing readers misread a file uses a new schema value, such as "pactus-profile/2".

5. Reference implementation

Pactus Pages verifies profiles in the browser, and its upload gateway accepts only files that pass these rules. Both are plain JavaScript with no dependencies: BLAKE2b, the PAC-ANCHOR-1 roots and the IPFS CID of a root hash.