Deposit and redeem
A deposit moves an attested card into the vault and mints 1,000 card tokens; a redemption burns 1,000 card tokens and releases the oldest card still held. Nobody can choose which copy comes out, so nobody can pick the best copy of a class.
On this page
Deposit
deposit checks, in order:
- The card's collection is in the vault's accepted list.
- The attestation has not expired.
- The card is a Core asset, its owner is the depositor, and its update authority is that collection.
- The attestation matches this deposit exactly. See Attestation.
Then:
- A Core transfer moves the card to the vault PDA. Core itself refuses a frozen card.
- A copy record is written at the end of the class's queue, with the card, its record hash, its grader cert number, the depositor and the time.
- A held marker is created for the card at
["held", asset], so one card can never back two copies. - The class counts one more card held.
- The vault mints 1,000 card tokens to the depositor's token account.
- The class's backing flag is refreshed. A deposit fails if the class would still be short of backing after it.
Donating a card
A deposit with donate set adds a card of backing and mints nothing. It is how a class that is short of backing is made whole again.
Redeem
redeem takes the copy at the head of the class's queue, which must be held. It then:
- Burns 1,000 card tokens from the redeemer.
- Transfers the card to the redeemer, signed by the vault PDA.
- Marks the copy redeemed, closes its held marker and moves the head to the next copy.
- Refreshes the class's backing flag.
Redemption is first in, first out. There is no way to choose a copy. A redeemed card can be deposited again later, under a new place in the queue.
Keeping the queue moving
redeem only takes the head copy, so three permissionless instructions keep the queue from getting stuck.
| Instruction | When | What it does |
|---|---|---|
skip | The head copy is not held (missing, redeemed or requeued) | Moves the head past it |
requeue | The head copy is held, but a freeze plugin on the card or its collection would make Core refuse to move it | Writes a new held copy with the same card at the end of the queue, marks the old one requeued, advances the head |
restore | A copy marked missing is owned by the vault again | Adds it back as a new held copy at the end, counts it as held again, refreshes the flag |
requeue fails when nothing is frozen. A card's own unfrozen permanent freeze delegate overrides a frozen collection, as Core lets it.
Copy statuses
| Status | Meaning |
|---|---|
| Held | In the vault, backing 1,000 card tokens |
| Redeemed | Released to a redeemer |
| Missing | Proven gone from the vault by a poke |
| Requeued | Replaced by a new held copy later in the queue |
The rest of this path
Written from the protocol, security and card documents of the pokedex repository and from its code (card-vault, card-launch, cp-ix). Every figure on these pages comes from there.