# dev.malpercio.cards.give

> Issuance of a single card instance or a sealed pack, written by the provider into its own repo. This record is the root of a card's provenance chain and its at-URI is the card's permanent identity. The rkey is a TID, so issuance order is implicit.

- Kind: record
- Record key: tid
- Authority: cards.malpercio.dev
- Lexicon: 1
- Published by [cards.malpercio.dev](https://lexicon.garden/identity/did:plc:kmg2eqexpdefljft34crzesc), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:kmg2eqexpdefljft34crzesc/dev.malpercio.cards.give)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:kmg2eqexpdefljft34crzesc/dev.malpercio.cards.give/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:kmg2eqexpdefljft34crzesc/dev.malpercio.cards.give/analytics)

## Record (`dev.malpercio.cards.give`)

Type: record · key tid

### Properties

- `context` (string): Why it was issued, e.g. 'Opened from pack at://...'.
  - Constraints: maxLength: 512
- `givenAt` (string · datetime, required)
- `issue` (union, required): What was issued: a single card or a sealed pack.
  - One of: `#cardIssue`, `#packIssue`
- `recipient` (string · did, required): The DID this give was issued to.
- `revokedAt` (string · datetime): Set to invalidate this give. Verifiers must treat the whole downstream chain as void.
- `set` (ref, required): The dev.malpercio.cards.set manifest this was printed from.
  - Reference: `com.atproto.repo.strongRef`
- `source` (string · at-uri): The record that triggered issuance, e.g. the like on a pack post. For packs, the seed is derived from it.

## #cardIssue (`dev.malpercio.cards.give#cardIssue`)

Type: object

A single card instance.

### Properties

- `assetCid` (string · cid, required): Copied from the set manifest; the canonical fingerprint owner copies must match.
- `cardId` (string, required)
  - Constraints: maxLength: 64
- `fromPack` (ref): The pack give this card was opened from, if any.
  - Reference: `com.atproto.repo.strongRef`
- `iconCid` (string · cid)
- `serial` (integer, required): 1-based print number, unique per (set, cardId, variantId).
  - Constraints: minimum: 1
- `variantId` (string)
  - Constraints: maxLength: 64

## #packIssue (`dev.malpercio.cards.give#packIssue`)

Type: object

A sealed pack. Contents are drawn and reserved against supply caps at creation, committed by CID, and revealed on open.

### Properties

- `assetCid` (string · cid)
- `cardCount` (integer, required): Number of card gives reserved by this pack.
  - Constraints: minimum: 1
- `contentsCid` (string · cid, required): CID of the DAG-CBOR object {seed, cards:[{cardId, variantId?}]} drawn at creation. Proves the pull was fixed before opening.
- `openedAt` (string · datetime)
- `packId` (string, required)
  - Constraints: maxLength: 64
- `produced` (array): The card gives minted when this pack was opened.
  - `items` (ref)
    - Reference: `com.atproto.repo.strongRef`
- `seed` (string): Revealed on open so anyone can rebuild the contents object and recompute contentsCid.
  - Constraints: maxLength: 128
- `serial` (integer)
  - Constraints: minimum: 1

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "cardIssue": {
      "description": "A single card instance.",
      "properties": {
        "assetCid": {
          "description": "Copied from the set manifest; the canonical fingerprint owner copies must match.",
          "format": "cid",
          "type": "string"
        },
        "cardId": {
          "maxLength": 64,
          "type": "string"
        },
        "fromPack": {
          "description": "The pack give this card was opened from, if any.",
          "ref": "com.atproto.repo.strongRef",
          "type": "ref"
        },
        "iconCid": {
          "format": "cid",
          "type": "string"
        },
        "serial": {
          "description": "1-based print number, unique per (set, cardId, variantId).",
          "minimum": 1,
          "type": "integer"
        },
        "variantId": {
          "maxLength": 64,
          "type": "string"
        }
      },
      "required": [
        "cardId",
        "serial",
        "assetCid"
      ],
      "type": "object"
    },
    "main": {
      "description": "Issuance of a single card instance or a sealed pack, written by the provider into its own repo. This record is the root of a card's provenance chain and its at-URI is the card's permanent identity. The rkey is a TID, so issuance order is implicit.",
      "key": "tid",
      "record": {
        "properties": {
          "context": {
            "description": "Why it was issued, e.g. 'Opened from pack at://...'.",
            "maxLength": 512,
            "type": "string"
          },
          "givenAt": {
            "format": "datetime",
            "type": "string"
          },
          "issue": {
            "description": "What was issued: a single card or a sealed pack.",
            "refs": [
              "#cardIssue",
              "#packIssue"
            ],
            "type": "union"
          },
          "recipient": {
            "description": "The DID this give was issued to.",
            "format": "did",
            "type": "string"
          },
          "revokedAt": {
            "description": "Set to invalidate this give. Verifiers must treat the whole downstream chain as void.",
            "format": "datetime",
            "type": "string"
          },
          "set": {
            "description": "The dev.malpercio.cards.set manifest this was printed from.",
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "source": {
            "description": "The record that triggered issuance, e.g. the like on a pack post. For packs, the seed is derived from it.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "set",
          "recipient",
          "givenAt",
          "issue"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "packIssue": {
      "description": "A sealed pack. Contents are drawn and reserved against supply caps at creation, committed by CID, and revealed on open.",
      "properties": {
        "assetCid": {
          "format": "cid",
          "type": "string"
        },
        "cardCount": {
          "description": "Number of card gives reserved by this pack.",
          "minimum": 1,
          "type": "integer"
        },
        "contentsCid": {
          "description": "CID of the DAG-CBOR object {seed, cards:[{cardId, variantId?}]} drawn at creation. Proves the pull was fixed before opening.",
          "format": "cid",
          "type": "string"
        },
        "openedAt": {
          "format": "datetime",
          "type": "string"
        },
        "packId": {
          "maxLength": 64,
          "type": "string"
        },
        "produced": {
          "description": "The card gives minted when this pack was opened.",
          "items": {
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "type": "array"
        },
        "seed": {
          "description": "Revealed on open so anyone can rebuild the contents object and recompute contentsCid.",
          "maxLength": 128,
          "type": "string"
        },
        "serial": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "packId",
        "cardCount",
        "contentsCid"
      ],
      "type": "object"
    }
  },
  "id": "dev.malpercio.cards.give",
  "lexicon": 1
}
```
