Class EventChainAnchor
- Namespace
- Stratara.Abstractions.EventSourcing
- Assembly
- Stratara.Abstractions.dll
Periodic global checkpoint linking the per-stream hash chain into a tamper-evident
sequence across every stream of a tenant. Persisted in the event_chain_anchor
table; written by the event-stream-hash worker once enough new events have accrued.
public sealed class EventChainAnchor : IEntity, IMultiTenant, IBucket, IHasRowVersion
- Inheritance
-
EventChainAnchor
- Implements
- Inherited Members
- Extension Methods
Remarks
An anchor exists to be committed to a source of truth outside the application's
own infrastructure. A self-contained hash chain only proves the chain is internally
consistent — an insider with full database access can recompute every hash after
tampering. Publishing an anchor to an external chain, notary, or timestamp authority and
recording the reference on BlockchainTxHash closes that gap: the externally
committed hash cannot be rewritten even by an attacker who controls the database.
Stratara records the anchor; choosing and wiring the external service is the consumer's
integration point.
Properties
AnchorHash
The anchor hash — the head of the hash chain at SequenceNumber.
public byte[] AnchorHash { get; set; }
Property Value
- byte[]
BlockchainTxHash
Optional reference returned by the external source of truth (e.g. a blockchain transaction hash, notary receipt, or timestamp-authority proof) once this anchor's AnchorHash has been committed outside the application's infrastructure. null until external anchoring is wired up.
public string? BlockchainTxHash { get; set; }
Property Value
BucketId
The bucket index in [0, BucketCount).
public required int BucketId { get; set; }
Property Value
Id
The entity's primary-key identifier.
public Guid Id { get; set; }
Property Value
RowVersion
Current row version as read from xmin. Set by EF Core on save.
public uint RowVersion { get; set; }
Property Value
SequenceNumber
Sequence number this anchor covers up to (inclusive).
public long SequenceNumber { get; set; }
Property Value
TenantId
The Subject (data-owner) tenant id.
public required Guid TenantId { get; set; }
Property Value
Timestamp
When the anchor was written.
public DateTimeOffset Timestamp { get; set; }