standardize image URI for IdentitySnapshots

This commit is contained in:
Jason Dreyzehner
2023-05-09 12:11:17 -04:00
parent 924593cfc4
commit 852916c341
3 changed files with 21 additions and 9 deletions
+6 -5
View File
@@ -56,7 +56,7 @@
}, },
"uris": { "uris": {
"$ref": "#/definitions/URIs", "$ref": "#/definitions/URIs",
"description": "A mapping of identifiers to URIs associated with this identity. URI identifiers may be widely-standardized or registry-specific. Values must be valid URIs, including a protocol prefix (e.g. `https://` or `ipfs://`). Clients are only required to support `https` and `ipfs` URIs, but any scheme may be specified.\n\nThe following identifiers are recommended for all identities:\n- `icon`\n- `web`\n\nThe following optional identifiers are standardized:\n- `blog`\n- `chat`\n- `forum`\n- `icon-intro`\n- `registry`\n- `support`\n\nFor details on these standard identifiers, see: https://github.com/bitjson/chip-bcmr#uri-identifiers\n\nCustom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`).\n\nFor example, some common identifiers include: `discord`, `docker`, `facebook`, `git`, `github`, `gitter`, `instagram`, `linkedin`, `matrix`, `npm`, `reddit`, `slack`, `substack`, `telegram`, `twitter`, `wechat`, `youtube`." "description": "A mapping of identifiers to URIs associated with this identity. URI identifiers may be widely-standardized or registry-specific. Values must be valid URIs, including a protocol prefix (e.g. `https://` or `ipfs://`). Clients are only required to support `https` and `ipfs` URIs, but any scheme may be specified.\n\nThe following identifiers are recommended for all identities:\n- `icon`\n- `web`\n\nThe following optional identifiers are standardized:\n- `blog`\n- `chat`\n- `forum`\n- `icon-intro`\n- `image`\n- `migrate`\n- `registry`\n- `support`\n\nFor details on these standard identifiers, see: https://github.com/bitjson/chip-bcmr#uri-identifiers\n\nCustom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`).\n\nFor example, some common identifiers include: `discord`, `docker`, `facebook`, `git`, `github`, `gitter`, `instagram`, `linkedin`, `matrix`, `npm`, `reddit`, `slack`, `substack`, `telegram`, `twitter`, `wechat`, `youtube`."
} }
}, },
"required": ["name", "token"], "required": ["name", "token"],
@@ -90,7 +90,7 @@
}, },
"IdentityHistory": { "IdentityHistory": {
"$ref": "#/definitions/RegistryTimestampKeyedValues<IdentitySnapshot>", "$ref": "#/definitions/RegistryTimestampKeyedValues<IdentitySnapshot>",
"description": "A timestamp-keyed map of {@link IdentitySnapshot } s documenting the evolution of a particular identity. Typically, the current identity information is the latest record when lexicographically sorted, but in cases where a planned migration has not yet begun (the snapshot's timestamp has not yet been reached), the immediately preceding record is considered the current identity.\n\nThis strategy allows wallets and other user interfaces to offer better experiences when an identity is rebranded, a token redenominated, or other important metadata is modified in a coordinated update. For example, a wallet may warn token holders of a forthcoming rebranding of fungible tokens they hold; after the change, the wallet may continue to offer prominent interface hints that the rebranded token identity was recently updated.\n\nNote, only the latest two {@link IdentitySnapshot } s should be considered part of an identity's \"current\" information. E.g. even if two snapshots have active, overlapping migration periods (i.e. an older snapshot's\n {@link IdentitySnapshot.migrated } timestamp has not yet been reached), clients should only attempt to display the migration from the previous to the latest snapshot.\n\nIf the current snapshot's {@link IdentitySnapshot.migrated } isn't specified, the snapshot's index is a precise time at which the snapshot takes effect and clients should begin using the new information. If `migrated` is specified, the snapshot's index is the timestamp at which the transition is considered to begin, see {@link IdentitySnapshot.migrated } for details.\n\nEach timestamp must be provided in simplified extended ISO 8601 format, a 24-character string of format `YYYY-MM-DDTHH:mm:ss.sssZ` where timezone is zero UTC (denoted by `Z`). Note, this is the format returned by ECMAScript `Date.toISOString()`.\n\nIn the case that an identity change occurs due to on-chain activity (e.g. an on-chain migration that is set to complete at a particular locktime value), registry-recorded timestamps reflect the real-world time at which the maintainer of the registry believes the on-chain activity to have actually occurred. Likewise, future-dated timestamps indicate a precise real-world time at which a snapshot is estimated to take effect, rather than the Median Time Past (BIP113) UNIX timestamp or another on-chain measurement of time." "description": "A timestamp-keyed map of {@link IdentitySnapshot } s documenting the evolution of a particular identity. The current identity information is the snapshot associated with the latest timestamp reached. If no timestamp has yet been reached, the snapshot of the oldest timestamp is considered current. Future-dated timestamps indicate planned migrations.\n\nThis strategy allows wallets and other user interfaces to offer better experiences when an identity is rebranded, a token redenominated, or other important metadata is modified in a coordinated update. For example, a wallet may warn token holders of a forthcoming rebranding of fungible tokens they hold; after the change, the wallet may continue to offer prominent interface hints that the rebranded token identity was recently updated.\n\nTimestamps may be order by time via lexicographical sort. For determinism, it is recommended that implementations sort from newest to oldest in exported registry JSON files.\n\nIf the current snapshot's {@link IdentitySnapshot.migrated } isn't specified, the snapshot's index is a precise time at which the snapshot takes effect and clients should begin using the new information. If `migrated` is specified, the snapshot's index is the timestamp at which the transition is considered to begin, see {@link IdentitySnapshot.migrated } for details.\n\nEach timestamp must be provided in simplified extended ISO 8601 format, a 24-character string of format `YYYY-MM-DDTHH:mm:ss.sssZ` where timezone is zero UTC (denoted by `Z`). Note, this is the format returned by ECMAScript `Date.toISOString()`.\n\nIn the case that an identity change occurs due to on-chain activity (e.g. an on-chain migration that is set to complete at a particular locktime value), registry-recorded timestamps reflect the real-world time at which the maintainer of the registry believes the on-chain activity to have actually occurred. Likewise, future-dated timestamps indicate a precise real-world time at which a snapshot is estimated to take effect, rather than the Median Time Past (BIP113) UNIX timestamp or another on-chain measurement of time."
}, },
"IdentitySnapshot": { "IdentitySnapshot": {
"additionalProperties": false, "additionalProperties": false,
@@ -134,7 +134,7 @@
}, },
"uris": { "uris": {
"$ref": "#/definitions/URIs", "$ref": "#/definitions/URIs",
"description": "A mapping of identifiers to URIs associated with this identity. URI identifiers may be widely-standardized or registry-specific. Values must be valid URIs, including a protocol prefix (e.g. `https://` or `ipfs://`). Clients are only required to support `https` and `ipfs` URIs, but any scheme may be specified.\n\nThe following identifiers are recommended for all identities:\n- `icon`\n- `web`\n\nThe following optional identifiers are standardized:\n- `blog`\n- `chat`\n- `forum`\n- `icon-intro`\n- `registry`\n- `support`\n\nFor details on these standard identifiers, see: https://github.com/bitjson/chip-bcmr#uri-identifiers\n\nCustom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`).\n\nFor example, some common identifiers include: `discord`, `docker`, `facebook`, `git`, `github`, `gitter`, `instagram`, `linkedin`, `matrix`, `npm`, `reddit`, `slack`, `substack`, `telegram`, `twitter`, `wechat`, `youtube`." "description": "A mapping of identifiers to URIs associated with this identity. URI identifiers may be widely-standardized or registry-specific. Values must be valid URIs, including a protocol prefix (e.g. `https://` or `ipfs://`). Clients are only required to support `https` and `ipfs` URIs, but any scheme may be specified.\n\nThe following identifiers are recommended for all identities:\n- `icon`\n- `web`\n\nThe following optional identifiers are standardized:\n- `blog`\n- `chat`\n- `forum`\n- `icon-intro`\n- `image`\n- `migrate`\n- `registry`\n- `support`\n\nFor details on these standard identifiers, see: https://github.com/bitjson/chip-bcmr#uri-identifiers\n\nCustom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`).\n\nFor example, some common identifiers include: `discord`, `docker`, `facebook`, `git`, `github`, `gitter`, `instagram`, `linkedin`, `matrix`, `npm`, `reddit`, `slack`, `substack`, `telegram`, `twitter`, `wechat`, `youtube`."
} }
}, },
"required": ["name"], "required": ["name"],
@@ -275,6 +275,7 @@
}, },
"OffChainRegistryIdentity": { "OffChainRegistryIdentity": {
"additionalProperties": false, "additionalProperties": false,
"description": "An identity representing a metadata registry that is not published on-chain and therefore has no authbase or trackable authchain.",
"properties": { "properties": {
"description": { "description": {
"description": "A string describing this identity for use in user interfaces.\n\nIn user interfaces with limited space, descriptions should be hidden beyond the first newline character or `140` characters until revealed by the user.\n\nE.g.:\n- `The common stock issued by ACME, Inc.`\n- `A metadata registry maintained by Company Name, the embedded registry for Wallet Name.`\n- `Software developer and lead maintainer of Wallet Name.`", "description": "A string describing this identity for use in user interfaces.\n\nIn user interfaces with limited space, descriptions should be hidden beyond the first newline character or `140` characters until revealed by the user.\n\nE.g.:\n- `The common stock issued by ACME, Inc.`\n- `A metadata registry maintained by Company Name, the embedded registry for Wallet Name.`\n- `Software developer and lead maintainer of Wallet Name.`",
@@ -297,7 +298,7 @@
}, },
"uris": { "uris": {
"$ref": "#/definitions/URIs", "$ref": "#/definitions/URIs",
"description": "A mapping of identifiers to URIs associated with this identity. URI identifiers may be widely-standardized or registry-specific. Values must be valid URIs, including a protocol prefix (e.g. `https://` or `ipfs://`). Clients are only required to support `https` and `ipfs` URIs, but any scheme may be specified.\n\nThe following identifiers are recommended for all identities:\n- `icon`\n- `web`\n\nThe following optional identifiers are standardized:\n- `blog`\n- `chat`\n- `forum`\n- `icon-intro`\n- `registry`\n- `support`\n\nFor details on these standard identifiers, see: https://github.com/bitjson/chip-bcmr#uri-identifiers\n\nCustom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`).\n\nFor example, some common identifiers include: `discord`, `docker`, `facebook`, `git`, `github`, `gitter`, `instagram`, `linkedin`, `matrix`, `npm`, `reddit`, `slack`, `substack`, `telegram`, `twitter`, `wechat`, `youtube`." "description": "A mapping of identifiers to URIs associated with this identity. URI identifiers may be widely-standardized or registry-specific. Values must be valid URIs, including a protocol prefix (e.g. `https://` or `ipfs://`). Clients are only required to support `https` and `ipfs` URIs, but any scheme may be specified.\n\nThe following identifiers are recommended for all identities:\n- `icon`\n- `web`\n\nThe following optional identifiers are standardized:\n- `blog`\n- `chat`\n- `forum`\n- `icon-intro`\n- `image`\n- `migrate`\n- `registry`\n- `support`\n\nFor details on these standard identifiers, see: https://github.com/bitjson/chip-bcmr#uri-identifiers\n\nCustom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`).\n\nFor example, some common identifiers include: `discord`, `docker`, `facebook`, `git`, `github`, `gitter`, `instagram`, `linkedin`, `matrix`, `npm`, `reddit`, `slack`, `substack`, `telegram`, `twitter`, `wechat`, `youtube`."
} }
}, },
"required": ["name"], "required": ["name"],
@@ -392,7 +393,7 @@
"type": "number" "type": "number"
}, },
"patch": { "patch": {
"description": "The patch version is incremented when an existing identity or identity snapshot is modified (e.g. to correct an error or add a missing piece of information) or when other registry properties (e.g. registry `name`, `description`, `uris`, etc.) are modified.\n\nGenerally, substantive changes to an existing identity should be made using a new identity snapshot in a minor version upgrade – this allows clients to provide a better user experience by noting the change in relevant user interfaces.\n\nFor example, patch upgrades might include spelling corrections in an existing snapshot or the addition of an `icon-svg` containing a higher-resolution version of an existing `icon` image. On the other hand, a rebranding in which the icon is substantially changed may warrant a new identity snapshot to be added in a minor version upgrade.", "description": "The patch version is incremented when an existing identity or identity snapshot is modified (e.g. to correct an error or add a missing piece of information) or when other registry properties (e.g. registry `name`, `description`, `uris`, etc.) are modified.\n\nGenerally, substantive changes to an existing identity should be made using a new identity snapshot in a minor version upgrade – this allows clients to provide a better user experience by noting the change in relevant user interfaces.\n\nFor example, patch upgrades might include spelling corrections in an existing snapshot or the addition of an `icon` containing a higher-resolution version of an existing `icon` image. On the other hand, a rebranding in which the icon is substantially changed may warrant a new identity snapshot to be added in a minor version upgrade.",
"type": "number" "type": "number"
} }
}, },
+6 -1
View File
@@ -601,6 +601,7 @@ export type IdentitySnapshot = {
* - `chat` * - `chat`
* - `forum` * - `forum`
* - `icon-intro` * - `icon-intro`
* - `image`
* - `migrate` * - `migrate`
* - `registry` * - `registry`
* - `support` * - `support`
@@ -732,6 +733,10 @@ export type ChainHistory = RegistryTimestampKeyedValues<ChainSnapshot>;
*/ */
export type IdentityHistory = RegistryTimestampKeyedValues<IdentitySnapshot>; export type IdentityHistory = RegistryTimestampKeyedValues<IdentitySnapshot>;
/**
* An identity representing a metadata registry that is not published on-chain
* and therefore has no authbase or trackable authchain.
*/
export type OffChainRegistryIdentity = Pick< export type OffChainRegistryIdentity = Pick<
IdentitySnapshot, IdentitySnapshot,
'name' | 'description' | 'uris' | 'tags' | 'extensions' 'name' | 'description' | 'uris' | 'tags' | 'extensions'
@@ -780,7 +785,7 @@ export type Registry = {
* relevant user interfaces. * relevant user interfaces.
* *
* For example, patch upgrades might include spelling corrections in an * For example, patch upgrades might include spelling corrections in an
* existing snapshot or the addition of an `icon-svg` containing a * existing snapshot or the addition of an `icon` containing a
* higher-resolution version of an existing `icon` image. On the other hand, * higher-resolution version of an existing `icon` image. On the other hand,
* a rebranding in which the icon is substantially changed may warrant a new * a rebranding in which the icon is substantially changed may warrant a new
* identity snapshot to be added in a minor version upgrade. * identity snapshot to be added in a minor version upgrade.
+9 -3
View File
@@ -240,7 +240,7 @@ Several URI identifiers are standardized by this specification, and any number o
##### Recommended URI Identifiers ##### Recommended URI Identifiers
The following identifiers are strongly recommended for all identities and tags: The following identifiers are strongly recommended for `IdentitySnapshot`s and `Tag`s:
| Identifier | Description | | Identifier | Description |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -249,7 +249,7 @@ The following identifiers are strongly recommended for all identities and tags:
##### Optional URI Identifiers ##### Optional URI Identifiers
The following optional URI identifiers are standardized: The following optional URI identifiers are standardized for `IdentitySnapshot`s and `Tag`s:
| Identifier | Description | | Identifier | Description |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -257,10 +257,16 @@ The following optional URI identifiers are standardized:
| `chat` | A URI identifying a community chatroom for this identity or tag. | | `chat` | A URI identifying a community chatroom for this identity or tag. |
| `forum` | A URI identifying a community forum for this identity or tag. | | `forum` | A URI identifying a community forum for this identity or tag. |
| `icon-intro` | A URI pointing to a square, animated icon that represents this identity or tag. The animation should play once (without looping) to introduce the static icon. Transparency is supported, and icons should be suitable for display against both light and dark backgrounds. Acceptable formats are `SVG`, `AVIF`, or `WebP`. For raster formats, the recommended size is `400px` by `400px`. | | `icon-intro` | A URI pointing to a square, animated icon that represents this identity or tag. The animation should play once (without looping) to introduce the static icon. Transparency is supported, and icons should be suitable for display against both light and dark backgrounds. Acceptable formats are `SVG`, `AVIF`, or `WebP`. For raster formats, the recommended size is `400px` by `400px`. |
| `migrate` | (Standardized only for `IdentitySnapshot`s.) A URI identifying a resource with information about the change resulting in this snapshot. For snapshots in which `token.category` is modified (e.g. a re-issuance, vote, payout, dividend, etc.), this resource should provide guidance about how holders of the previous token category may exchange tokens for those of the new category. |
| `registry` | The primary-source registry URI for this identity or tag. For DNS-resolved registries, this is the full, [Well-Known URI](#well-known-uri) from which the registry can be downloaded. For chain-resolved registries and other identities, this is the full URI of the latest registry published on-chain by the identity. For tags, The `registry` identifier should only be used when a tag represents a formal designation by a particular authority (certification, membership, ownership, etc.); when present, this URI points to the canonical registry published by that authority. Tags without this identifier are assumed to be created and applied by the containing registry. | | `registry` | The primary-source registry URI for this identity or tag. For DNS-resolved registries, this is the full, [Well-Known URI](#well-known-uri) from which the registry can be downloaded. For chain-resolved registries and other identities, this is the full URI of the latest registry published on-chain by the identity. For tags, The `registry` identifier should only be used when a tag represents a formal designation by a particular authority (certification, membership, ownership, etc.); when present, this URI points to the canonical registry published by that authority. Tags without this identifier are assumed to be created and applied by the containing registry. |
| `support` | A URI offering user-facing support for this identity or tag. | | `support` | A URI offering user-facing support for this identity or tag. |
The following optional URI identifiers are standardized only for `IdentitySnapshot`s:
| Identifier | Description |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `image` | A URI pointing to a static image of the asset represented by this identity. Transparency is supported, and images should be suitable for display against both light and dark backgrounds. Acceptable formats are `SVG`, `AVIF`, `WebP`, or `PNG`. |
| `migrate` | A URI identifying a resource with information about the change resulting in this snapshot. For snapshots in which `token.category` is modified (e.g. a re-issuance, vote, payout, dividend, etc.), this resource should provide guidance about how holders of the previous token category may exchange tokens for those of the new category. |
##### Custom URI identifiers ##### Custom URI identifiers
Custom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`). Custom URI identifiers allow for sharing social networking profiles, p2p connection information, and other application-specific URIs. Identifiers must be lowercase, alphanumeric strings, with no whitespace or special characters other than dashes (as a regular expression: `/^[-a-z0-9]+$/`).