betaFeedback

WorksComputer Science

Unshardable Codes

Abstract

We propose a new coding-theoretic problem motivated by censorship resistance. Is it possible to intertwine many pieces of data by encoding them jointly in a way that makes it impossible to remove any single piece without destroying many others as well? In particular, we want to encode kk data components (m1,…,mk)(m_1,\ldots, m_k) into a codeword (c1,…,cn)(c_1,\ldots,c_n) with the following properties: 1. Local recovery: every data component can be recovered (in the absence of erasures or errors) by reading at most ℓ\ell correct codeword symbols. 2. Unshardability: if an adversary erases some arbitrary subset of the codeword symbols, the remaining codeword symbols either uniquely determine all kk data components, or there are at least ss data components that cannot be determined. We call such codes (ℓ,s)(\ell, s)-unshardable. Intuitively, such codes prevent an adversary from selectively censoring individual pieces of data by erasing codeword symbols, without destroying large amounts of other data as collateral damage. We show that codes whose generator matrix has certain superregularity properties are unshardable. Using this connection, we construct linear codes that are (ℓ,s)(\ell, s)-unshardable with s=(1−ε)ks = (1-\varepsilon)k and locality ℓ=Oε(1)\ell = O_\varepsilon(1). We also show that linear unshardable codes are subject to the lower bound s≤k−k/ℓ+1s \leq k - k/\ell + 1. Finally, we consider a strengthening of local recovery to also require local decodability from some constant fraction of erasures or even errors. With the help of AI tools, we achieve the above notion by showing that any Locally Decodable Code (LDC) can be converted into one that is unshardable while preserving locality via a certain careful change of basis over an appropriate extension field.

Introduction

We introduce a new coding-theoretic property which we call unshardability. This property seeks to address the following central question: Can we intertwine many pieces of data by jointly encoding them such that it is impossible to delete any single piece without also deleting many others? This problem is intuitively motivated by censorship resistance: an adversary playing the role of a public data store holds the encoded data and should not be able to selectively censor any individual piece of data without causing significant collateral damage deleting much more.

To formalize this goal we first need a more precise notion of what it means for a piece of data to be deleted. Let C:Σk→ΣnC : \Sigma^k \to\Sigma^n be any encoding map. We say a subset T⊆[n]T \subseteq[n] determines i∈[k]i \in[k] (with respect to CC) if every pair of messages m,m′\mathbf{m},\mathbf{m}' that disagree at the iith coordinate also disagree on their codewords restricted to TT: C(m)∣T≠C(m′)∣TC(\mathbf{m})|_T \ne C(\mathbf{m}')|_T. We think of a component mim_i of the message as having been deleted if ii is not determined by the set of remaining codeword symbols after some erasures. We are now ready to present our main definition.

Definition 1.1 (Unshardable Codes). Let C:Σk→ΣnC : \Sigma^k \to\Sigma^n. We say CC is (ℓ,s)(\ell,s)-unshardable if it satisfies the following two properties:

  1. Local decoding under no errors: For every i∈[k]i \in[k] there is a subset D⊆[n]D \subseteq[n] of size at most ℓ\ell that determines ii.

  1. Unshardability: Take any arbitrary pattern of codeword symbol erasures and let T⊆[n]T \subseteq[n] denote the set of non-erased symbols. If there is some index i∈[k]i \in[k] that is not determined by TT, then the same is true of at least ss such indices. Equivalently, TT either determines all of [k][k], or fails to determine all jj in a set S⊆[k]S \subseteq[k] of size at least ss.

We propose this as a natural coding-theoretic property that has a distinct flavor relative to other notions considered in the literature. For instance, whereas error correction seeks to upper bound the impact of a “small enough” number of errors, unshardability lower bounds the damage of a “large enough” number of erasures. Local decoding says that each data location can be recovered efficiently by only reading a few codeword locations, while unshardability requires the data to be intertwined. Therefore, the two properties are seemingly contradictory and it is a priori unclear whether they can be satisfied simultaneously with good parameters e.g., ℓ=o(k)\ell= o(k) and s=Ω(k)s = \Omega(k).1{}^{1}

Unshardability with Erasures vs. Errors. The unshardability property, as we’ve defined it, gives a guarantee on the behavior of destroying data in the presence of an arbitrary unbounded set of erasures. It is natural to ask what happens if consider an arbitrary set of errors. However this is too strong to be achievable. For instance, for any target i∈[k]i \in[k], an adversary could simply overwrite the codeword with the values (mj)j≠i(m_j)_{j \ne i} (and erase/zero out any remaining symbols). Clearly under these errors, the modified codeword determines all components of m\mathbf{m} except the iith. Therefore, we naturally restrict our definition to erasures. Furthermore, referring back to the motivating example of censorship resistance, one also could potentially justify the erasure model using cryptographic authentication techniques (e.g., based on Merkle hashing) to enforce that the adversary can only erase and not introduce new errors.2{}^{2}

Local Decoding with Bounded Errors. It is also natural to ask whether the errorless local decoding property can be strengthened to support local decoding in the presence of a bounded fraction of errors. Here the answer is yes, and we also consider that definition in this work. Concretely we say CC is a (δ,ℓ,s)(\delta,\ell,s)-unshardable code if it meets the above definition where we replace the first condition with the following: There exists a randomized local decoding algorithm Lw(i)\mathcal{L}^{w}(i) that reads at most ℓ\ell locations from w\mathbf{w} and outputs mim_i with probability at least 3/43/4 whenever w\mathbf{w} is at most δ\delta-far in relative Hamming distance from C(m)C(\mathbf{m}). Effectively such a code is a (δ,ℓ)(\delta,\ell)-locally decodable code with an additional unshardability property added on.

General vs. Linear Codes. Our notion of unshardability is well defined for general codes. However, unshardability in the case of nonlinear codes is quite subtle. For example, if CC is a nonlinear code and m\mathbf{m} is uniformly random, C(m)∣TC(\mathbf{m})|_T may information theoretically determine partial information about mim_i (such as its most significant bit) without (fully) determining it in the above sense. On the other hand, in the setting of linear codes, if TT determines mim_i in the sense defined above, then C(m)∣TC(\mathbf{m})|_T uniquely determines mim_i in the information-theoretic sense and otherwise contains no information about mim_i. This makes unshardability much more effective and intuitively appealing for linear codes. Coupled with the efficiency and simplicity of linear codes, in this work all our constructions will be restricted to linear codes.

Limitation of Unshardable Codes. We observe that any unshardable code cannot be systematic. Indeed if C(m)=(m,c′)C(\mathbf{m})=(\mathbf{m},c') then setting T=[k]∖{i}T=[k]\setminus\{i\} for any i∈[k]i\in[k] and erasing the rest of the symbols in the codeword clearly deletes ii, but TT still determines all other indices. This argument can be generalized in a straightforward manner to yield the following lower bound that demonstrates a trade-off between unshardability and locality that we will prove formally later in § 3.

Theorem 1.2 (Limits of unshardable codes). If a linear code C:Fk→FnC:\mathbb{F}^{k}\to\mathbb{F}^{n} is (ℓ,s)(\ell,s)-unshardable, then we must have

s≤k−k/ℓ+1.s \le k-k/\ell+1.

Simple Constructions of Unshardability without Local Decoding. Next we note that achieving unshardability without local decoding is easy. For an illustrative example, consider a Reed-Solomon code C:Fk→FnC:\mathbb{F}^{k}\to\mathbb{F}^{n} under the evaluation encoding map: interpret m\mathbf{m} as the evaluations of a degree k−1k-1 polynomial pmp_{\mathbf{m}} on some fixed set of distinct α1,…,αk∈F∖{0}\alpha_1,\ldots,\alpha_k\in\mathbb{F}\setminus\{0\}, then C(m)=(pm(β1),…,pm(βn))C(\mathbf{m})=(p_{\mathbf{m}}(\beta_1),\ldots,p_{\mathbf{m}}(\beta_n)) for another set of distinct β1,…,βn∈F∖{0}\beta_1,\ldots,\beta_n\in\mathbb{F}\setminus\{0\} disjoint from the αi\alpha_i’s.10 For any T⊆[n]T\subseteq[n], the data of C(m)∣TC(\mathbf{m})|_T is a set of ∣T∣|T| evaluations of a polynomial of degree k−1k-1. If ∣T∣≥k|T|\ge k then TT determines all i∈[k]i\in[k] by interpolation, but if ∣T∣<k|T|<k then TT doesn’t determine any ii because k−1k-1 evaluations of a degree k−1k-1 polynomial cannot determine its value at any other different kkth point. Thus this Reed-Solomon code has unshardability s=ks=k. This argument works even if k=nk=n which demonstrates that the unshardability of a code is independent of its distance. The fact that Reed-Solomon codes have high unshardability is related to the fact that they are maximum distance separable (MDS).11

Challenges. Here, we try to point to some of the difficulties in constructing unshardable codes (with local decoding), and show why certain natural extensions do not work, before moving on to our final constructions. First, we note that we can modify the trivial construction from the above paragraph to get some simple tradeoff between unshardability and locality, though with poor parameters. Simply “batch” the message into k\sqrt{k}-size chunks and apply a Reed-Solomon code block-wise. To decode ii, one must only look at the codeword for its batch, and to delete ii one must delete the whole batch, hence this is a (k,k)(\sqrt{k},\sqrt{k})-unshardable code. This trivial argument works for any parameters not just k\sqrt{k}, but never gives unshardability ss better than locality ℓ\ell. Thus, in our actual results below, we will aim at achieving (o(k),Ω(k))(o(k),\Omega(k))-unshardable codes. In fact, our main constructions will achieve optimal or almost optimal trade-offs, nearly matching the limits set by Theorem 1.2.

Another natural attempt may be to try and extend the Reed-Solomon construction by taking more variables (denoted m>1m > 1), i.e., a tensor-product of Reed-Solomon codes. For such a design to work, one has to come up with a suitable choice of the message evaluation points (denoted I⊆FqmI \subseteq\mathbb{F}_q^m)12 and the codeword evaluation points (denoted E⊆FqmE \subseteq\mathbb{F}_q^m). While such codes can be shown to have local decodability (e.g. O(d)=O(k)O(d)=O(\sqrt{k}) queries when m=2m=2), in fact, even in the presence of a constant fraction of errors, obtaining interesting bounds on unshardability remains unclear (for any choice of II and EE). In fact, we establish a negative result for some natural evaluation sets (in particular, when I=S2I=S^2, where S⊆FqS \subseteq\mathbb{F}_q is a subfield and E⊇S‾2E \supseteq\overline{S}^2). We defer the details to Appendix § 9.

Our Results

As our main technical contribution we give a generic transformation from any linear code to one with almost optimal unshardability. The transformation preserves the rate and distance of the underlying code but does require a larger (but still constant) field size. Instantiating our transformation with an asymptotically good code yields the following theorem.

Theorem 1.3 (Explicit unshardable codes). For every R<1R < 1 and ε>0\varepsilon> 0, there exists q≤2OR(1/ε)q \leq2^{O_R(1/\varepsilon)} and an explicit infinite family of linear codes G:Fqk→FqnG:\mathbb{F}_q^k \to\mathbb{F}_q^n of rate at least RR that are (OR(1/ε),(1−ε)k)(O_R(1/\varepsilon),(1-\varepsilon)k)-unshardable.

We complement the above results with another set of incomparable results as we discuss in the below remark:

Remark 1.4. We note that we can also obtain an optimal trade-off between locality and unshardability (i.e., match Theorem 1.2 exactly without the O(⋅)O(\cdot) factor) using simpler direct constructions that work over large fields (see Theorem 6.4). Along the same lines we get unshardable codes with minimal locality 22: we prove the existence of a (2,⌈(k+1)/2⌉)(2,\lceil(k+1)/2\rceil)-unshardable code and give an explicit construction of a (2,⌈k/3⌉)(2,\lceil k/3\rceil)-unshardable code. Furthermore, over sufficiently large fields, we can also

achieve Maximum-Distance-Separability (MDS) in addition to unshardability (see Theorem 6.7). We refer to § 6 for these results.

Next we shift our focus to the setting of (δ,ℓ,s)(\delta,\ell,s)-unshardable codes that have local decoding in the presence of errors. First we show that if we instantiate our generic transformation with a locally correctable code (LCC) we can achieve local decoding in the presence of errors, at the cost of increasing the locality parameter, degrading the tradeoff between locality and unshardability. Plugging in the state of the art LCCs due to Kopparty, Meir, Ron-Zewi, and Saraf [KMRS17] to our transformation yields the following theorem.

Theorem 1.5 (High-rate unshardable LDCs). For every R<1R < 1 and ε>0\varepsilon> 0, there exist δ=δ(R)>0\delta= \delta(R) > 0, q≤2OR(1/ε)q \leq2^{O_R(1/\varepsilon)}, and an explicit infinite family of linear codes G:Fqk→FqnG : \mathbb{F}_q^k \to\mathbb{F}_q^n of rate at least RR that are (δ,ℓ,(1−ε)k)(\delta,\ell,(1-\varepsilon)k)-unshardable, where ℓ=OR(exp⁡(log⁡nlog⁡log⁡n)⋅ε−2⋅log⁡(1/ε))\ell= O_R(\exp(\sqrt{\log n \log\log n}) \cdot\varepsilon^{-2} \cdot\log(1/\varepsilon)).

In particular, the query complexity is subpolynomial in the blocklength of the code nn. As with Theorem 1.3, we prove a more general transformation of any LCC into an unshardable one (see Theorem 5.1) – in particular, on the other end of the spectrum, we can also achieve relative distance approaching 1/21/2 (and error parameter δ→1/4\delta\to1/4) with constant rate.

Remark 1.6. We note that our construction above also guarantees that the final code is also locally correctable with the same query complexity and error parameter, in addition to being locally decodable. We can further make the code family approach the Singleton bound (i.e., any rate R∈(0,1)R \in(0,1) and relative distance 1−R−o(1)1-R-o(1)) by using Theorem 1.3 of [KMRS17] instead, although this increases the required alphabet size. Furthermore, we can obtain a better query complexity of (log⁡n)O(1)(\log n)^{O(1)} if we allow the local decoder to return “I don’t know” (while requiring completeness when there are no errors), by using the recent progress on Relaxed LDCs [KM24; CY24].

Finally, we show that we can slightly modify our generic transformation into a similar transformation that converts a given LDC directly into an unshardable LDC. We instantiate this with the constant-query LDCs of Efremenko [7] yielding the following theorem.

Theorem 1.7 (Constant-query unshardable LDCs). For every r∈Nr \in\mathbb{N} and ε>0\varepsilon> 0, there exist δ=δ(r)>0\delta= \delta(r) > 0, q≤2O(1/ε)q \leq2^{O(1/\varepsilon)}, and an explicit infinite family of linear codes G:Fqk→FqnG : \mathbb{F}_q^k \to\mathbb{F}_q^n that are (δ,ℓ,(1−ε)k)(\delta,\ell,(1-\varepsilon)k)-unshardable, where ℓ=O(2r⋅ε−2⋅log⁡(1/ε))\ell= O(2^r \cdot\varepsilon^{-2} \cdot\log(1/\varepsilon)) and n=exp⁡(exp⁡(log⁡klog⁡log⁡r−1kr))n = \exp(\exp(\sqrt[r]{\log k \log\log^{r-1} k})).

In particular, we obtain subexponential length codes with near-maximal unshardability and constant-query local decoding.

Local-Local Unshardability

In a separate direction, we also briefly consider an incomparable variant of unshardability and prove a strong lower bound for that variant. Our main definition (Definition 1.1) considers a global notion of deletion: if ii is not determined by reading all of c∣Tc|_T then so are many other indices. We can also consider a “local-local” notion of unshardability: if ii is not determined by reading any small number of locations in c∣Tc|_T then the same is true of many other indices. This local-local unshardability is incomparable to (standard) unshardability because both the premise and conclusion are weaker. Nonetheless we prove a strong lower bound that any (ℓ,s)(\ell,s)-local-local unshardable code must have s≤ℓs \leq\ell, effectively ruling out any non-trivial constructions. See § 7 for details.

Technical Overview

The key steps involved in arriving at our constructions of unshardable codes are sketched below:

  • Idea 1: A useful criterion for unshardability. Let us start with the goal of constructing the generating matrix G∈Fqk×nG \in\mathbb{F}_q^{k \times n} of a linear code with some non-trivial unshardability s≥2s \ge2. A preliminary observation highlighted in the above subsection is that GG cannot contain the k×kk \times k identity matrix (denoted IkI_k) as a submatrix. On the contrary, if GG does contain IkI_k as a submatrix, there exists a subset of columns T⊆[n]T \subseteq[n] of size k−1k-1 such that the corresponding submatrix GTG_T has a vector of Hamming weight 1 in its (left) kernel. This suggests that we want to have vectors of large Hamming weight in the kernel of the submatrix GTG_T (whenever it is non-empty). Indeed if we have mTGT=0T\mathbf{m}^{\mathsf{T}}G_T = \mathbf{0}^{\mathsf{T}} for some message m∈Fqk\mathbf{m} \in\mathbb{F}_q^k, then it is easy to see that every coordinate i∈[k]i \in[k] such that mi≠0m_i \ne0 is not determined by TT. This is exactly the condition we will exhibit in our constructions to show that a given code has high unshardability (see Proposition 3.1).

References

  1. [3]Eric David Belsley. Rates of convergence of Markov chains related to association schemes. Harvard University, 1993 (cit. on p. 28).
  2. [6]Richard A. DeMillo and Richard J. Lipton. “A probabilistic remark on algebraic program testing”. In: Information Processing Letters 7.4 (1978), pp. 193–195. DOI: 10.1016/0020-0190(78)90067-4 (cit. on p. 10).DOI
  3. [7]Klim Efremenko. “3-query locally decodable codes of subexponential length”. In: Proceedings of the forty-first annual ACM symposium on Theory of computing. 2009, pp. 39–44 (cit. on pp. 5, 9, 20).DOI

Paper details

vlnc:W_cbvwn9av
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 7

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

AI tools

View statement
Looking for related papers…
Contents