Encrypted inference has a basic timing conflict. Homomorphic encryption lets an untrusted server run a neural network on data it cannot read. It is affordable only when one ciphertext carries hundreds or thousands of inputs at once, because a single encrypted pass takes seconds to minutes no matter how full it is. A pipelined permissioned blockchain, which orders and logs requests among parties that do not trust each other, is fast only when it groups about a thousand transactions per batch. Both layers therefore get throughput by making requests wait. A request with a deadline, such as an alert that must be classified before an attack spreads, can expire in either queue.
This note proposes treating the two waits as a single scheduling decision. A controller watches how much time each queued request has left before its deadline. From that it decides three things together: when to seal the current ciphertext, how many inputs it should hold, and which of several precompiled encrypted models to use (deeper and more accurate, or shallower and faster). It also decides when the ledger closes its batch. The claim is that this online joint choice meets deadlines far more often than any fixed configuration, even one tuned offline for the observed load, at equal accuracy. We also claim the gain persists when encrypted inference runs off the ledger and only a hash of the result is committed.
Where the directions meet
Each line of work optimizes its own layer and ignores the others. Work on permissioned blockchains found that the bottleneck is the execution machinery around consensus, not the consensus protocol itself. That machinery covers network ingestion, signature checking, batching, and storage. ResilientDB splits these into pipelined thread stages and reports 175,000 transactions per second (Resilient and Scalable Architecture for Permissioned Blockchain Fabrics). The same group credits batches of about 1,000 transactions with a 66× throughput gain (Permissioned Blockchain Through the Looking Glass). We reuse this pipeline design.
Encrypted-inference systems lean on the same kind of amortization. They use SIMD packing, which puts many inputs into the parallel "slots" of one ciphertext. CryptoNets sustains about 59,000 MNIST predictions per hour, but each batch takes 250 seconds (CryptoNets). HTCNN interleaves images to fill nearly every slot on an edge CPU and needs 10.4 seconds for 163 MNIST images and 678 seconds for 227 CIFAR-10 images (HTCNN). These papers motivate the proposal: their own numbers show that latency per request is set by how long a request waits for the batch to fill.
Work on edge latency supplies the control method. Dynamic Compression Ratio Selection for Edge Inference Systems with Hard Deadlines uses a Markov decision process, a model of sequential decisions under uncertainty, that tracks the time left before each queued task expires and chooses how hard to compress the task at the head of the queue. On plaintext MNIST it reaches a 97.5% task success rate. That controller acts on plaintext data, and the system it controls has a single queue. Our controller acts on encryption-side decisions, namely how full to pack a ciphertext and how deep a model to run, across two coupled queues.
The closest prior system is PPDiL (Privacy-Preserving Cyberattack Detection in Blockchain-Based IoT Systems Using AI and Homomorphic Encryption). It runs encrypted attack detection with CKKS, an encryption scheme for approximate real-number arithmetic, beside a blockchain. It treats the ledger as a black box (proof of work, authority, or stake) and fixes the packing and model in advance. It reaches 2.4 encrypted samples per second and takes 2.5 minutes per 400-sample frame. PPDiL never asks how batching on one layer should depend on deadlines and on batching in the other layer, and that is the question here. BlockOptR does tune across layers, but it is an offline advisor whose recommendations an administrator applies by hand (How To Optimize My Blockchain?). It never touches cryptographic parameters.
We are honest about the deadline regime. Encrypted inference on these models takes seconds, so the millisecond deadlines of user interfaces and control loops are out of reach. We target deadlines from about 2 to 60 seconds. Security alerting on blockchain-network traffic is one such case, and audited classification of sensitive records is another.
Core Claim
Suppose request $i$ arrives at time $a_i$ with deadline $d_i$. It is placed in a ciphertext that is sealed after a fill wait $w$, carries $b$ inputs, and is evaluated by model variant $m$. Its result is then committed in a ledger batch that closes after a further wait $u$. The request is on time if
$$a_i + w + T_m(b) + u + C(B) \le d_i,$$
where $T_m(b)$ is the encrypted evaluation time of variant $m$ on a ciphertext holding $b$ inputs, and $C(B)$ is the ordering and commit time for a ledger batch of size $B$.
The structural fact that drives the design comes from SIMD packing. $T_m(b)$ is nearly flat in $b$ up to the slot capacity, because one encrypted operation acts on every slot at once. Fill time is therefore pure waiting that buys free amortization, and the best $b$ depends on the arrival rate and on how much slack is left. The variant ladder adds a second lever. A shallow model with lower multiplicative depth (fewer chained encrypted multiplications) allows smaller encryption parameters and a smaller $T_m$, at some cost in accuracy, as HEMET's depth analysis shows (HEMET).
We claim three things. First, a controller that picks $(w, b, m, u)$ jointly from current slack strictly dominates choosing them independently. Second, under bursty load it dominates the best static choice. Third, the dominance is largest exactly where either amortization layer is near capacity.
Research Program
The first piece is the system: a ResilientDB-style pipeline with an added stage for encrypted evaluation. Network threads take in encrypted client requests, already packed by the clients into the layout HTCNN uses. A packing stage holds partial ciphertexts for each model variant. Evaluation workers run CKKS inference on sealed ciphertexts while consensus threads order the previous batch, which carries encrypted results or their hashes. The ladder holds three to four variants per task. They are built with HEMET-style depth-aware choices and SAFENet-style partial replacement of ReLU by polynomials (SAFENet), and each one's $T_m(b)$ curve is profiled offline on the target CPU.
The second piece is the controller. We formulate scheduling as a Markov decision process over a state made of queue occupancy, per-request slack, and a recent estimate of the arrival rate, following Huang and Zhou's construction. We compare an exact solution on a coarse grid with a cheap rule: seal when the earliest-deadline request's slack falls below $T_m(b) + \hat u + C$, and choose the deepest variant that still fits. An optional escalation path mirrors Huang and Zhou's information augmentation. The data owner, who alone can decrypt, may resubmit a request whose decrypted output distribution has high entropy (that is, low confidence) for re-evaluation with a deeper variant. Escalation costs one extra round trip, and we measure whether that cost is worth paying.
The third piece is a placement study that settles a question the file raises but cannot answer: whether replicated encrypted execution is deterministic. CKKS evaluation is integer modular arithmetic, but common libraries encode plaintexts using floating-point transforms. Replicas on different processors could therefore produce different ciphertexts and fork the ledger. We will test bit-identity across Intel and AMD machines. If replicas diverge, the design switches to execute-once-and-commit-hash, with randomized re-execution by a second replica as an audit, and we report what that audit costs.
Baselines
The naive reference point is a PPDiL-style monolithic node. It packs a fixed full ciphertext, evaluates one fixed model, and then submits to an unpipelined ledger. It runs on the same hardware, models, and arrival traces as our system. PPDiL's own reported figure is 2.4 encrypted samples per second on its BN-1 server, with 2.5 minutes per 400-sample frame, and we expect to reproduce that order of magnitude.
The strongest existing competitor combines two published designs. HTCNN-style maximum-occupancy packing runs as the evaluation stage inside a ResilientDB-style pipeline. Its ciphertext fill size, ledger batch size, and model variant are chosen by grid search for each arrival-rate setting, an oracle version of BlockOptR's offline tuning. It gets the same tuning budget in wall-clock profiling hours as our controller's offline profiling. Its reference numbers are HTCNN's 15.6 images per second and 10.4 seconds for 163 MNIST images on an Intel Core i5-10400, so we run on that CPU class. The pipeline side is anchored by ResilientDB's 175,000 transactions per second on YCSB. We found no reported result on Lacuna for deadline-hit rate under any encrypted-inference system, so the comparison is new measurement rather than a number we can beat on paper. Beating this baseline means at least a 15-point absolute gain in deadline-hit rate under bursty load, with accuracy among on-time results within 1 point and throughput at least 90% of the baseline's. Under steady load we expect parity, and we will say so.
Three ablations isolate the key ingredient, which is joint, slack-driven choice. The first adapts packing only, with a fixed variant and fixed ledger batching. The second adapts the encryption side only and leaves the ledger batch at its best static size, which tests whether coupling to the ledger matters. The third swaps the slack signal for queue length alone, which tests whether deadline information matters.
Why not just…?
Why not just run encrypted inference off-chain and commit hashes, as in Li's edge architecture? Blockchain-Powered Secure Edge Computing Architecture runs computation off the ledger and logs hashed summaries. It reports about 100 ms of edge processing and 500 ms of validation per record, all on plaintext. This is a real threat to any claim about on-ledger execution, so we do not make one. Our placement study runs the controller under both placements. The claim that survives is about joint scheduling, not about where the computation runs. Even off-chain, the hash must wait for a ledger batch to close. If moving the computation off-chain removes nearly all the benefit of joint control, we will report that the coupling to the ledger is negligible.
Why not just tune static parameters offline per load level? This is exactly the strongest baseline above. Under stationary arrivals it should match our controller, since a well-tuned fixed point is optimal there. The experiment that settles the question replays bursty traces in which the arrival rate jumps by 5–10× within one ciphertext fill time. In that regime a static choice must either over-wait during lulls or over-pack during bursts.
Why not just use small, latency-mode ciphertexts with one input each? This eliminates fill waiting but throws away the slot amortization that makes encryption affordable. CryptoNets' and HTCNN's batch-versus-throughput figures imply that throughput would collapse under any nontrivial load. We include single-input packing as a point on the static grid. We expect it to win only at very low arrival rates, where the controller should converge to it on its own.
Why not just use a hardware enclave instead of encryption? Enclaves would remove most of the cryptographic cost. However, edge hardware sits in physically exposed locations, and VeriBench reports that CCF, an enclave-based ledger, scales poorly as nodes are added (VeriBench). We treat enclaves as answering a different threat model and do not compete with them on speed.
Proposed Experiments
The workloads are BNAT traffic classification, following PPDiL's 10,000-sample balanced setup, and MNIST and CIFAR-10 image classification, following HTCNN's models. Request arrivals are Poisson and bursty (Markov-modulated). Deadlines are drawn per request from 2 to 60 seconds. YCSB background transactions keep the ledger realistically loaded. Clusters range from 4 to 16 replicas.
The metrics are deadline-hit rate, accuracy among on-time results, effective throughput, slot occupancy, and ledger commit latency. We report all of them against offered load.
Three checks decide the outcome. The first asks whether joint control beats the oracle-tuned static baseline by the stated margin under bursty load while tying it under steady load. The second asks whether the ledger-coupling ablation loses a meaningful share of that gain, which shows whether the blockchain layer matters at all. The third asks whether replicated CKKS evaluation is bit-identical across processor vendors, which decides between the replicated and execute-once designs.
If the first check fails, the idea is wrong. If the second fails, the honest conclusion is that encryption-side packing control alone suffices and the ledger can be treated as a fixed delay.
References
- Resilient and Scalable Architecture for Permissioned Blockchain Fabrics
- Permissioned Blockchain Through the Looking Glass: Architectural and Implementation Lessons Learned
- CryptoNets: Applying Neural Networks to Encrypted Data with High Throughput and Accuracy
- HTCNN: High-Throughput Batch CNN Inference with Homomorphic Encryption for Edge Computing
- Dynamic Compression Ratio Selection for Edge Inference Systems With Hard Deadlines
- Privacy-Preserving Cyberattack Detection in Blockchain-Based IoT Systems Using AI and Homomorphic Encryption
- How To Optimize My Blockchain? A Multi-Level Recommendation Approach
- HEMET: A Homomorphic-Encryption-Friendly Privacy-Preserving Mobile Neural Network Architecture
- SAFENet: A Secure, Accurate and Fast Neural Network Inference
- Blockchain-Powered Secure Edge Computing Architecture: Enhancing Data Integrity and Privacy in Internet of Things (IoT) Networks
- VeriBench: Analyzing the Performance of Database Systems with Verifiability