Quickbeam Encryption flow

November 15, 2025 · View on GitHub

Note: This is not yet implemented!

Encrypt (Alice)

// input params $0 < t \leq |\mathcal{U}| m \in {0, 1}^ R \in {0, 1}^$ an NP-Relation

// generate ciphertext and add to storage (ek,ak)Preprocess(CRS,U,{hinti,pki}i[U])(ek, ak) \leftarrow Preprocess(CRS, \mathcal{U}, \{hint_i, pk_i\}_{i \in [\mathcal{U}]}) ctRSTE.Enc(ek,m,t)ct \xleftarrow{R} STE.Enc(ek, m, t) cid=Storage.Add(ct)cid = Storage.Add(ct)

// embedded intent mˉ={(R,t),cid}\bar{m} = \{(R, t), cid\} cidˉ=Storage.Add(mˉ)\bar{cid} = Storage.Add(\bar{m})

// register with intent storatge filename{0,1}dfilename \in \{0, 1\}^d $0/1 \leftarrow IntentStore.Register(filename, \bar{cid})$

Decrypt (Bob)

Assume Bob knows the filename of some encrypted data, filenamefilename.

// retrieve ciphertext loc, relation, and intent cidˉ=IntentStore.Get(filename)\bar{cid} = IntentStore.Get(filename) {(R,t),cid}=Storage.Get(cidˉ)\{(R, t), cid\} = Storage.Get(\bar{cid})

// this needs work... S=DeriveStatement(R)S = DeriveStatement(R) Generate a witness ww s.t. (w,s)R(w,s) \in R

// collect partial decs {pd1,...,pdk}\{pd_1, ..., pd_k\} for some ktk \geq t biPartVerify(pdi)i[k]b_i \leftarrow PartVerify(pd_i) \forall i \in [k] if any bi==0b_i == 0 then reject the share.

// fetch ct ct=Storage.Get(cid)ct = Storage.Get(cid) // TODO: we should probably just store this somewhere // it could even be embedded in the ciphertext itself // we should keep contract storage as small as possible (ek,ak)Preprocess(CRS,U,{hinti,pki}i[U])(ek, ak) \leftarrow Preprocess(CRS, \mathcal{U}, \{hint_i, pk_i\}_{i \in [\mathcal{U}]}) m=DecAggr(CRS,ak,ct,{pd1,...,pdk})m = DecAggr(CRS, ak, ct, \{pd_1, ..., pd_k\})