# immunefi-team/audit-comp-base-everest-nitro-validator architecture

> Architecture diagram of the GitHub repository immunefi-team/audit-comp-base-everest-nitro-validator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/immunefi-team/audit-comp-base-everest-nitro-validator
- Repository: https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator

## Overview

This is a Solidity AWS Nitro Enclave attestation-verification library, with Node.js tooling that prepares hinted P-384 verification calldata. The main workflow caches a verified CA-to-leaf certificate chain, then validates each attestation document against the cached chain. Certificate revocation is an administrative capability driven by off-chain CRL monitoring. The contract implementation excerpts were not provided, so Solidity relationships below rely on README statements; tool relationships use the sampled source. The graph omits unverified internal call details.

Main entry points: [`src/CertManager.sol`](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CertManager.sol) (Certificate manager), [`src/NitroValidator.sol`](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/NitroValidator.sol) (Nitro validator), [`src/P384Verifier.sol`](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/P384Verifier.sol) (P-384 verifier), [`src/Asn1Decode.sol`](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/Asn1Decode.sol) (ASN.1 decoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_contracts["Verification contracts"]
  node_cert_manager["Certificate manager<br/>[CertManager.sol]"]
  node_ca_cache[("CA chain cache<br/>[CertManager.sol]")]
  node_leaf_cache[("Leaf certificate cache<br/>[CertManager.sol]")]
  node_validator["Nitro validator<br/>[NitroValidator.sol]"]
end

subgraph group_crypto["Parsing and cryptography"]
  node_asn1["ASN.1 decoder<br/>[Asn1Decode.sol]"]
  node_cbor["CBOR decoder<br/>[CborDecode.sol]"]
  node_p384_verifier["P-384 verifier<br/>[P384Verifier.sol]"]
  node_ecdsa_curve["P-384 curve math<br/>[ECDSA384Curve.sol]"]
  node_sha2["SHA-2 extensions<br/>[Sha2Ext.sol]"]
  node_bytes_lib["Byte utilities<br/>[LibBytes.sol]"]
end

subgraph group_tools["Off-chain preparation"]
  node_hint_calls["Hinted call planner"]
  node_hints["P-384 hint generator<br/>[p384_hints.js]"]
  node_input_tool["Attestation input"]
end

node_consumer(("Verifier caller"))
node_revoker(("Authorized revoker"))
node_aws_crl["AWS CRLs"]

node_consumer -->|"caches certificates"| node_cert_manager
node_consumer -->|"submits attestation"| node_validator
node_cert_manager -->|"caches CA chain"| node_ca_cache
node_cert_manager -->|"caches leaf"| node_leaf_cache
node_validator -->|"checks cached chain"| node_cert_manager
node_revoker -->|"revokes certificates"| node_cert_manager
node_aws_crl -->|"informs revocation"| node_revoker
node_hint_calls -->|"collects hints"| node_hints
node_hint_calls -->|"loads fixture"| node_input_tool
node_hints -.->|"parses certificates"| node_asn1
node_validator -.->|"decodes attestation"| node_cbor
node_cert_manager -.->|"parses certificates"| node_asn1
node_cert_manager -->|"verifies certificates"| node_p384_verifier
node_validator -.->|"verifies signature"| node_p384_verifier
node_p384_verifier -.->|"uses curve math"| node_ecdsa_curve
node_p384_verifier -.->|"uses hashing"| node_sha2
node_asn1 -.->|"uses byte utilities"| node_bytes_lib
node_cbor -.->|"uses byte utilities"| node_bytes_lib

click node_cert_manager "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CertManager.sol"
click node_ca_cache "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CertManager.sol"
click node_leaf_cache "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CertManager.sol"
click node_validator "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/NitroValidator.sol"
click node_asn1 "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/Asn1Decode.sol"
click node_cbor "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CborDecode.sol"
click node_p384_verifier "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/P384Verifier.sol"
click node_ecdsa_curve "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/ECDSA384Curve.sol"
click node_sha2 "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/Sha2Ext.sol"
click node_bytes_lib "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/LibBytes.sol"
click node_hint_calls "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/tools/hinted_attestation_calls.js"
click node_hints "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/tools/p384_hints.js"
click node_input_tool "https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/tools/nitro_attestation_input.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cert_manager,node_ca_cache,node_leaf_cache,node_validator toneBlue
class node_asn1,node_cbor,node_p384_verifier,node_ecdsa_curve,node_sha2,node_bytes_lib toneAmber
class node_hint_calls,node_hints,node_input_tool toneMint
class node_consumer,node_revoker,node_aws_crl toneIndigo
```

## Components

### Verification contracts

- [Certificate manager](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CertManager.sol): `src/CertManager.sol`
- [CA chain cache](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CertManager.sol): `src/CertManager.sol`
- [Leaf certificate cache](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CertManager.sol): `src/CertManager.sol`
- [Nitro validator](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/NitroValidator.sol): `src/NitroValidator.sol`

### Parsing and cryptography

- [ASN.1 decoder](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/Asn1Decode.sol): `src/Asn1Decode.sol`
- [CBOR decoder](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/CborDecode.sol): `src/CborDecode.sol`
- [P-384 verifier](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/P384Verifier.sol): `src/P384Verifier.sol`
- [P-384 curve math](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/ECDSA384Curve.sol): `src/ECDSA384Curve.sol`
- [SHA-2 extensions](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/Sha2Ext.sol): `src/Sha2Ext.sol`
- [Byte utilities](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/src/LibBytes.sol): `src/LibBytes.sol`

### Off-chain preparation

- [Hinted call planner](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/tools/hinted_attestation_calls.js): `tools/hinted_attestation_calls.js`
- [P-384 hint generator](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/tools/p384_hints.js): `tools/p384_hints.js`
- [Attestation input](https://github.com/immunefi-team/audit-comp-base-everest-nitro-validator/blob/main/tools/nitro_attestation_input.js): `tools/nitro_attestation_input.js`

### Other components

- **Verifier caller**
- **Authorized revoker**
- **AWS CRLs**

## Connections

- Verifier caller → Certificate manager: caches certificates (evidence: `README.md`)
- Verifier caller → Nitro validator: submits attestation (evidence: `README.md`)
- Certificate manager → CA chain cache: caches CA chain (evidence: `README.md`)
- Certificate manager → Leaf certificate cache: caches leaf (evidence: `README.md`)
- Nitro validator → Certificate manager: checks cached chain (evidence: `README.md`)
- Authorized revoker → Certificate manager: revokes certificates (evidence: `README.md`)
- AWS CRLs → Authorized revoker: informs revocation (evidence: `README.md`)
- Hinted call planner → P-384 hint generator: collects hints (evidence: `tools/hinted_attestation_calls.js`)
- Hinted call planner → Attestation input: loads fixture (evidence: `tools/hinted_attestation_calls.js`)
- P-384 hint generator → ASN.1 decoder: parses certificates
- Nitro validator → CBOR decoder: decodes attestation
- Certificate manager → ASN.1 decoder: parses certificates
- Certificate manager → P-384 verifier: verifies certificates (evidence: `README.md`)
- Nitro validator → P-384 verifier: verifies signature
- P-384 verifier → P-384 curve math: uses curve math
- P-384 verifier → SHA-2 extensions: uses hashing
- ASN.1 decoder → Byte utilities: uses byte utilities
- CBOR decoder → Byte utilities: uses byte utilities
