diff --git a/src/FishyFlip/CborExtensions.cs b/src/FishyFlip/CborExtensions.cs index 70dec61..8f143ec 100644 --- a/src/FishyFlip/CborExtensions.cs +++ b/src/FishyFlip/CborExtensions.cs @@ -180,7 +180,13 @@ internal static class CborExtensions { case CBORType.ByteString: var cid = obj.GetByteString(); - return Cid.Read(cid); + if (cid[0] != 0) + { + logger?.LogError("ATCid CBOR bytes should start with 0."); + return null; + } + + return Cid.Read(cid.AsSpan(1).ToArray()); case CBORType.TextString: return Cid.Decode(obj.AsString()); }