This specification is maintained by the AgentRules Working Group. Have enhancements or want to claim maintainership?Submit Specification →
securitycritical PriorityID: w3c-vc-bitstring-status-list-revocation-invariant

W3C VC Bitstring Status List v1.0 Privacy & Revocation Invariant

Enforces strict compliance with the W3C Bitstring Status List v1.0 specification for privacy-preserving credential revocation. Mandates cryptographic verification of the status list credential, constant-time bitstring decompression and index resolution, aggressive caching with TTLs, and zero credential-specific tracking queries to prevent issuer correlation attacks.

Prohibited Anti-Pattern: Interactive Per-Credential Revocation Lookups and Unverified Gzip Expansion Leaking Verifier Topology

Export Ready-to-Drop Configuration

Select format below to copy code or download file directly.

---
description: W3C VC Bitstring Status List v1.0 Privacy & Revocation Invariant - Enforces strict compliance with the W3C Bitstring Status List v1.0 specification for privacy-preserving credential revocation. Mandates cryptographic verification of the status list credential, constant-time bitstring decompression and index resolution, aggressive caching with TTLs, and zero credential-specific tracking queries to prevent issuer correlation attacks.
globs: src/identity/**/*.ts, src/credentials/**/*.ts, src/verifiers/**/*.ts, src/services/revocation/**/*.ts
alwaysApply: true
verified_by: "agentrules.org"
license: "CC-BY-4.0"
source: "https://agentrules.org/rules/w3c-vc-bitstring-status-list-revocation-invariant"
---

# W3C VC Bitstring Status List v1.0 Privacy & Revocation Invariant

> **Severity**: CRITICAL | **Category**: security
> **Anti-Pattern Warning**: Interactive Per-Credential Revocation Lookups and Unverified Gzip Expansion Leaking Verifier Topology

## System Constraints
You are a Principal Identity Security Architect enforcing the W3C Verifiable Credentials Bitstring Status List v1.0 standard. You must prevent correlation attacks, timing side-channels, zip-bomb denial of service, and unauthenticated status list ingestion during revocation status evaluations.

## Strict Guidelines
- Engineers MUST ALWAYS fetch the entire BitstringStatusList credential anonymously and cache it according to HTTP Cache-Control / credential expiration directives to eliminate issuer correlation vectors.
- Engineers MUST NOT append query parameters, client identifiers, or individual statusListIndex tokens to status list dereference requests.
- Engineers MUST cryptographically verify the digital signature, issuer trust anchor, and integrity of the fetched StatusListCredential before unpacking the encoded statusList bitstring.
- Services MUST enforce strict decompression limits (max size ceiling, e.g., 16MB) before expanding multibase/gzip/zlib bitstrings to prevent resource exhaustion via decompression bombs.
- Code MUST extract the bit value at statusListIndex using constant-time masking operations and bounds checking against statusSize and bitstring byte length.
- Components NEVER accept insecure transport (plain HTTP) for status list URLs; all resolution MUST use TLS 1.3 or authenticated DID document service endpoints.

## Bad vs Good Implementations
### Bitstring Status List Evaluation: Vulnerable Phone-Home vs Secure Privacy-Preserving Verification

#### Bad Antipattern (AI Common Hallucination)
> **Why it fails**: Querying the issuer with the individual credential index reveals the exact credential being verified in real time, destroying subject privacy. Furthermore, failing to verify the StatusListCredential signature allows attackers to spoof status responses.
```typescript
import axios from 'axios';

interface CredentialStatus {
  id: string;
  type: string;
  statusListIndex: string;
  statusListCredential: string;
}

export async function checkRevocationInsecure(status: CredentialStatus): Promise<boolean> {
  // ANTI-PATTERN: Leaking index directly to issuer via query params (phone-home correlation)
  // ANTI-PATTERN: No status list credential signature verification
  const response = await axios.get(`${status.statusListCredential}?index=${status.statusListIndex}`);
  return response.data.revoked === true;
}
```

#### Production Standard (Correct)
> **Standard**: Fetches the complete status list without per-subject parameters to prevent issuer tracking, cryptographically validates the status list credential proof, applies strict decompression ceilings against denial of service, and correctly extracts the revocation state using MSB-first bit-shifting.
```typescript
import { createHash } from 'node:crypto';
import { gunzipSync } from 'node:zlib';
import { decode as decodeMultibase } from 'multibase';

interface BitstringStatusEntry {
  id: string;
  type: 'BitstringStatusListEntry';
  statusPurpose: 'revocation' | 'suspension';
  statusListIndex: string;
  statusListCredential: string;
  statusSize?: number;
}

interface StatusListCredential {
  issuer: string;
  credentialSubject: {
    id: string;
    type: 'BitstringStatusList';
    statusPurpose: string;
    encodedList: string;
  };
  proof: { type: string; proofValue: string };
}

const MAX_DECOMPRESSED_BYTES = 2 * 1024 * 1024; // 2MB limit for 16M bits

export async function verifyBitstringRevocation(
  entry: BitstringStatusEntry,
  fetchCredential: (url: string) => Promise<StatusListCredential>,
  verifyCredentialProof: (vc: StatusListCredential) => Promise<boolean>
): Promise<boolean> {
  const index = parseInt(entry.statusListIndex, 10);
  if (isNaN(index) || index < 0) {
    throw new Error('Invalid statusListIndex: must be non-negative integer');
  }

  // Invariant 1: Fetch full credential anonymously (relying on cache, zero correlation parameters)
  const statusVc = await fetchCredential(entry.statusListCredential);

  // Invariant 2: Verify authenticity and cryptographic binding of the Status List Credential
  const isProofValid = await verifyCredentialProof(statusVc);
  if (!isProofValid) {
    throw new Error('StatusListCredential signature validation failed');
  }

  const subject = statusVc.credentialSubject;
  if (subject.type !== 'BitstringStatusList' || subject.statusPurpose !== entry.statusPurpose) {
    throw new Error('Mismatched statusPurpose or credentialSubject type');
  }

  // Invariant 3: Safe multibase decode (expects 'u' for base64url or 'z' for base58btc)
  const multibaseBuffer = Buffer.from(decodeMultibase(Buffer.from(subject.encodedList)));
  
  // Invariant 4: Decompress with strict allocation bounds to defeat zip bombs
  const decompressed = gunzipSync(multibaseBuffer, { maxOutputLength: MAX_DECOMPRESSED_BYTES });

  const bytePosition = Math.floor(index / 8);
  const bitPosition = 7 - (index % 8); // MSB-first per W3C Bitstring Status List v1.0

  if (bytePosition >= decompressed.length) {
    throw new RangeError(`Index ${index} exceeds bitstring boundary (${decompressed.length * 8} bits)`);
  }

  const targetByte = decompressed[bytePosition];
  const isRevoked = ((targetByte >> bitPosition) & 0x01) === 1;

  return isRevoked;
}
```

Recommended MCP Servers (mcp-serverlist.com)

Equip agent with system tools to verify code for this stack.

Recommended Agent Skills (askills.dev)

Ready-to-use executable skill functions tailored to this stack.

Architectural Specification & Invariant Rationale

Architectural Invariant Design: W3C VC Bitstring Status List v1.0 Privacy & Revocation Invariant

W3C VC Bitstring Status List v1.0 Privacy & Revocation Invariant defines an industrial-grade behavioral standard for security engineering. Enforces strict compliance with the W3C Bitstring Status List v1.0 specification for privacy-preserving credential revocation. Mandates cryptographic verification of the status list credential, constant-time bitstring decompression and index resolution, aggressive caching with TTLs, and zero credential-specific tracking queries to prevent issuer correlation attacks. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.

Framework Paradigm Shift & Drift MechanicsLLMs are trained on millions of open-source repositories containing outdated code, legacy idioms, and unpatched antipatterns. When coding assistants generate implementations for this stack, they default to common statistical tokens: Interactive Per-Credential Revocation Lookups and Unverified Gzip Expansion Leaking Verifier Topology Without an explicit system instruction file, developers spend hours debugging silent failures.
Failure Modes & Production Blast Radius

Hazard Analysis: What Breaks Without This Rule

The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:

Failure ModeAI Symptom (The Anti-Pattern)SeverityProduction Impact & Remedy
AI Hallucination & Deprecation DriftInteractive Per-Credential Revocation Lookups and Unverified Gzip Expansion Leaking Verifier TopologyCritical
Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production.
Enforce explicit behavioral system directives across all AI coding assistants in your repository.
Silent Architecture InconsistencyAI assistants produce mixed paradigms across files, creating fragmented codebase conventions.Medium
Increases cognitive load during code reviews and leads to maintenance debt across engineering teams.
Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails.
Architectural Directives in Detail

Step-by-Step Production Directives

Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:

1

Engineers MUST ALWAYS fetch the entire BitstringStatusList credential anonymously and cache it according to HTTP Cache-Control / credential expiration directives to eliminate issuer correlation vectors.

Engineers MUST ALWAYS fetch the entire BitstringStatusList credential anonymously and cache it according to HTTP Cache-Control / credential expiration directives to eliminate issuer correlation vectors.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
2

Engineers MUST NOT append query parameters, client identifiers, or individual statusListIndex tokens to status list dereference requests.

Engineers MUST NOT append query parameters, client identifiers, or individual statusListIndex tokens to status list dereference requests.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
3

Engineers MUST cryptographically verify the digital signature, issuer trust anchor, and integrity of the fetched StatusListCredential before unpacking the encoded statusList bitstring.

Engineers MUST cryptographically verify the digital signature, issuer trust anchor, and integrity of the fetched StatusListCredential before unpacking the encoded statusList bitstring.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
4

Services MUST enforce strict decompression limits (max size ceiling, e.g., 16MB) before expanding multibase/gzip/zlib bitstrings to prevent resource exhaustion via decompression bombs.

Services MUST enforce strict decompression limits (max size ceiling, e.g., 16MB) before expanding multibase/gzip/zlib bitstrings to prevent resource exhaustion via decompression bombs.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
5

Code MUST extract the bit value at statusListIndex using constant-time masking operations and bounds checking against statusSize and bitstring byte length.

Code MUST extract the bit value at statusListIndex using constant-time masking operations and bounds checking against statusSize and bitstring byte length.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
6

Components NEVER accept insecure transport (plain HTTP) for status list URLs

Components NEVER accept insecure transport (plain HTTP) for status list URLs; all resolution MUST use TLS 1.3 or authenticated DID document service endpoints.

Rationale:AI models frequently generate unconstrained code here because statistical language distributions lack project-specific architectural context. Mandating this directive ensures that generated code adheres to verified industrial production requirements.
Enforcement:Integrated into the Agent Pack rule file. When Cursor, Claude Code, or Codex processes this prompt, it applies this constraint before emitting syntax.
Technical Questions & Answers

Frequently Asked Technical Questions

Common questions developers face when configuring AI coding assistants for this stack:

Q:Why is W3C VC Bitstring Status List v1.0 Privacy & Revocation Invariant critical for AI coding assistants?

Enforces strict compliance with the W3C Bitstring Status List v1.0 specification for privacy-preserving credential revocation. Mandates cryptographic verification of the status list credential, constant-time bitstring decompression and index resolution, aggressive caching with TTLs, and zero credential-specific tracking queries to prevent issuer correlation attacks. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.

Q:How does adopting this rule prevent AI hallucinations?

This rule explicitly declares what the AI must avoid (Interactive Per-Credential Revocation Lookups and Unverified Gzip Expansion Leaking Verifier Topology) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.

Q:Which AI coding environments are supported?

This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).

Q:Can I combine this rule with other technology stacks?

Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.

Open Specification · CC BY 4.0·Free for Personal, Team & Commercial In-Repo Use

Citation & Open Source Attribution Guidelines

This specification is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). You are completely free to adapt and share this rule in your workspace. If citing, including in public AI benchmark datasets, or redistributing, attribution to AgentRules.org is required.

1 Rule in Stack

W3C