Paper summary

TrustDER: Trusted, Private and Scalable Coordination of Distributed Energy Resources

Ram Rajagopal, Philip Levis, Abbas El Gamal, Mayank Malik, Lily Buechler, Sonia Martin, Obi Nnorom, Evan Laufer, Thomas Navidi, Mark Chen, Oskar Triebe, Yancheng Ou, Anthony Deglaris, Chin-Woo Tan · Stanford University · SLAC National Accelerator Laboratory

DOE final technical report, Final Scientific/Technical Report for U.S. Department of Energy agreement DE-OE0000919 (Office of Electricity Delivery and Energy Reliability, via the National Energy Technology Laboratory) · project period July 2020 to June 2024 · submitted July 30, 2024, revised September 15, 2024

This page was written by an AI model to give a high-level overview of the paper. Please check the paper for detail: OSTI.

The big idea

Distributed energy resources (DERs) such as rooftop solar, batteries, electric vehicle (EV) chargers and flexible loads are spreading quickly. Coordinating them raises three problems. Each use case (peak shaving, arbitrage, microgrids) tends to get its own interface, so a battery bought for one purpose is hard to reuse. Sharing a resource exposes its users: a community battery's operator sees how each member uses their share. And uncoordinated DERs stress the grid: in the report's simulations of five networks at DER levels projected for 2050, even intelligent local control left every network needing significant upgrades.

TrustDER is a four-year Department of Energy (DOE) project by Stanford and SLAC that answers these with a layered platform; each layer can run on its own and feeds information to the layers above it. The foundation borrows an idea from operating systems: virtualization. A Battery Operating System (BOS) exposes every battery through one small interface, the Battery Abstraction Layer (BAL), and lets software build virtual batteries that aggregate several batteries into one or partition one battery into several, the way an OS combines disks with RAID or splits a disk into volumes.

The other layers build on that abstraction. Secure ID (SLAC) is a blockchain-based identity system in which shards of a device's key, held by other nodes, let the network verify the device without a central credential store. Weft lets clients control their partitions of a shared battery privately: each client secret-shares a day-long schedule of power values between two non-colluding servers and attaches zero-knowledge proofs that the schedule respects its power and energy limits, so the operator learns only the total. A two-layer cooperation scheme keeps DERs from harming the grid: a day-ahead global controller assigns each customer power bounds that respect voltage and transformer limits, and each customer's local controller optimizes its own costs inside those bounds.

The report states results against the project's metric goals. In simulation, the cooperation scheme cut hours of voltage violation by 50 to 71% and the number of overloaded transformers by 7.4 to 40% across the five networks, at a 2.6 to 4.0% increase in electricity costs, giving more than a 10% benefit in avoided transformer upgrades for most networks. Ramp and regulation signals were tracked with 2.6% and 6.1% average error in simulation and 8.99% and 9.27% in a hardware-in-the-loop test (goal: under 10%). Weft proves a one-day, 1-minute schedule in 0.027 s (bit-splitting proofs) on a desktop, and runs on a 64 MHz Cortex-M4 microcontroller in 66 s. The BAL was deployed on residential and lab batteries and released as open source.

Virtual batteries, composed
the report's example topology · every box answers the same BAL calls
virtual battery physical battery Homeowner 1 Homeowner 2 O2' = O2 + C 20.8 kWh · 12.1 kW O1 · 60% of H 13.2 kWh · 7.7 kW O2 · 40% of H 8.8 kWh · 5.1 kW C home battery (ecoLinx 12) H = A1 + A2 22 kWh · 12.8 kW A1 eco 10 A2 ecoLinx 12 aggregate: rented share plus own battery partitions of H (proportional, 60 / 40) aggregate of the association's batteries physical batteries, driven through a BMS Every box exposes the same BAL API: GetStatus() and SetCharge() / SetDischarge()
Redrawn from the report's Figure I.2.1 (values are the figure's): a homeowners' association aggregates A1 and A2 into H and rents partitions O1 and O2; homeowner 2 combines O2 with their own battery C. On the testbed, requests to O2' were split between O2 and C, and requests from O1 and O2 were merged at H.

Key takeaways

  • TrustDER is a layered platform for coordinating DERs: battery virtualization at the base, with device identity, private control and grid-safe cooperation built alongside and on top.
  • Battery virtualization: one small API (BAL) for every battery, and virtual batteries that aggregate or partition others, with explicit rules for reporting limits, unbalanced charge and simultaneous charge/discharge requests.
  • Weft keeps each partition's usage private from the battery operator using secret shares and zero-knowledge proofs over power schedules; the client side runs on a 256 kB microcontroller.
  • Secure ID verifies grid devices by recombining shards of a device key held by other nodes; 300 test verifications were all correct.
  • Day-ahead power bounds cut simulated voltage-violation hours by 50 to 71% and overloaded transformers by 7.4 to 40% for a 2.6 to 4.0% cost increase; signal tracking met the under-10% error goal in simulation and hardware-in-the-loop tests.
Mechanism, step by step

From one battery API to private, verified, grid-safe coordination

Battery virtualization, device identity, private control with Weft, the day-ahead cooperation scheme, and what each evaluation shows.

1 · The project and its pieces

The project ran from July 2020 to June 2024 and is organized as tasks, each designing one layer (Task 1 was project management).

TaskWhat it builtMain outcome reported
2 · Resource virtualizationBattery Abstraction Layer (BAL) and Battery Operating System (BOS)Open source; deployed on residential and lab batteries
3 · Secure ID (SLAC)Blockchain-based device identity300 verifications, no false positives or negatives
4 · Trust and mapping IoT (LLNL)Not pursuedFunds moved to Tasks 2.6 and 6.4
5 · Private and safe integrationGrid simulation suite, day-ahead bounds, signal tracking, hardware-in-the-loop testsStated metric goals met
6 · Scalable distributed privacyWeft: private, verified control of a partitioned batteryClient runs on a 256 kB microcontroller
7 · Use casesUse-case survey, industry advisory boardResiliency and cost minimization ranked most important

2 · Logical batteries and the BAL API

Instead of a separate interface per use case (peak reduction, arbitrage, microgrids), the BAL gives every energy resource one general interface, so storage bought for one purpose can serve another. The model is an OS, which gives applications one abstraction of hardware while vendors write drivers for it.

  1. Logical batteries. A physical battery is real storage controlled through its battery management system (BMS). A virtual battery is software: an aggregate of several logical batteries or a partition of one. A networked battery controls a BAL device on another BOS node, so topologies can span machines.
  2. Two calls. GetStatus() returns one snapshot of voltage, current, maximum current, state of charge, maximum charge and a timestamp interval. SetCharge() / SetDischarge() set the current into or out of the battery.
  3. Atomic snapshots. If voltage were sampled before a spike in draw and current after it, their product would overstate power, so related values come from one snapshot. The timestamp is an interval because an aggregate's members may report at different times.
  4. Topologies. make_battery, make_aggregator and make_splitter build a tree of batteries over local or remote interfaces (UART, BLE, TCP).

3 · Aggregating batteries

Summing members' limits is wrong: for A (60 A, 110 Ah) and B (40 A, 40 Ah), the sum claims 100 A, but at 100 A battery B empties after one hour. The BAL instead uses the C-rate (maximum current divided by capacity):

BatteryMax dischargeCapacityC-rateReported as
A60 A110 Ah0.56contributes 60 A
B40 A40 Ah1limited to 21 A so it empties when A does
C = A + B81 A150 Ah0.56can sustain 81 A for 110 minutes
  1. Limits. The aggregate's C-rate is the minimum of its members' C-rates and its capacity is the sum. A scalar was chosen over discharge curves because existing standards do not easily support such data models.
  2. Splitting commands. SetDischarge(50) on C sends 50 × 60/81 A to A and 50 × 21/81 A to B.
  3. Unbalanced charge. When members' states of charge differ, the BAL uses variable current: the reported current changes as charge evens out (with A at 9%, C reports 50 A and 33%). The report rejects taking the aggregate offline (failures cascade) and varying the reported charge (larger swings), and reports both expected and current values.
  4. Location. The BAL reports the center of the members' connection points, computed with the Floyd-Warshall algorithm and flagged as a center position.

4 · Partitioning a battery

Partitions are fractions of the underlying battery's expected values. Actual values drift, so a policy decides who absorbs a deficit or surplus. The report's example splits battery A 50/30/20 into P1 (top), P2 and P3 (bottom):

PolicyRuleActual charge 90 (expected 100)Actual charge 110
ProportionalEvery partition scales by the same fraction45 / 27 / 1855 / 33 / 22
TranchedSurpluses go to the top partition first; deficits come from the bottom first50 / 30 / 1060 / 30 / 20
ReservedSurpluses and deficits both hit the bottom partition first, so higher partitions are most dependable50 / 30 / 1050 / 30 / 30

Adjustments are capped at each partition's limits, with excess spilling to the next.

Simultaneous charge and discharge. Partition requests are summed and only the net reaches the battery. In the report's example, P1 (80 Ah, full) discharges at 40 A while P2 (120 Ah, 16%) charges, so battery A charges at only 10 A. P1's energy flows to P2 in the BAL's accounting: after 2 hours P1 is empty and P2 is full, with 80 Ah from P1 and 20 Ah from outside.

5 · Implementation, testbed and use cases

BatteryOS has a Python prototype and a fuller C implementation with the project's cybersecurity mechanisms and IEC 61850 interoperability. A driver for a JBD BMS reads its status register and switches its charge and discharge MOSFETs (it has no current regulator yet). From an industry advisory board (VMware, Hitachi, AutoGrid, Siemens, Nevermore Security) and meetings with the US Navy and PG&E, resiliency emerged as the key need; for VMware's islanded microgrid the team partitioned the battery by load type, ordered by priority.

6 · Secure ID: device identity without a central registry

A traditional identity management system (IDMS) stores everyone's credentials, giving one organization disproportionate control and attackers a single target. Most blockchain identity systems the SLAC team surveyed had no implementation or assumed existing trusted credentials, which conflicts with self-sovereign identity (only the device owns its identity). Keymaker creates an identity and distributes shards of it; Keychecker lets neighboring nodes recombine shards to verify the device. Keymaker's steps:

  1. Generate a random key and split it into n + 1 shards with Shamir secret sharing (any k reconstruct it; fewer reveal nothing).
  2. Encrypt the device's identity key with the random key (NaCl secretbox) and append the ciphertext to each shard.
  3. Send n shards to other nodes and keep one on the device.

Operations such as registration and verification run only with the device's consent, through an API that invokes smart contracts. The lab test used a five-node Hyperledger Fabric network on AWS EC2 instances and a Raspberry Pi 4 standing in for a Sonnen battery at SLAC. Each key was split into 4 shards and each verification collected 3. In 300 Keychecker runs every identity was verified correctly, with 2.67 s average execution time and 5.48 s latency. No scaling stress tests were run.

7 · Weft: private control of a shared battery

Many clients own partitions of one battery that an operator controls. Each has a minimum rate n (possibly negative), a maximum rate m and an energy limit e. The goals are client privacy (the operator learns only the sum of requests), server integrity (invalid requests are rejected) and efficiency (some clients are embedded devices).

How a Weft request flows
secret-share a schedule · verify proofs on shares · reveal only the sum
Client 1 schedule S1, e.g. 1,440 values Client 2 schedule S2 Client 3 schedule S3 Server A resource operator sees only random-looking shares Server B third party (e.g. ISRG) assumed not to collude with A each client sends one share plus proofs to each server jointly verify proofs on shares add shares, recombine reveals only S1 + S2 + S3, element by element shared battery follows the summed schedule Each proof shows, without revealing S: rate n ≤ S[i] ≤ m for every interval i, and integral 0 ≤ S[0] + … + S[j] ≤ e for every prefix j. invalid proof: reject S
Drawn from the report's Task 6 Technical Approach; the report has no figure of this flow. The three clients and the 1,440-value schedule are illustrative.
  1. Security model. As in Prio, the operator and a third party each run a server and do not collude. Servers are trusted not to modify requests but not with privacy; clients are trusted with neither.
  2. Schedules, not commands. Clients send, before each epoch, one value per interval (1,440 one-minute values for a day), so changes in power are decoupled from message timing.
  3. Proofs. Zero-knowledge range proofs over the shared values and their running sums come in three forms, each minimizing one resource: bit-splitting (memory), sorting (compute) and commitment proofs (communication).
10,000-value schedule (desktop client)Bit-splittingSortingCommitment
Client peak RAM191 kB2.4 MB524 MB
Client proving time0.36 s0.09 s73.59 s
Server verification0.085 s0.065 s9.99 s
Client communication1.13 MB0.66 MB41.5 KB

For one day at 1-minute intervals (1,440 values), a desktop (Intel Core i9) client proves in 0.027 s (bit-splitting) or 0.011 s (sorting), the server verifies in 0.004 s, and the three proofs send 183 kB, 159 kB and 7.1 kB. On an nRF52840 microcontroller running Tock, an application's 96 kB fits bit-splitting proofs of up to 4,000 values: 1,440 take 66 s and 4,000 take 4.5 minutes. The report judges this daily traffic too expensive for LoRaWAN but feasible over NB-IoT, LTE-M, WiFi or Thread.

8 · Grid-safe cooperation with day-ahead bounds

A simulation suite of five distribution networks (19 to 426 nodes) runs OpenDSS with load, PV and EV charging data at 2050 penetration levels (50% EVs, 33 to 64% PV, 14 to 27% storage). Two metrics stand in for upgrade cost: hours with voltage deviating more than 5%, and transformers overloaded for more than 2 hours. The scheme uses linear power-flow models learned from measurements.

  1. Demand bounds. Each day, each customer's local controller (LC) estimates its maximum consumption and generation for each period of the next day.
  2. Supply bounds. A global controller (GC) turns these into per-node power bounds that keep voltages and transformer loads within limits. Only bounds are exchanged; the GC needs no DER details or objectives.
  3. Operating phase. Every 15 minutes each LC solves a model predictive control (MPC) problem minimizing its energy cost and battery wear plus a penalty for leaving its bounds.
Grid impact with and without day-ahead bounds
five simulated networks, 2050 DER levels, peak-load month · redrawn from Table III.5.3
autonomous local controllers with day-ahead bounds Hours of voltage violation Overloaded transformers cost increase with bounds IEEE 123IowaDowntown SFShore SFTracy 5.58151.756192732515 1.75450.53152526312 +2.6%+3.1%+4.0%+3.9%+3.2% 051015 h 0102030 Voltage-violation hours fall 50% (Iowa, Tracy) to 71% (Shore SF); overloaded transformers fall 7.4% (Iowa) to 40% (Shore SF).
Values and percentage reductions from the report's Table III.5.3 and Task 5.1 text.

Counting only avoided transformer upgrades, the report finds more than a 10% benefit over no cooperation for most networks, meeting the task goal.

9 · Grid services, black start and hardware-in-the-loop

Subtask 5.2 extended the scheme to ramp and regulation signals and to black start. In simulation, signal following that coincides with extreme grid events causes major reliability problems, while bounding signal following and DER operation prevents the worst cases.

Metric (Sacramento network, bounds scenario)GoalSimulationHardware-in-the-loop
Consumer cost reduction vs no coordination>10%11% per consumer11% per consumer
Ramp tracking error<10%2.644%8.99%
Regulation tracking error<10%6.132%9.27%
Uptime during a blackout>4 hoursmet 31.4% of the timenot tested
Battery lifetime increase>10%met by skipping some signalsnot tested
  1. Consumer savings. At PJM ancillary-service prices, signal following adds about 14% savings for consumers with storage and an EV charger; following the bounds costs about 3% in missed arbitrage, leaving 11%.
  2. Battery lifetime. Regulation following raises cycling from 1.78 to 6.58 cycles a day, cutting lifetime from 10.774 to 2.92 years; skipping the lowest-profit 12.85% of signals gives 10% longer life for under 1% loss in total savings.
  3. Hardware-in-the-loop (HIL). One simulated home was replaced by real devices (space heater, lights, refrigerator, battery inverter) driven by a Raspberry Pi over smart switches, alongside 13,000 simulated devices. On/off devices follow a signal as a series of on and off commands.

10 · Limitations and open questions the report states

  1. Virtual flows need billing rules. Charge moved between partitions implies payment between owners; how to bill it, and how to stop a free virtual transfer from meeting a market commitment, is future work.
  2. Location is only summarized. How to report bounds and tolerances at an aggregate's connection point was still being evaluated.
  3. Privacy has a floor. If the battery discharges at its maximum rate, every partition must be; the report calls this leakage unavoidable.
  4. Conditions on results. Weft assumes non-colluding servers; Secure ID had no stress tests; the bounds protect the grid only if the linear models are accurate; blackout uptime exceeds 4 hours only 31.4% of the time.
  5. Next steps. Continue the use cases with a focus on transformer protection.
Common questions

FAQ

Q·What kind of document is this?▾

A final scientific and technical report to the DOE for a four-year funded project, not a single research paper. It summarizes each task and points to the project's papers (for example "Software defined grid energy storage" at BuildSys '22) and code for detail.

Q·How is a virtual battery different from just adding batteries up?▾

Adding up maximum currents and capacities overstates what an aggregate can do. Two batteries of 60 A / 110 Ah and 40 A / 40 Ah cannot deliver 100 A for 1.5 hours, because the smaller one empties after an hour. The BAL derives the aggregate's limit from the smallest C-rate of its members (81 A in that example), splits commands in proportion to each member's share, and reports both expected and current values when members are unbalanced or offline.

Q·What happens when one battery in an aggregate drops off the network?▾

Its state of charge can drift from the others. The BAL keeps operating with "variable current": it recomputes the aggregate's current from the members' current state, so the reported current changes until charge evens out, and it reports lower "current" values next to the "expected" ones.

Q·If one partition charges while another discharges, does the battery do both?▾

No. Partition requests are summed and only the net current goes to the physical battery. The energy one partition "discharges" into another moves only in the BAL's accounting. That transfer implies a payment between the two owners, and the report leaves the billing arrangement to future work.

Q·What does the battery operator still learn under Weft?▾

That each client's schedule is valid, the sum of all schedules (the battery's actual power) and the sum of all partitions (its actual energy). At the extremes that reveals more: if the battery discharges at its maximum rate, every partition must be too. The report calls this leakage unavoidable because the operator has to command its own battery.

Q·Why does Weft send schedules instead of commands?▾

Timing leaks. If a client sends a new setting and the aggregate power changes right after, the operator can attribute the change to that client. A schedule for the coming epoch, sent shortly before it starts, decouples changes in power from when messages arrive, and the servers can add schedules element by element.

Q·Who runs the second server, and what if the two collude?▾

Weft uses Prio's model: the operator runs one server and an independent party runs the other, for example the Internet Security Research Group. Privacy depends on the two not colluding; the report treats this as a practical assumption because such services exist.

Q·Can a small embedded controller really generate these proofs?▾

With bit-splitting proofs, yes. On an nRF52840 (64 MHz Cortex-M4, 256 kB RAM) an application gets 96 kB, enough for schedules of up to 4,000 values. A day at 1-minute intervals (1,440 values) takes 66 s to prove and 4,000 values take 4.5 minutes, which the report finds acceptable for a once-a-day schedule. The trade-off is communication: bit-splitting sends the most data.

Q·Why use a blockchain for device identity?▾

The report argues that a central identity store gives one organization disproportionate control and is an obvious target, while a blockchain offers decentralization, tamper resistance and openness to heterogeneous devices. Secure ID adds self-sovereignty: a device's key is protected by a random key split into Shamir shards held by other nodes, and a verification recombines enough shards.

Q·Does the grid scheme need a detailed model of the network or of each customer's devices?▾

No detailed device data: customers exchange only daily demand and supply bounds, and the global controller does not need their objectives. For the network, it uses linear power-flow models learned from measurements rather than a physics model, which the team found accurate enough for most applications. The guarantee that bounds keep the grid within limits holds only if those linear models are accurate.

Q·Which results come from real hardware?▾

The BAL ran on a testbed of residential and lab batteries. Secure ID ran on AWS instances and a Raspberry Pi standing in for a Sonnen battery. Weft's costs were measured on a desktop and a microcontroller. The grid results (voltage violations, transformer overloads, savings, blackout uptime, battery lifetime) are simulations; the HIL test replaced one simulated home with real devices among 13,000 simulated ones.

Q·What happened to Task 4?▾

Task 4, Trust and Mapping IoT for Data Reliability, was to be led by Lawrence Livermore National Laboratory (LLNL). The subcontract was not pursued because Stanford and LLNL could not agree on legal terms, and its funds went to Stanford's work on virtualization (Task 2.6) and privacy (Task 6.4).

Background terms
DER (distributed energy resource)A small generation, storage or controllable load unit connected to the distribution grid, such as rooftop solar, a home battery, an EV charger or a generator.
BMS (battery management system)The controller inside a battery pack that measures voltage, current and charge and switches charging and discharging on or off.
State of chargeThe energy a battery currently holds, as a percentage of its maximum charge.
Ampere-hour (Ah) and C-rateAn ampere-hour is a unit of battery capacity: one ampere for one hour. The C-rate is a current divided by capacity; a C-rate of 0.5 empties a full battery in two hours.
BAL (Battery Abstraction Layer)The project's programming interface for batteries: a status snapshot call and a set-charge/discharge call, identical for physical and virtual batteries.
BOS (Battery Operating System)The software that implements the BAL, holds drivers for physical batteries, and builds and runs topologies of virtual batteries.
Aggregate and partitioned batteryTwo kinds of virtual battery. An aggregate presents several batteries as one larger battery; a partitioned battery presents one battery as several smaller ones whose sizes sum to the original.
IEC 61850 and ZBATIEC 61850 is an international standard of data models and communication protocols for electrical substation devices. ZBAT is its data model for a battery.
Shamir secret sharingA (k, n) threshold scheme that encodes a secret as points on a random polynomial of degree k − 1: any k of the n shares reconstruct it, and fewer reveal nothing.
Additive secret sharingSplitting a number into random shares that sum to it, one per server. Each share alone looks random, and servers can add shares from many clients to get shares of the total.
Zero-knowledge proofA proof that convinces a verifier a statement is true (here, that hidden values lie in a range) without revealing anything else about the values.
PrioA system by Corrigan-Gibbs and Boneh in which clients secret-share data among non-colluding servers with proofs of validity, and the servers compute only aggregate statistics.
Ramp and regulation signalsGrid-service requests for an aggregation of resources to change its power over time, either as a steady ramp up or down or as a fast-varying regulation profile that it must track.
Black startRestoring power after a grid outage from local sources. The report evaluates how long storage, EVs and PV could supply a network during a blackout.
Hardware-in-the-loop (HIL)A test in which real devices are connected to a running simulation, so the controller drives actual hardware while the rest of the system is simulated.
Summary of R. Rajagopal, P. Levis, A. El Gamal, M. Malik, et al., "TrustDER: Trusted, Private and Scalable Coordination of Distributed Energy Resources," DOE Final Scientific/Technical Report, agreement DE-OE0000919, September 2024. Numbers are from the paper unless marked as this summary's arithmetic.