ZcapLd.Core 6.0.1

dotnet add package ZcapLd.Core --version 6.0.1
                    
NuGet\Install-Package ZcapLd.Core -Version 6.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZcapLd.Core" Version="6.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZcapLd.Core" Version="6.0.1" />
                    
Directory.Packages.props
<PackageReference Include="ZcapLd.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZcapLd.Core --version 6.0.1
                    
#r "nuget: ZcapLd.Core, 6.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZcapLd.Core@6.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZcapLd.Core&version=6.0.1
                    
Install as a Cake Addin
#tool nuget:?package=ZcapLd.Core&version=6.0.1
                    
Install as a Cake Tool

ZcapLd.Core

.NET 10 library for the supported ZCAP v0.4.0 profile: root and delegated capabilities, Ed25519/P-256 proofs, controller authorization, replay protection, and signed revocation. Proofs use RDFC-1.0 through DataProofs and NetCrypto.

Provide an IDidSigner and IDidResolver; no private-key store is installed by default. DidKeyResolver handles did:key. For several DID methods, register one adapter per method in a CompositeDidResolver (full prefixes such as "did:web:"): it routes key resolution and controller authorization to the adapter for the controller's method, so each adapter should also implement NetDid's IVerificationRelationshipResolver. Key-only adapters fail closed.

var signing = new SigningService(didSigner, didResolver);
var capabilities = new CapabilityService(signing);
var root = await capabilities.CreateRootCapabilityAsync(ownerDid, "https://example.com/reports");
var child = await capabilities.DelegateCapabilityAsync(root, agentDid, new[] { "read" },
    DateTime.UtcNow.AddDays(1));
var verifier = new VerificationService(didResolver);
var invocation = capabilities.CreateInvocation(child, "read");
invocation.Proof = await signing.SignInvocationAsync(invocation, agentDid);
bool authorized = await verifier.VerifyInvocationAsync(invocation, child, root);

Supply the root explicitly as above, or configure IRootCapabilityResolver. For cross-stack invocation use SignCapabilityInvocationAsync and VerifyCapabilityInvocationAsync; the relying party supplies its expected action and target. The root is referenced by ID; a delegated invocation embeds the zcap.

Prefer expires, allowedAction and an optional delegation invocationTarget. Without a CaveatTypeRegistry, incoming caveat fields are rejected even when null or empty, and equivalent IRI/prefixed keys and nested restrictions are rejected throughout capability/proof JSON. Contexts must be zcap/v1, a supported proof-suite context or a registered caveat context; inline aliases and unrelated vocabularies are unsupported.

Version 6 restores custom caveats as an opt-in extension profile (#157), which other ZCAP stacks do not accept. Subclass Caveat and register the class with CaveatTypeRegistry. Pass the registry to SigningService, CapabilityService and VerificationService, and register an ICaveatHandler per type at the resource. Every parameter is signed through a pinned per-type context. Children must restate and narrow inherited caveats. Only invocation verification authorizes caveats; chain checks return CaveatEnforcementRequired. See docs/CAVEAT-PROFILE.md in the repository. VerificationPolicy.AllowTargetAttenuation defaults to false; explicitly enable it for path/query narrowing. The target API must enforce parameter semantics.

Use IRevocationStore and signed revocation requests. Replicated verifiers must share authoritative revocation state; there is no automatic polling of a URI supplied by a capability holder. INonceStore must likewise be shared when replay protection spans verifier instances.

Revocation records are keyed by the capability id and a RevocationScope: the delegator that signed the capability (the DID of its delegation proof's verification method, as bedrock-zcap-storage keys them), the root, or, for migrated 5.x and operator records only, every chain. A forged copy of an id under another chain lands in the forger's scope, where no genuine chain looks. Custom IRevocationStores key rows by RevocationRecord.Key, never by the id. See Revocation scope.

Native AOT, trimming and .NET 10 file-based apps (dotnet run app.cs) are supported since 6.0.1; the package declares IsAotCompatible (#154). zcap's wire models serialize through source-generated metadata, so the round trip above needs nothing from you. Custom caveats register through generated metadata: Register<TCaveat>(string, JsonTypeInfo<TCaveat>) with a JsonSerializerContext that lists the class; the reflection overload is annotated and throws where reflection-based serialization is disabled. ZcapJsonOptions.Default resolves zcap's types through its generated context first and, only when JsonSerializer.IsReflectionEnabledByDefault is true, your own types through reflection as before; under AOT an unlisted type throws NotSupportedException. Capability.Context and Proof.CapabilityChain accept a string, a JsonElement, a JsonNode or arrays of those without reflection. The generated context is internal: to embed a Capability in your own source-generated DTO, keep the member a JsonElement and convert with ZcapJsonOptions.Default.GetTypeInfo(typeof(Capability)). DataProofsDotnet 2.0.0 and NetCid 1.6.0 are the minimum AOT-clean dependencies (zcap calls only NetCid's JsonElement overload, moisesja/net-cid#65). An AOT publish with TrimmerSingleWarn=false lists IL2026/IL3050 pairs from Newtonsoft.Json (dotNetRdf.Core's dynamic support, never reached by RDFC; moisesja/dataproofs-dotnet#27) that can be ignored, and the ILCompiler the 10.0.100 SDK resolves reports advisory GHSA-p3jp-9v83-76w9 (NU1903): use a newer 10.0.x SDK or a NuGetAuditSuppress scoped to it. See examples/ZcapLd.AotSample (dotnet publish examples/ZcapLd.AotSample -c Release -r <rid>) and examples/ZcapLd.AotFileBasedApp/app.cs (dotnet run examples/ZcapLd.AotFileBasedApp/app.cs) in the repository.

See the repository for the full guide, policy options, examples and live JavaScript interoperability tests.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ZcapLd.Core:

Package Downloads
ZcapLd.AspNetCore

ASP.NET Core endpoint adapter for ZCAP-LD revocation workflows with pluggable revocation storage backends.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.1 113 11/10/2026
6.0.0 688 11/3/2026
5.0.0 264 10/25/2026
4.2.0 1,312 7/28/2026
4.1.0 4,156 7/14/2026
4.0.0 265 6/19/2026
3.0.0 161 6/6/2026
2.1.1 200 5/2/2026
2.1.0 138 5/2/2026
2.0.0 155 4/29/2026
1.2.0 380 3/27/2026
1.1.0 334 3/18/2026
1.0.0 149 3/9/2026
0.3.3 673 3/4/2026
0.3.2 232 3/1/2026
0.3.1 153 3/1/2026
0.3.0 157 2/28/2026
0.2.1 218 2/26/2026
0.2.0 155 2/26/2026
0.1.1 166 2/24/2026
Loading failed