# What should we store?
With respect to revocation in the AnonCreds implementation in ACA-Py
### Register a revocation registry definition
Endpoint: `rev_reg_def_post`
This endpoint calls `init_issuer_registry()`, which constructs an `IssuerRevRegRecord`, storing
* `new_with_id` (Boolean)
* `record_id`
* `cred_def_id`
* `issuer_id`
* `max_cred_num`
* `revoc_def_type`
* `tag`
* `options`
The method `create_and_register_def()` is called on the record created by `init_issuer_registry`, which:
* calls the `AnonCredsIssuer` method `create_and_register_revocation_registry_definition()`, storing the following information:
* `rev_reg_def_id`
* `rev_reg_def_json`
* `rev_reg_def_private`
* and stores the following information:
* `revoc_reg_id`
* `revoc_reg_def`
* `state`
* `tails_hash`
* `tails_public_uri`
* `tails_local_path`
`IssuerRevRegRecord.create_and_register_def()` has some redundant record saving (`issuer_rev_reg_record.py` lines 196-197). We concluded that this minimal redundancy is acceptable.
### Register a revocation list
Endpoint: `rev_list_post`
This endpoint calls `IssuerRevRegRecord.create_and_register_list()`, which:
* calls `AnonCredsIssuer.create_and_register_revocation_list()`
* `create_and_register_revocation_list()`, which stores
* `revocation_list` (from `revocation_list_state`)
* and stores
* `revoc_reg_id`
* `revoc_def_type`
* `issuer_id`
* `tails_public_uri`
* `state`
### Revoke a credential
Endpoint: `revoke`
* Calls `rev_manager.revoke_credential_by_cred_ex_id` or `rev_manager.revoke_credential`, each of which:
* calls `rev_manager.revoke_credential`
* If notify, stores `rev_notify_rec`, which contains
* `rev_reg_id`
* `cred_rev_id`
* `thread_id`
* `connection_id`
* `comment`
* `notify_version`
* If publish, calls `AnonCredsIssuer.revoke_credentials`
* Not sure if this stores anything in the wallet?
### Issue a credential
Endpoint: `credential_exchange_issue`
* Calls `V20CredManager.issue_credential`, which calls `IndyCredFormatHandler.issue_credential`
* `IndyCredFormatHandler.issue_credential` calls `AnonCredsRevocation.get_or_create_active_registry`
* If an `IssuerRevRegRecord` is not found, we call `init_issuer_registry`, which creates an `IssuerRevRegRecord`, storing the following information:
* `new_with_id` (Boolean)
* `record_id`
* `cred_def_id`
* `issuer_id`
* `max_cred_num`
* `revoc_def_type`
* `tag`
* `options`
* Note: `tails_path` is set to `rev_reg.tails_local_path` (in `IndyCredFormatHandler` line 355)
* Calls `AnonCredsIssuer.create_credential`
* Replaces the contents of `CATEGORY_REV_REG_INFO`, saving `rev_info`
* ~~Might be a bug in AnonCredsRevocation.handle_full_registry~~ Fixed!
* When we make the following call:
```
await self.init_issuer_registry(
registry.cred_def_id,
registry.max_cred_num,
registry.revoc_def_type,
)
```
~~we've got an issue with the positional arguments (need to first pas in an~~ `issuer_id`)
* Creates a `V20CredExRecordIndy` object, storing:
* `cred_ex_id`
* `rev_reg_id`
* `cred_rev_id`
* If revocable and cred_rev_id, we create an `IssuerCredRevRecord`, storing:
* `state` (as `STATE_ISSUED`)
* `cred_ex_id`
* `cred_ex_version` (as `VERSION_2`)
* `rev_reg_id`
* `cred_rev_id`