Abstract
Public electric vehicle (EV) charging increasingly relies on internet-connected platforms for metering, billing, roaming, and settlement. However, final billing records and charge detail records often provide limited evidence that a session result can be independently linked to the ordered metering data from which it was derived. This paper presents a reproducible blockchain-anchored Proof-of-Charge platform for generating tamper-evident and auditable EV charging receipts. The platform converts charging-session data into canonical receipts, computes cryptographic commitments over receipt content and ordered meter values, aggregates receipt hashes using a temporally ordered and domain-separated Merkle profile, and anchors compact batch commitments in a smart contract while keeping detailed records off-chain. A working prototype implements cross-language canonicalization checks, membership-proof generation, structured storage, batch anchoring, verification services, synthetic workload generation, dataset export, and local blockchain deployment. Across 50 measured runs covering 10 to 1000 receipts, all count reconciliations, batch-root checks, and on-chain comparisons passed. Mean receipt-pipeline latency ranged from 7.152 to 7.853 ms per receipt, with throughput from 127.54 to 141.23 receipts/s. A focused 1000-leaf proof sample produced a 2064-byte proof with ten sibling hashes. The results show that the platform can generate, anchor, and verify auditable EV charging receipts with reproducible performance while keeping detailed charging data off-chain. The proposed architecture provides a practical digital trust layer for internet-enabled EV charging and V2G-ready settlement workflows.
1. Introduction
Electric vehicle (EV) charging is becoming an important part of both transport and energy infrastructure. As the number of EVs grows, public charging is no longer a simple interaction between a vehicle and a charging point. A single charging session may involve an EV driver, a charge point operator (CPO), an e-mobility service provider (EMSP), a roaming platform, a payment provider, a distribution system operator (DSO), and, in future scenarios, actors involved in flexibility markets [1,2]. This makes EV charging a digital service as much as an energy service.
In such an environment, the data produced during a charging session become important beyond immediate billing. Meter values, timestamps, tariffs, transaction identifiers, and settlement records may later be needed to resolve disputes, verify invoices, support roaming settlement, or audit the behavior of different service providers. For this reason, charging records should not only be stored; they should also be verifiable.
Existing EV charging systems already rely on well-established protocols. The Open Charge Point Protocol (OCPP) supports communication between charging stations and backend systems, while the Open Charge Point Interface (OCPI) supports roaming and data exchange between service providers [3,4]. These protocols are essential for interoperability and operational coordination. However, they do not by themselves provide independent proof that a receipt or charging record has remained unchanged after the session has ended.
Most charging platforms still depend on centralized backend databases. This approach is practical and widely used, but it creates a trust dependency. A driver has to trust that the billed energy and price reflect the actual session. A CPO may need to show that a receipt was not modified after it was issued. A roaming provider or regulator may need to compare records across different systems. These checks become difficult when the only source of integrity is the database of one platform.
Security and trust issues in EV charging have already been discussed in relation to communication protocols, authentication, backend integration, and data exchange [5]. As charging infrastructure becomes more connected, inconsistent records, billing disputes, incomplete audit trails, fabricated source data, omitted sessions, or post-session modifications become relevant concerns. These concerns require different safeguards: cryptographic anchoring can make committed records tamper-evident, whereas source authenticity, issuer authorization, completeness, freshness, and availability require additional trust and identity mechanisms.
Blockchain can help in this context because it provides an external integrity checkpoint that is not controlled by a single charging platform [6,7]. Still, placing complete charging records directly on-chain is not a practical solution. Charging sessions may include detailed meter values, timestamps, electric vehicle supply equipment (EVSE) identifiers, pricing information, and settlement data. Publishing these data on a public blockchain would increase cost and storage requirements, and it could also expose sensitive operational or personal information.
A more practical design is to keep detailed records off-chain and write only compact cryptographic commitments on-chain. Merkle trees allow many receipt hashes to be represented by one root [8]. In the proposed platform, each batch retains an ordered membership snapshot and supports per-receipt membership proofs, allowing an individual receipt to be verified against the anchored root without publishing the full batch. This approach covers many EV charging receipts with one blockchain transaction while complete receipt data remain outside the blockchain.
The need for verifiable records becomes even stronger when EV charging moves toward smart charging and vehicle-to-grid (V2G) operation. In a conventional charging session, the main value to record is the energy delivered to the vehicle. In a bidirectional session, the system may also need to record energy exported from the vehicle back to the grid or to a local energy system [9,10]. A receipt model for future charging services should therefore support imported energy, exported energy, net energy, import costs, export credits, and final settlement values.
This paper presents a reproducible blockchain-anchored Proof-of-Charge platform for auditable EV charging receipts. The platform transforms charging-session data into deterministic receipts, hashes the receipt content, commits ordered meter values through Merkle roots, and groups receipt hashes into batch anchors. Full receipt data, meter values, batch memberships, and verification history are stored off-chain in a structured Postgres database. Compact batch roots are anchored in a smart contract, where they serve as independent integrity checkpoints. The contribution is an integrated and reproducible workflow that combines canonical receipt construction, ordered meter commitments, batch membership proofs, database-backed auditing, V2G-ready accounting, and repeated performance evaluation.
The prototype follows a local-first research design. It includes a FastAPI-based backend application programming interface (API), a canonical receipt builder, Postgres persistence, batch anchoring, verification services, audit functions, synthetic session generation, dataset and figure exports, and local blockchain anchoring through an Anvil development chain. The receipt model supports charge-only, discharge-only, and bidirectional sessions through import, export, and net-energy fields. This makes the platform useful not only for current EV charging audit scenarios but also for future V2G-ready settlement workflows.
In this work, Proof-of-Charge denotes the complete receipt-verification workflow that links a finalized EV charging receipt to its ordered meter record, batch membership, and blockchain-anchored commitment. The model supports independent audit of receipt integrity, settlement fields, and V2G-ready energy accounting across the platform.
The main contributions of this paper are as follows:
- A reproducible Proof-of-Charge architecture for generating deterministic and auditable EV-charging receipts.
- A canonical receipt model that supports charge-only, discharge-only, and bidirectional sessions through import, export, and net-energy accounting.
- A hybrid off-chain/on-chain integrity model based on receipt hashes, ordered meter-stream commitments, per-receipt batch membership proofs, and blockchain-anchored batch roots.
- A Postgres-backed audit and verification layer for storing sessions, meter values, receipts, batch memberships, anchors, and verification history.
- A local-first experimental workflow for generating synthetic EV charging sessions, executing the receipt-finalization pipeline, exporting datasets, and measuring verification and anchoring behavior.
- A basis for future integration with OCPP/OCPI data, InterPlanetary File System (IPFS)-based archival storage, public blockchain testnets, privacy-preserving verification, and V2G or energy-community settlement models.
The remainder of this paper is organized as follows. Section 2 reviews related work on EV charging protocols, blockchain-based charging systems, verifiable receipts, Merkle-tree anchoring, and V2G settlement. Section 3 presents the proposed system architecture. Section 4 describes the Proof-of-Charge receipt model and cryptographic verification process. Section 5 explains the prototype implementation. Section 6 presents the experimental design and evaluation metrics. Section 7 discusses the results and system limitations. Section 8 concludes the paper and outlines future research directions.
2. Related Work
The proposed Proof-of-Charge platform is positioned at the intersection of EV charging interoperability, charging-record security, blockchain anchoring, Merkle-based verification, and V2G-ready settlement. This section reviews these areas and identifies the gap addressed by the proposed platform.
2.1. EV Charging Protocols and Interoperability
Public EV charging relies on several communication and interoperability protocols. OCPP is widely used for communication between charging stations and central management systems, supporting transaction handling, metering, remote operations, and smart charging functions [3]. OCPI, on the other hand, enables interoperability between charge point operators, e-mobility service providers, and roaming platforms by defining interfaces for locations, tariffs, sessions, charge detail records, tokens, and commands [4]. Together, these protocols provide the operational basis for multi-actor EV charging services.
However, OCPP and OCPI mainly define how data are exchanged. They do not, by themselves, provide a complete independent mechanism for proving that a charging receipt or settlement record has remained unchanged after the session has ended. OCPP supports transaction and meter-value exchange, and OCPI includes charge detail records, but the long-term verifiability of these records still depends on how backend systems store and protect them. This leaves room for additional cryptographic mechanisms when drivers, operators, roaming providers, or regulators need independent verification.
ISO 15118 complements this ecosystem by defining communication between the EV and the charging infrastructure, including Plug & Charge, smart charging, and vehicle-to-grid use cases [11]. It is especially relevant for secure identification, automated authorization, and bidirectional energy exchange. Still, even when communication is secure, the long-term auditability of receipts and settlement records remains a separate problem.
2.2. Security, Trust, and Auditability in EV Charging
EV charging systems combine cyber-physical infrastructure, backend platforms, payment services, user identities, and energy metering. This makes security and trust a practical concern, not only a protocol issue. Previous studies have discussed vulnerabilities in OCPP-based charging scenarios, including authentication weaknesses, backend communication risks, and differences between protocol versions [5]. Other work has emphasized the need for stronger end-to-end security, long-term authenticity of stored data, and better protection of communication links [12].
Security risks can also appear beyond backend communication. Manipulation of charging states, control signals, or session data can affect the reliability of charging services and the trustworthiness of the resulting records [13]. These issues show why auditability is important. A receipt should not only be issued by a backend system; it should also be possible to verify whether it corresponds to the original session data. This is the motivation behind the Proof-of-Charge approach proposed in this paper.
2.3. Blockchain in Energy and EV Charging Systems
Blockchain technology has been studied in energy and EV charging systems as a tool for decentralized trust, tamper-evident records, peer-to-peer energy trading, automated settlement, and smart-contract-based coordination [6,7,14,15,16,17]. In these settings, blockchain can provide a shared integrity layer that is difficult to modify after publication.
At the same time, blockchain is not a replacement for conventional databases. Public blockchains introduce cost, latency, scalability, and privacy constraints. For EV charging, storing complete sessions, meter values, tariffs, and user-related information directly on-chain would be inefficient and may expose sensitive information. For this reason, practical designs often keep operational data off-chain and use the blockchain only to anchor compact cryptographic commitments.
The platform proposed in this paper follows this hybrid design. Full receipts, meter values, batch memberships, and verification records are stored in an off-chain Postgres database, while batch Merkle roots are published to a blockchain anchor contract. This preserves queryability and operational flexibility, while adding an external tamper-evident checkpoint.
2.4. Merkle Trees and Off-Chain/On-Chain Anchoring
Merkle trees are widely used because they allow many data items to be represented by a single root hash [8]. If one record changes, the corresponding root also changes. This makes Merkle trees useful for audit logs, transparency systems, blockchain applications, and batch verification.
In the proposed EV charging workflow, Merkle trees are used at two levels. First, ordered meter values from a charging session are committed through a session-level Merkle root. This gives a compact representation of the meter stream. Second, multiple receipt hashes are grouped into a batch Merkle tree, producing a batch root that can be anchored on-chain. Publishing only the batch root avoids the cost of writing each receipt to the blockchain, while still allowing later verification of receipt inclusion and batch integrity.
This off-chain/on-chain anchoring model is well suited to EV charging because receipts and meter values may contain operational or personal information that should not be published directly on a public blockchain [16].
Content-addressed systems such as IPFS provide one possible off-chain archival layer for records whose integrity is linked to an anchored commitment [18].
2.5. V2G-Ready Settlement and Bidirectional Energy Accounting
Vehicle-to-grid and bidirectional charging introduce settlement requirements that go beyond conventional charge-only sessions. In a standard session, the main accounting value is the energy imported by the vehicle. In a V2G scenario, the vehicle may also export energy back to the grid, a building, or a local energy community. This requires the receipt to represent imported energy, exported energy, net energy, import costs, export credits, and final settlement values [9,10,11].
Previous studies have shown that EVs can support grid services such as peak shaving, frequency regulation, and distributed storage [9,19]. These services depend on reliable metering and settlement. If EVs participate in flexibility markets or local energy communities, their charging and discharging records must be transparent and verifiable. A receipt model that only supports charge-only accounting is therefore not sufficient for future bidirectional scenarios.
The Proof-of-Charge model addresses this requirement by including import, export, and net-energy fields in the canonical receipt schema. Although the current prototype uses synthetic sessions and local blockchain anchoring, the data model prepares the system for later integration with real charging protocols and V2G-ready settlement workflows.
2.6. Research Gap
Existing research covers several important parts of the EV charging trust problem. EV charging protocols support operational data exchange. Security studies identify vulnerabilities in communication and backend integration. Blockchain-based systems provide tamper-evident records and decentralized settlement models. Merkle trees support compact verification, while V2G research highlights the need for bidirectional energy accounting.
However, these areas are often treated separately. Many blockchain-based EV charging proposals focus on payment, energy trading, or coordination, but do not provide an implementation-oriented and reproducible receipt-verification pipeline. Similarly, OCPP and OCPI support session and settlement data exchange, but they do not provide a complete independent mechanism for verifying that a finalized receipt, meter stream, and settlement record remain unchanged over time.
Our previous work explored blockchain-based auditability for EV charging records [20,21]. Study [20] introduced an EV-charging receipt concept with off-chain hashing, a Merkle-based commitment, and on-chain anchoring, but it did not provide the complete database-backed audit service, explicit cross-language canonicalization profile, temporally ordered and domain-separated batch profile, standalone membership proofs, exact identifier reconciliation, or repeated multi-seed performance workflow implemented here. Study [21] focused on preserving session evidence by anchoring a session hash and an InterPlanetary File System content identifier; it did not define the present deterministic receipt schema, ordered meter-stream commitment, batch-membership model, or layered verification pipeline.
This paper addresses that gap by implementing a reproducible Proof-of-Charge platform rather than proposing a new hash function, Merkle primitive, database model, or blockchain consensus mechanism. The platform combines the explicit poc-c14n-v1 receipt profile, ordered meter-stream commitments, structured Postgres persistence, the poc-batch-merkle-v1 temporal batch profile, stored membership metadata and proofs, layered receipt/meter/database/batch/on-chain checks, exact experiment reconciliation, local blockchain publication, and raw reproducibility exports. In contrast to approaches that store full records on-chain, the design anchors compact commitments while keeping detailed data off-chain and queryable. This makes the system suitable for controlled research evaluation and future extension toward real OCPP/OCPI data, IPFS-based archival storage, public testnets, privacy-preserving verification, and V2G-ready settlement.
Table 1 highlights the progression from protocol-, security-, and blockchain-focused studies toward an integrated receipt-audit platform. Compared with the authors’ earlier Proof-of-Charge and blockchain-IPFS studies, the present work adds a frozen canonical receipt profile, ordered meter-stream verification, temporally ordered and domain-separated batch commitments, explicit membership proofs, structured database audit history, V2G-ready accounting, exact identifier reconciliation, repeated multi-seed benchmarking, and versioned reproducibility artifacts. The contribution therefore lies in the system-level integration and evaluation of these components within one reproducible EV-charging workflow.
Table 1.
Comparison of selected related works and the proposed Proof-of-Charge platform.
3. System Architecture
The proposed Proof-of-Charge platform follows a hybrid off-chain/on-chain architecture. Its purpose is to generate auditable EV charging receipts without storing complete charging records directly on-chain. The platform combines deterministic receipt generation, cryptographic hashing, Merkle-tree commitments, structured off-chain storage, blockchain batch anchoring, and reproducible experiment workflows.
The main design principle is simple: detailed charging data remain off-chain, while compact cryptographic commitments are anchored on-chain. This follows a common blockchain design pattern in which the distributed ledger acts as a tamper-evident integrity checkpoint, while application-specific records are stored in external systems [6,7,16]. In the proposed platform, session data, meter values, receipts, batch memberships, and verification records are stored in a Postgres database. The blockchain stores only batch roots derived from receipt hashes.
3.1. Main Architectural Components
The platform consists of eight main components.
- Charging session input layer:This layer represents the input data of an EV charging session, including session_id, user_id, evse_id, ocpp_tx_id, timestamps, meter values, pricing information, and session type. The structure is aligned with the type of session data exchanged in OCPP- and OCPI-based charging ecosystems [3,4].
- Receipt construction layer:The receipt builder transforms the charging-session input into a canonical Proof-of-Charge receipt. The receipt contains session metadata, energy information, pricing details, settlement values, and a Merkle root over the ordered meter stream. Deterministic construction is important because the same input data must always produce the same receipt representation and receipt hash.
- Cryptographic commitment layer:This layer computes hashes over receipt content and Merkle roots over ordered meter values. The receipt hash commits to the canonical receipt, while the meter-stream Merkle root commits to the time-ordered measurements. Merkle trees are suitable for this role because they represent multiple data elements through a single root hash [8].
- Off-chain persistence layer:The platform uses Postgres to store finalized sessions, receipts, meter values, batch anchors, batch memberships, and verification records. This keeps the data queryable and auditable without exposing complete charging-session details on a public blockchain.
- Batch anchoring layer:Instead of anchoring each receipt separately, the platform groups receipt hashes into daily batches. The hashes are sorted deterministically and used to compute a batch Merkle root. One batch root can therefore represent multiple receipts, reducing the number of blockchain transactions required.
- Blockchain anchoring layer:The batch root is published to a blockchain anchor contract. In the current prototype, this is implemented on a local Anvil development chain. The blockchain layer provides an independent checkpoint that can later be compared with the off-chain batch root.
- Verification and audit layer:The verification layer recomputes receipt hashes, meter-stream Merkle roots, and batch roots to detect inconsistencies. The audit layer rebuilds receipts from stored session data and compares them with the stored JavaScript Object Notation (JSON) receipt, stored receipt hash, and normalized database columns. When an inconsistency is detected, the current prototype records the failed verification result, mismatch details, and expected and recomputed values in the verification history and reports the affected session or batch as failed. It does not automatically overwrite or repair the inconsistent record, and the original receipt hash and blockchain anchor remain unchanged as historical integrity evidence. In an operational deployment, the affected record should be excluded temporarily from billing or settlement, reconstructed from trusted session and meter-source data, and verified again. A corrected receipt should be issued as a new version and included in a new batch anchor, while unresolved cases should be escalated for operator or independent-auditor review.
- Experiment and export layer:The platform also includes synthetic session generation, reproducible experiment execution, comma-separated values (CSV) export, figure generation, and result snapshotting. This layer supports repeatable evaluation using outputs such as finalization latency, batch verification status, receipt counts, and blockchain transaction metrics.
3.2. Architectural Flow
The workflow starts when a charging session is finalized. The session input is validated and converted into a canonical Proof-of-Charge receipt. The receipt is hashed, and the ordered meter values are committed through a Merkle root. The finalized session, receipt, and receipt hash are then stored in the off-chain database.
After receipt generation, the batch anchoring process groups receipts by day and, when needed, experiment prefix. The system computes a batch Merkle root from the receipt hashes and stores the batch anchor together with membership information. The batch root can then be published to the blockchain anchor contract. Verification is performed by recomputing the local batch root and comparing it with both the stored database anchor and the on-chain value.
This workflow supports two levels of verification. First, an individual receipt can be checked by recomputing its deterministic hash and comparing it with the stored hash. Second, a group of receipts can be checked by recomputing the batch Merkle root and comparing it with the anchored root. If a receipt is modified after finalization, the recomputed hash changes and the verification process detects a mismatch.
3.3. Proposed Architecture Diagram
The architecture shown in Figure 1 illustrates the separation between operational data storage and blockchain anchoring. Complete charging-session data and receipts remain in the database, while the blockchain stores only compact batch-root commitments. This separation is important for scalability, privacy, and practical deployment.
Figure 1.
Proposed Proof-of-Charge architecture.
Figure 1 shows the proposed Proof-of-Charge architecture. The platform follows a hybrid off-chain/on-chain model, where detailed EV charging data remain in the Postgres persistence layer and compact cryptographic commitments are anchored on-chain. The design is aligned with blockchain-based integrity models [6,7,16] and uses Merkle-tree commitments for efficient batch verification [8]. The session input layer is compatible with the type of charging-session data exchanged in OCPP- and OCPI-based ecosystems [3,4].
3.4. Off-Chain and On-Chain Responsibilities
The proposed design assigns different responsibilities to the off-chain and on-chain components. The off-chain database stores detailed records, supports queries, enables audit operations, and keeps receipts and meter data available for verification. The blockchain is used only to store compact integrity commitments.
This separation avoids the main limitations of full on-chain storage. EV charging receipts may include timestamps, user identifiers, EVSE identifiers, meter samples, pricing components, and settlement values. Storing these data directly on-chain would increase transaction costs and may expose sensitive information. By anchoring only a batch Merkle root, the system preserves auditability while reducing on-chain storage requirements.
3.5. V2G-Ready Architectural Support
The architecture is also prepared for future bidirectional charging and V2G-ready settlement. The receipt model includes imported energy, exported energy, and net energy. This allows the system to represent charge-only, discharge-only, and bidirectional sessions. In future extensions, the same structure can support energy-community settlement, flexibility services, demand response, and vehicle-to-grid compensation models [9,10,11].
In the current prototype, V2G support is evaluated through synthetic session types rather than a live bidirectional charger. However, the separation between session input, receipt generation, settlement calculation, verification, and anchoring makes the model extensible toward real OCPP/OCPI data ingestion and ISO 15118-based V2G communication.
3.6. Design Rationale
The architecture was designed according to four principles.
First, receipts must be deterministic. The same charging-session input should always produce the same canonical receipt and hash. This is necessary for reproducible verification.
Second, the system should avoid unnecessary on-chain storage. Blockchain is used for anchoring compact commitments, not for storing complete charging-session records.
Third, the system must remain queryable and auditable. For this reason, Postgres stores structured records, including sessions, receipts, meter values, anchors, memberships, and verification results.
Fourth, the workflow must be reproducible for research evaluation. The platform includes synthetic session generation, experiment scripts, exports, and result snapshots, allowing different workload sizes and verification scenarios to be repeated.
These principles make the proposed architecture suitable for a local-first research prototype, while keeping a clear path toward future integration with real charging infrastructure, public blockchain testnets, IPFS-based storage, and privacy-preserving verification mechanisms.
3.7. Threat Model, Security Goals, and Trust Boundaries
The threat model considers the complete path from charging-session input to receipt verification and blockchain comparison. Trusted components in the evaluated prototype include the configured receipt-builder and verification code, SHA-256, the selected canonicalization and batch profiles, the database and experiment configuration used to construct commitments, the configured anchor-contract address and network, and the operator controlling the publisher key. Potential adversarial actions include unauthorized changes to receipt JSON, normalized columns, meter rows, batch memberships, or anchor metadata; replay of session or batch identifiers; publication of an incorrect root; redirection to an incorrect contract or network; publisher-key compromise; privileged contract misuse; collusion before finalization; and blockchain reorganization.
The evaluated security objective is to detect inconsistencies between finalized records and their stored or anchored commitments. Production deployment extends this model with trusted metering, issuer signatures, certificate and key lifecycle management, replay protection, independent contract governance, network-finality policy, and operational availability controls. These complementary mechanisms establish the identity, provenance, and operating context around the cryptographic receipt workflow.
Table 2 summarizes the security properties supported by the current verification layers and the complementary controls required for production deployment. It distinguishes the implemented integrity and audit functions from identity, timestamping, availability, privacy, and external reconciliation services.
Table 2.
Security properties and implementation status of the current Proof-of-Charge prototype.
3.8. Blockchain Rationale and Alternative Integrity Mechanisms
Blockchain is used here as a shared external commitment layer rather than as a universal replacement for signatures, trusted timestamping, transparency logs, or immutable archival storage. A database hash is inexpensive but remains within the administrative domain of the backend. Digital signatures are better suited to issuer authentication, while trusted timestamps and transparency logs provide different time and publication guarantees. WORM storage can provide strong retention controls when a trusted organizational or storage-provider boundary is acceptable. Blockchain is most relevant when multiple organizations need to compare a replicated commitment without assigning unilateral control of the reference point to one charging platform.
The local Anvil experiments quantify the anchoring transaction, gas consumption, and effective cost per covered receipt under reproducible conditions. Table 3 therefore presents blockchain anchoring alongside signatures, trusted timestamping, transparency logs, database hashing, and WORM storage as mechanisms with different trust, deployment, and audit characteristics.
Table 3.
Comparison of integrity and audit mechanisms relevant to EV-charging receipts.
4. Proof-of-Charge Receipt and Verification Model
The core objective of the proposed platform is to create a deterministic receipt that can be checked independently against stored and anchored commitments. The Proof-of-Charge model connects session data, meter measurements, pricing information, settlement values, cryptographic hashes, batch membership proofs, and blockchain anchors within one audit workflow. Complementary source attestation and issuer-authentication controls are described in Section 4.10 as part of the path toward production deployment.
4.1. Charging Session Representation
A charging session represents the interaction between an EV user and a charging point. In the proposed model, a session contains technical and transactional information, including the session identifier, user identifier, EVSE identifier, OCPP transaction identifier, start and end timestamps, meter values, pricing components, and session type. These elements are consistent with the type of data exchanged in EV charging ecosystems through OCPP and OCPI [3,4].
Let a charging session be represented as
where () is the session identifier, () is the user identifier, () is the charging point identifier, (tx) is the transaction identifier, ) and () are the start and end timestamps, () is the ordered set of meter values, () is the pricing structure, and () defines whether the session is charge-only, discharge-only, or bidirectional.
The ordered meter stream is defined as
where each meter value () contains a timestamp and energy-related measurements. In V2G-ready scenarios, a meter value may also include imported and exported energy fields.
4.2. Canonical Receipt Construction
For each finalized charging session, the platform constructs a canonical Proof-of-Charge receipt. The receipt is deterministic: the same valid session input must always produce the same receipt representation. This property is important because cryptographic verification depends on stable serialization and reproducible hashing.
The canonical receipt contains the main fields required for audit and verification, including the receipt version, schema version, session type, session identifier, user identifier, EVSE identifier, OCPP transaction identifier, start and end timestamps, total energy, energy summary, pricing model, settlement values, meter-stream Merkle root, and hash algorithm.
The receipt is represented as
where () denotes the deterministic transformation of a charging session into a normalized receipt structure.
The energy summary is defined as
where () is the energy imported by the EV, () is the energy exported from the EV, and () is the resulting net energy. The model enforces the following invariant:
For charge-only sessions, (). For discharge-only sessions, () may be zero or lower than the exported energy. For bidirectional sessions, both imported and exported energy may be present. This structure makes the receipt model suitable for future V2G-ready settlement scenarios [9,10,11].
New receipts use the explicit canonicalization profile poc-c14n-v1. The profile serializes a frozen receipt field set as compact UTF-8 JSON without a byte-order mark, trailing newline, or insignificant whitespace. Object keys are ordered recursively by Unicode code point, while array order remains semantically significant. Strings are normalized to Unicode NFC; timestamps are normalized to UTC in the form YYYY-MM-DDTHH:MM:SS.ffffffZ; energy, price, and settlement quantities are represented as fixed three-decimal strings using ROUND_HALF_UP; and negative zero is normalized to 0.000. Missing required fields, null values, additional fields, naive timestamps, non-finite numbers, duplicate JSON keys, unknown profiles, and unsupported algorithms fail closed.
Canonical bytes and hashing are exposed as separate operations, and historical receipts without a profile marker retain their original verification rules rather than being silently recalculated. An independent JavaScript (Node.js v23.10) implementation and the Python 3.13.3 implementation produced identical UTF-8 bytes and the same SHA-256 value for the committed cross-language conformance vector. Additional automated tests cover key-order independence, equivalent time-zone offsets, Unicode normalization, array-order significance, rounding boundaries, negative zero, invalid values, and legacy verification. This evidence supports the stated Python-JavaScript profile, but it is not presented as universal interoperability across every language or serializer.
4.3. Settlement Model
The settlement model links energy quantities with pricing information. In charge-only sessions, the final amount usually depends on imported energy and the applicable tariff. In bidirectional sessions, the system must also account for credits related to exported energy. For this reason, the receipt includes three settlement fields:
where () is the gross import cost, () is the gross export credit, and () is the final net amount. The following accounting invariant is enforced:
This invariant allows the audit layer to check whether the stored settlement values are consistent with the energy summary and pricing components. If a receipt is modified after finalization, the recomputed values will no longer match the stored hash or the normalized database fields.
4.4. Receipt Hash
After the canonical receipt is constructed, the platform computes a cryptographic hash over its content. Let () denote a cryptographic hash function. The receipt hash is computed as
The receipt hash acts as a compact integrity commitment to the full canonical receipt. Any change in the receipt content, including timestamps, energy values, pricing fields, settlement values, identifiers, or the meter-stream Merkle root, produces a different hash. Verification is therefore performed by recomputing () and comparing it with the stored receipt hash.
In the current prototype, SHA-256 is used as the receipt hash algorithm. The hash is stored together with the full receipt JSON and normalized receipt fields in the Postgres persistence layer.
4.5. Meter-Stream Merkle Root
Meter values are central to EV charging auditability because they show how the measured energy changes during a session. Instead of committing only to the final energy value, the proposed model commits to the ordered meter stream through a Merkle root. This allows the receipt to represent the underlying sequence of measurements in a compact form [8].
For a session with ordered meter values,
Each meter value is first hashed:
The meter-stream Merkle root is then computed as
The value () is included in the canonical receipt. If any meter value is changed, removed, reordered, or inserted, the recomputed Merkle root will differ from the stored root. In this way, the receipt is linked not only to summary energy values but also to the ordered meter measurements used to produce them.
Before the receipt summary and meter commitment are generated, meter samples are sorted by timestamp. Import and export are treated as cumulative directional counters in kWh, with import denoting energy delivered to the EV and export denoting energy returned from the EV. Values are rounded to 0.001 kWh, and decreasing cumulative counters are rejected as possible resets or corrupt data. Session import and export are derived from the difference between the final and initial counters, and net energy is computed as import minus export. Settlement values are derived from these quantities and the overlapping tariff intervals and then rounded to three decimal places. The summary and meter-stream commitment therefore originate from the same normalized ordered stream rather than from algebraic invariants alone.
The prototype does not automatically repair a meter reset, estimate missing samples, correct clock drift, or convert unspecified source units. Duplicate timestamps are not yet governed by a dedicated conflict rule, so production ingestion should reject them or resolve them through an explicit sequence number and quality flag. A sample removed or altered after finalization changes the recomputed meter root; a sample omitted by the source before finalization cannot be detected without an authoritative external log or signed meter sequence.
4.6. Batch Anchoring Model
Publishing each receipt hash separately to the blockchain would be inefficient when many sessions are processed. New PostgreSQL-backed anchors therefore use the versioned profile poc-batch-merkle-v1. The profile commits to the UTC batch day, the half-open eligibility interval (day 00:00 UTC, next day 00:00 UTC), the ordering rule, the duplicate-last odd-node rule, the hash algorithm, and the number of leaves. Historical anchors remain verifiable under the earlier legacy-hash-sort-v0 procedure.
For a batch of (k) receipts,
The batch root is computed as
The batch root () is stored in the off-chain database and can also be published to a blockchain anchor contract. This creates an external integrity checkpoint for all receipts included in the batch. Since only one root is anchored, the on-chain storage requirement does not increase with the number of receipts inside the batch. This follows the hybrid off-chain/on-chain design principle, where detailed data remain off-chain and compact commitments are anchored on-chain [6,7,16].
For poc-batch-merkle-v1, records are ordered by normalized UTC start timestamp, followed by NFC-normalized session identifier and receipt-hash bytes. The context, leaves, internal nodes, and final root use distinct prefix bytes (0x02, 0x00, 0x01, and 0x03, respectively). Each leaf binds the context hash, length-delimited session identifier, normalized start timestamp, and 32-byte receipt hash. The final root additionally binds the context hash and unsigned 64-bit leaf count. Duplicate session identifiers, duplicate receipt hashes, duplicate leaf encodings, malformed hashes, and invalid indices are rejected. At each odd-width level, the final node is paired with itself.
The implementation generates standalone JSON membership proofs containing the profile, context, leaf count, leaf index, committed fields, leaf hash, ordered sibling hashes, and sibling directions. Proof verification does not require database access. A closed batch is immutable by default: re-closing an unchanged snapshot is idempotent, whereas changed membership is reported with added, removed, or changed identifiers. A separate current-state audit detects late insertions, removals, changed receipt hashes, and changed start timestamps while preserving the validity of the historical snapshot.
As shown in Figure 2, the verification model relies on independent re-computation rather than trust in stored values alone. At the receipt level, the platform recomputes the canonical receipt hash and compares it with the stored hash. At the meter-stream level, the ordered meter values are rehashed to recompute the meter Merkle root. At the batch level, receipt hashes are used to recompute the batch Merkle root and compare it with the database anchor. If the batch root has been published on-chain, the database root is also compared with the blockchain commitment. A mismatch at any layer indicates that the receipt, meter stream, batch membership, or anchor record may have been modified or stored incorrectly.
Figure 2.
Cryptographic verification model for Proof-of-Charge receipts and batch anchors.
4.7. Verification Procedures
The platform supports three complementary verification procedures.
4.7.1. Single-Receipt Verification
Single-receipt verification recomputes the hash of the stored receipt JSON and compares it with the stored receipt hash:
If the receipt content has been modified after finalization, the recomputed hash differs from the expected hash and verification fails.
4.7.2. Batch Verification
Batch verification recomputes the batch Merkle root from the receipt hashes included in the batch and compares it with the stored batch root:
This verifies whether the stored batch membership and receipt hashes still correspond to the anchored batch root.
4.7.3. On-Chain Anchor Verification
If the batch root has been published to the blockchain, the verifier retrieves the on-chain root and compares it with the locally stored batch root:
This step checks whether the off-chain database anchor matches the blockchain integrity checkpoint.
4.8. Audit and Tamper Detection
The audit process extends basic hash verification by rebuilding the receipt from the stored session data and comparing the rebuilt receipt with the stored receipt JSON, stored hash, and normalized database columns. This allows the platform to detect several types of inconsistency, including:
- modified receipt JSON;
- changed energy values;
- inconsistent import, export, or net energy;
- inconsistent settlement values;
- mismatch between the stored and recomputed receipt hash;
- mismatch between the stored and recomputed batch root.
This check is useful because an attacker or system error may modify only part of the stored data. For example, if the receipt JSON is changed but the stored receipt hash is not updated, single-receipt verification fails. If normalized database columns are changed while the receipt JSON remains unchanged, the audit process can still detect inconsistency between the canonical receipt and the queryable database fields.
4.9. Summary of the Verification Model
The proposed Proof-of-Charge model uses several verification layers instead of relying on a single integrity check. The receipt hash protects the canonical receipt content. The meter-stream Merkle root protects the ordered meter measurements. The versioned batch Merkle root protects a temporally ordered and context-bound membership snapshot, while membership proofs allow individual receipt inclusion to be checked without disclosing the full batch. The blockchain anchor provides an external checkpoint for the batch root. Together, these mechanisms support auditable EV charging receipts without requiring complete charging-session data to be stored on-chain.
As summarized in Table 4, the model combines receipt-level, meter-stream, batch-level, on-chain, and database audit checks. This layered approach helps identify where an inconsistency appears, such as modified receipt content, changed meter values, incorrect batch membership, an anchoring mismatch, or inconsistent database fields.
Table 4.
Verification layers in the Proof-of-Charge model.
4.10. Issuer Authentication, Completeness, Privacy, and Contract Boundaries
The production architecture can extend the current receipt hash with digital signatures and certificate-chain validation that bind each receipt to an authorized charger, meter, CPO, or EMSP. The canonical receipt already provides the deterministic payload required for such signing. An issuer identifier, signing-key identifier, signature algorithm, certificate reference, trusted signing time, and revocation status can be added without changing the batch-anchoring model.
Completeness can be strengthened through reconciliation with an authoritative session register. Before batch closure, the recorded membership set can be compared with signed OCPP transaction events, CPO/EMSP settlement records, or another append-only operational register. The implemented exact identifier reconciliation used in the experiments provides the same form of set comparison for controlled workloads.
Privacy protection currently relies on on-chain data minimization: only batch roots and associated counts are published, while detailed records remain in Postgres. Production extensions may add encrypted field-level access, selective disclosure, anonymous credentials, or zero-knowledge proofs. Contract deployment can likewise be strengthened through publisher authorization, secure key custody, replay controls, multi-signature governance, independent audit, reorganization handling, and emergency migration procedures.
These requirements reflect broader smart-contract application, security, governance, and operational challenges identified in the literature [25,26].
5. Prototype Implementation
The Proof-of-Charge model was implemented as a local-first research prototype. The purpose of the prototype is not to replace an existing EV charging backend but to provide a controlled environment in which receipt generation, anchoring, verification, and audit procedures can be tested reproducibly. Starting from synthetic or structured charging-session input, the prototype produces canonical receipts, receipt hashes, batch anchors, verification records, exported datasets, figures, and blockchain anchoring metrics.
5.1. Technology Stack
The prototype is implemented in Python and organized as a modular backend system. FastAPI is used to expose the main service endpoints [27], while Postgres stores sessions, meter values, receipts, anchors, batch memberships, and verification results [28]. SQLAlchemy is used for database access [29], and Alembic supports schema migration during development [30]. The cryptographic part of the implementation relies on SHA-256 hashing and Merkle-tree construction to create compact integrity commitments [8].
For blockchain anchoring, the prototype uses a Solidity smart contract deployed on a local Anvil development chain. This local-first setup allows the anchoring workflow to be tested without depending on a public blockchain network during experimentation. It also makes the evaluation easier to reproduce, since receipt generation, batch construction, smart-contract deployment, anchoring, and verification can be executed in a controlled environment [6,7,16,17].
The implementation is structured around a small set of backend modules. The receipt builder creates deterministic receipts from finalized session data. The persistence layer stores the session, receipt, meter, anchor, membership, and verification records. Merkle-tree utilities compute both meter-stream roots and batch roots. The anchoring module groups receipt hashes into daily batches and prepares the corresponding blockchain commitment. Verification and audit modules recompute receipt hashes, Merkle roots, and stored values to detect inconsistencies. Finally, the experiment, export, and chart-generation modules support reproducible workloads and provide the datasets and figures used in the evaluation.
Table 5 presents the main implementation modules of the prototype and the role of each module in the Proof-of-Charge workflow. The implementation separates API interaction, receipt construction, database persistence, cryptographic verification, blockchain anchoring, auditing, and experiment generation. This modular organization makes it easier to test each part of the platform, repeat experiments under controlled conditions, and extend the prototype toward future integrations.
Table 5.
Prototype implementation modules and responsibilities.
5.2. Backend API and Persistence Layer
The backend exposes a Representational State Transfer (REST) API for finalizing and querying Proof-of-Charge records. Its main role is to connect charging-session input with the receipt-generation, storage, anchoring, verification, and audit workflow. When a session is submitted, the backend validates the input, constructs the canonical receipt, computes the receipt hash, stores the finalized records, and returns the generated receipt together with its hash.
The API supports the main operations required by the prototype, including session finalization, retrieval of stored sessions and receipts, listing of batch anchors, publication of batch roots to the blockchain, verification of blockchain anchors, access to verification history, and audit requests. Although the current experiments use synthetic sessions, the same API structure can later be extended to ingest real charging-session data from OCPP- or OCPI-based systems [3,4].
Postgres acts as the main source of truth for finalized sessions, meter values, receipts, batch anchors, batch memberships, and verification records. Earlier file-based JSON receipt storage remains available only as a fallback or debugging mechanism. The database schema is organized around six main tables: sessions, meter_values, receipts, batch_anchors, batch_anchor_receipts, and verifications.
The sessions table stores normalized session metadata and the full session JSON. The meter_values table stores ordered meter samples associated with each session. The receipts table stores the canonical receipt JSON, receipt hash, meter Merkle root, energy fields, settlement values, and optional blockchain or IPFS metadata. The batch_anchors table stores batch roots, receipt counts, and anchoring metadata, while batch_anchor_receipts stores the exact receipt-hash membership snapshot included in each batch. The verifications table stores verification results and audit outputs.
This design keeps the operational records queryable while preserving the information needed for receipt reconstruction, batch verification, audit checks, and reproducible experiments.
5.3. Receipt Finalization, Anchoring, and Verification Workflow
The receipt finalization workflow begins when the backend receives a charging-session payload. The system validates the input, applies default schema and session-type values when needed, and constructs the canonical receipt from session metadata, ordered meter values, pricing information, settlement fields, and the meter-stream Merkle root. The platform then computes the deterministic receipt hash and stores the finalized session, receipt, hash, and normalized fields in Postgres.
After receipts are finalized, the batch anchoring module groups them by day and, when required, experiment prefix. It retrieves the corresponding receipt hashes, sorts them deterministically, and computes a batch Merkle root using Merkle-tree-based commitment principles [8]. The batch root is stored together with the number of receipts and the exact membership snapshot. This snapshot is important because it records which receipt hashes were included at the time of anchoring.
The same workflow supports local blockchain anchoring. A database batch root can be published to the Solidity anchor contract on the Anvil chain and later compared with the on-chain value. The publisher records transaction-related metrics, including transaction hash, block number, gas used (gas units), effective gas price (wei/gas), transaction fee (wei), transaction status, and root-matching result. These metrics are used for research evaluation, while the current implementation remains a local-first prototype rather than a production blockchain deployment.
Verification and audit services recompute receipt hashes, independently reconstruct meter-stream roots from the normalized meter_values table, compare normalized receipt columns, recompute recorded batch memberships and roots, and compare local anchors with the blockchain-verification result. The prototype now includes a rollback-isolated seven-scenario tamper-matrix runner. Each scenario begins from a valid baseline, applies one controlled change inside a database savepoint, evaluates the five verification layers separately, restores the original state, and verifies that the baseline passes again.
5.4. Synthetic Workloads and Research Exports
To support reproducible evaluation, the prototype includes a synthetic EV charging session generator. The generator creates charge-only, discharge-only, and bidirectional sessions, reflecting the accounting requirements of V2G-ready charging scenarios [9,10,11]. Each generated session includes identifiers, timestamps, ordered meter values, pricing components, energy summaries, and a session type.
Experiments are controlled through a random seed and a run identifier. The run identifier is used as a prefix for generated session identifiers, allowing receipts and anchors from the same experiment to be isolated from other database records. The generator can also use an optional EVSE registry dataset to enrich synthetic sessions with charging-station metadata.
The experiment runner executes the full local pipeline: synthetic session generation, canonical receipt construction, receipt hashing, Postgres persistence, batch anchor creation, batch verification, optional blockchain publication and verification, CSV export, figure generation, and metrics storage. The platform exports research-ready datasets, including sessions, meter values, receipts, anchors, and verifications. Each run also produces a manifest and metrics file, which makes experiments easier to repeat and compare.
5.5. Implementation Limitations
The prototype is intended for research evaluation rather than production deployment. It currently uses synthetic charging sessions instead of live OCPP charger data. Blockchain anchoring is performed on a local Anvil chain, not on a public testnet or production blockchain. IPFS content identifiers are included only as placeholders for future decentralized storage support [18]. The system also does not yet include a complete dashboard or user-facing interface.
These limitations identify the main steps from research prototype to production deployment. The evaluated implementation focuses on reproducible receipt construction, off-chain persistence, Merkle-based batch anchoring, integrity checking, audit comparison, and controlled tamper detection, while Section 4.10 and Section 8 describe the complementary identity, privacy, availability, and governance controls required for operational use.
6. Experimental Design and Evaluation Metrics
The experimental evaluation assesses whether the platform can generate deterministic EV-charging receipts, anchor recorded receipt batches, verify receipt and batch consistency, detect controlled inconsistencies, and produce reproducible research datasets. Reproducibility is important in computational research, especially when results depend on software artifacts, datasets, configuration parameters, and execution environments [31]. The experiments therefore use deterministic synthetic sessions, a structured PostgreSQL database, and a local blockchain development environment so that each stage can be measured and repeated under controlled conditions.
The evaluation focuses on five aspects: receipt finalization performance, batch anchoring and verification correctness, blockchain anchoring overhead, tamper detection, and V2G-ready session representation. Together, these experiments evaluate the main technical claims of the proposed platform.
6.1. Experimental Environment
The repeated benchmark was executed on one controlled local environment: an Apple M1 Max system with 10 physical and 10 logical cores and 32 GB RAM, running macOS 26.5.2, Python 3.13.3, PostgreSQL 16.14 in a Docker container, and Anvil/cast 1.7.1 with chain identifier 31337. The backend used SQLAlchemy/psycopg over TCP, the database schema was at Alembic revision 20260801_0005, and local receipt-file writing was disabled during the primary performance measurements.
The benchmark used five workload sizes (10, 50, 100, 500, and 1000 receipts), ten measured repetitions per workload, seeds 42–51, and one warm-up run per workload. The 50 measured workload-seed combinations were randomized with orchestration seed 20260801. PostgreSQL benchmark tables were cleared before every warm-up and measured run, and contract deployment and environment preparation were excluded from per-run measurements. Local Anvil used automatic mining; its timings quantify the controlled local execution path and are not estimates of public-network confirmation latency.
This design quantifies within-environment variability rather than cross-hardware generalization. Synthetic generation, dataset export, count reconciliation, and figure creation are recorded separately and excluded from the primary receipt-pipeline latency. The use of synthetic sessions, a single hardware platform, local database and blockchain services, and automatic local mining remains a limitation of the evaluation.
6.2. Workload Design
The workload is generated using the deterministic synthetic EV charging session generator included in the prototype. Each session contains identifiers, timestamps, ordered meter values, pricing components, energy and settlement fields, and one of the supported session types. For the repeated benchmark, each seed defines an independent deterministic workload for every evaluated size, while unique run identifiers isolate database records, anchors, exports, and metrics.
The evaluated workload sizes are 10, 50, 100, 500, and 1000 sessions. Ten seeds are used for each size, producing 50 measured runs after five warm-ups. The measured execution order is randomized rather than processing all small workloads before all large workloads. No outliers are removed.
Every measured run must pass exact identifier-set reconciliation across requested, generated, persisted, day-eligible, anchored, verified, and exported receipts. It must also pass canonical receipt validation, batch-profile, context, count, ordering, leaf-hash, tree-root, and final-root checks, together with successful local on-chain root and receipt-count comparison. A failed correctness gate stops aggregation rather than being silently discarded or replaced.
6.3. Experiment Workflow
Each repeated run follows two phases. The deterministic synthetic sessions are generated first and timed separately. The pre-generated sessions are then processed through receipt construction, canonical hashing, validation, and actual per-receipt PostgreSQL persistence. The primary receipt-pipeline latency begins after synthetic generation and excludes export, chart generation, and count reconciliation.
Stage-separated instrumentation uses perf_counter_ns and records integer nanosecond observations. Receipt construction is divided into meter normalization, leaf encoding, meter-stream Merkle construction, energy and pricing assembly, schema validation, canonical hashing, receipt validation, database persistence, and inclusive receipt-pipeline time. Batch anchoring separately records eligibility querying, context and leaf preparation, batch-Merkle construction, anchor persistence, and the inclusive anchoring operation. Batch verification separately records membership loading, root recomputation, current-state audit, result persistence, and inclusive verification time.
Blockchain instrumentation records the cast send command, transaction-receipt query, database update, and on-chain read verification as separate local stages. Each run also exports raw receipt-, batch-, and blockchain-stage observations, run-level metrics, environment metadata, execution order, summary tables, figures, and a provenance manifest. These artifacts support inspection and repetition of the complete benchmark [31].
6.4. Evaluation Questions
The experiments are organized around six evaluation questions:
- EQ1: Receipt finalization performance. How much time is required to generate deterministic Proof-of-Charge receipts, compute receipt hashes, and persist the finalized records?
- EQ2: Batch verification correctness. Can the platform recompute the batch Merkle root and confirm that it matches the stored batch anchor?
- EQ3: Blockchain anchoring overhead. What transaction-level metrics are observed when a batch root is published to the local blockchain anchor contract, and how does the effective anchoring overhead change as more sessions are covered by the same batch?
- EQ4: Controlled tamper evidence. Can the layered verification workflow detect controlled post-finalization modifications to receipt JSON, normalized meter rows, normalized receipt columns, batch memberships, stored batch roots, and on-chain comparison inputs?
- EQ5: V2G-ready representation. Can the receipt scheme represent charge-only, discharge-only, and bidirectional sessions using import, export, and net-energy fields?
- EQ6: Reproducibility and export completeness. Does the experimental workflow produce structured datasets, summary metrics, figures, and manifest files that support inspection, repetition, and comparison across workload configurations?
6.5. Receipt Finalization Metrics
Primary receipt performance is evaluated from the receipt_pipeline_total stage, which includes receipt construction, canonical hashing, validation, and PostgreSQL persistence but excludes synthetic generation, exports, figures, and count reconciliation. For every workload, the evaluation retains all ten measured run-level means and reports the arithmetic mean, sample standard deviation, minimum, maximum, and a two-sided 95% confidence interval based on Student’s t distribution with nine degrees of freedom.
Pooled per-receipt p50, p95, and p99 values are reported using linear interpolation on the rank (n-1)q. These percentiles describe the observed latency distribution and are not treated as independent-run confidence intervals. Receipt throughput is calculated as the reconciled receipt count divided by the summed receipt-pipeline duration for the run.
Receipt construction, meter-stream Merkle processing, canonical hashing, validation, and database persistence are also reported separately. Inclusive parent stages are not added to their child stages. The historical t_finalize_total and t_finalize_avg fields remain available for backward compatibility, but they are not interpreted as stage-separated measurements.
6.6. Batch Anchoring and Verification Metrics
Batch evaluation records the profile, context, receipt count, temporal ordering, leaf hashes, tree root, final batch root, and current membership-snapshot audit. New batches use poc-batch-merkle-v1, while historical anchors remain under legacy-hash-sort-v0. Batch verification succeeds only when the recognized profile, context, count, ordering, leaf hashes, tree root, and final root are mutually consistent.
Membership-proof evaluation records proof generation and verification outcomes, tree depth, number of sibling hashes, serialized proof size, and diagnostic generation and verification time. Modified proofs must fail, and a late receipt inserted after closure must be reported by the membership audit without retroactively changing the historical cryptographic root.
The batch and proof metrics assess integrity of the recorded snapshot and verifiability of individual membership. Experimental set completeness is evaluated separately through exact reconciliation of requested, generated, persisted, eligible, anchored, verified, and exported identifiers.
6.7. Blockchain Anchoring Metrics
When blockchain publishing is enabled, the platform publishes the Merkle batch root to a local Anvil blockchain contract. The purpose is not to evaluate production deployment cost but to validate the complete off-chain/on-chain anchoring flow and collect transaction-level metrics under controlled conditions.
The recorded metrics include transaction hash, chain identifier, block number, gas used, effective gas price, transaction fee, transaction status, on-chain receipt count, and whether the on-chain root matches the locally stored batch root. Gas used denotes the number of gas units consumed during execution of the batch-anchoring transaction. Effective gas price denotes the actual price charged per gas unit and is expressed in wei per gas unit (wei/gas). On networks using Ethereum Improvement Proposal 1559 (EIP-1559)-style fee accounting, it reflects the effective combination of the network base fee and transaction priority fee, subject to the transaction fee limits. The final transaction fee is calculated as gas used multiplied by the effective gas price and is expressed in wei [32]. Blockchain verification is successful when
where () is the batch root stored in the off-chain database and () is the root retrieved from the blockchain anchor contract. This confirms that the on-chain commitment corresponds to the locally generated batch anchor.
The evaluation also considers effective anchoring cost per covered session. Since the platform anchors one Merkle batch root instead of publishing individual receipts on-chain, the effective cost per session can be estimated as
where () is the transaction fee for publishing one batch root and () is the number of receipts included in that batch. This metric captures the expected benefit of batch anchoring: as more receipts are grouped into the same batch, the effective on-chain cost per covered session decreases [8,32].
6.8. Controlled Tamper-Evidence Metrics
The controlled tamper-evidence experiment evaluates seven isolated post-finalization inconsistencies: modification of receipt content, modification or deletion of a normalized meter sample, modification of a normalized receipt column, removal of a recorded batch membership, replacement of the stored batch root, and comparison with an incorrect blockchain root. The objective is to determine which verification layer detects each changed object rather than to compute a general attack-detection probability.
Before every scenario, the runner verifies a clean PostgreSQL-backed baseline across five layers: receipt-hash verification, independent meter-stream reconstruction from meter_values, database audit, batch membership and root verification, and on-chain comparison. Each mutation is executed inside a database savepoint. After the checks are recorded, the savepoint is rolled back and the complete baseline is verified again. The recorded metrics include the layer status, expected and computed hashes or roots, meter-sample count, expected and actual detecting layers, mutation application, restoration success, and baseline validity before and after the scenario.
A scenario meets the predefined behavior only when every expected detecting layer reports a mismatch, unaffected layers remain consistent, no required check fails unexpectedly, and restoration succeeds. The runner exports JSON, CSV, Markdown, summary, and manifest artifacts. The incorrect-chain-root scenario uses the blockchain verifier’s dependency-injected reader to exercise the same root-and-count comparison logic without deliberately corrupting a real Anvil transaction.
6.9. V2G-Ready Session Evaluation
The prototype supports charge-only, discharge-only, and bidirectional session types. The V2G-ready evaluation checks whether these sessions can be represented consistently using imported energy, exported energy, net energy, gross import cost, gross export credit, and final net amount. This is important because future EV charging systems may require bidirectional energy accounting and settlement [9,10,11].
The following invariants must hold:
and
A run is considered valid when the generated receipts satisfy these invariants and the verification process confirms consistency between session data, receipt data, and stored fields.
6.10. Dataset and Export Metrics
After each experiment run, the prototype exports research-ready datasets, including receipts, sessions, meter values, anchors, and verifications. The evaluation records the number of rows exported in each dataset. These counts help confirm that the exported artifacts correspond to the generated sessions, meter values, anchors, and verification records.
The prototype also stores summary metrics, manifest files, and generated figures. These artifacts describe the experimental configuration, workload size, session-type distribution, receipt finalization results, anchoring outputs, verification status, and dataset counts. Together, the exported datasets and metadata support inspection, repetition, and comparison of the Proof-of-Charge pipeline across different workload configurations [31].
6.11. Summary of Evaluation Metrics
Table 6 summarizes the revised evaluation metrics. The performance analysis now distinguishes independent run-level statistics from pooled per-receipt percentiles, separates processing stages, and requires exact count and identifier reconciliation before any run is included in the aggregate results.
Table 6.
Revised experimental evaluation metrics.
7. Results and Evaluation
7.1. Overview of the Evaluation
This section presents the evaluation results of the proposed Proof-of-Charge prototype under controlled experimental conditions. The goal is to examine whether the implemented platform can generate deterministic EV charging receipts, group them into verifiable Merkle batches, anchor compact commitments on a local blockchain, detect modified records, and produce reproducible research artifacts.
The evaluation uses synthetic EV charging sessions with different workload sizes and session types. Each experiment follows the same local pipeline: synthetic session generation, canonical receipt construction, receipt hashing, Merkle batch formation, optional blockchain anchoring, verification, dataset export, and figure generation. This repeatable workflow supports inspection and comparison of results across experimental configurations [31].
The blockchain component is used as an external integrity checkpoint. Detailed charging sessions, receipts, meter values, and batch memberships remain in the backend database, while only the Merkle batch root is published to the local blockchain. This design allows the experiment to test the off-chain/on-chain verification model without storing complete charging records on-chain [6,7,16,17].
The evaluation also includes charge-only, discharge-only, and bidirectional session structures. Imported energy, exported energy, and net energy are represented explicitly so that the same receipt and verification model can be tested for V2G-ready accounting scenarios [9,19]. In this paper, V2G support is treated as a data-model extension rather than a live bidirectional charging deployment.
The results are organized around four aspects. First, the generated workloads are described in terms of session types and energy values. Second, the Proof-of-Charge pipeline is evaluated through receipt generation, batch construction, verification behavior, and storage-related indicators. Third, blockchain anchoring is analyzed using transaction-level metrics and root-matching checks between the database and the on-chain commitment. Finally, tamper evidence is evaluated through controlled modification scenarios, where stored records are intentionally changed and then rechecked through hash and audit verification.
The objective is not to claim a production-ready EV charging deployment. Instead, the evaluation validates the proposed verification model in a local, reproducible, and measurable prototype environment.
7.2. Analysis of Generated Experimental Data
The experimental evaluation uses synthetic EV charging session data. Synthetic data were selected because they allow the workload size, session type, meter values, pricing fields, and settlement values to be controlled and repeated across runs. This is useful for evaluating the complete Proof-of-Charge pipeline under stable conditions, especially when real-world EV charging datasets may be incomplete, commercially restricted, inconsistent, or affected by privacy constraints [31].
Each generated session represents an interaction between an EV user, a charging station, and the backend system. The session data include the fields required for receipt generation, such as session identifiers, user identifiers, EVSE identifiers, transaction identifiers, timestamps, ordered meter values, pricing information, and settlement-related values. These records are then processed by the platform to generate deterministic receipts and cryptographic commitments.
The generated dataset includes three session types: charge-only, discharge-only, and bidirectional sessions. Charge-only sessions represent the conventional case, where energy flows from the charging infrastructure to the EV. Discharge-only sessions represent cases where energy is exported from the EV back to the infrastructure. Bidirectional sessions include both imported and exported energy values within the same session. These session types allow the same verification model to be tested on conventional charging records and V2G-ready receipt structures [9,11,19].
The purpose of including discharge-only and bidirectional sessions is limited to testing the flexibility of the receipt and verification model. The evaluation does not model a complete V2G market, battery degradation, aggregator behavior, or grid-level optimization.
7.2.1. Charging Session Distribution
The first part of the analysis examines how the generated sessions are distributed across the three supported session types. This distribution is useful because the verification mechanism must handle both standard charge-only records and records that include exported or bidirectional energy values.
The experiments use different workload sizes, allowing the system behavior to be observed as the number of finalized sessions increases. For each workload, the number of charge-only, discharge-only, and bidirectional sessions is recorded. This provides context for interpreting the subsequent performance, anchoring, and verification results.
From a verification perspective, the same cryptographic process is applied to all session types. Each receipt is generated deterministically, hashed, included in a Merkle batch, and verified through the corresponding batch root. Bidirectional sessions add more data fields, but they do not change the basic verification principle. The Merkle-based commitment depends on the final receipt hash, regardless of the internal complexity of the receipt [8].
7.2.2. Import, Export, and Net Energy Analysis
The energy analysis focuses on the relationship between imported energy, exported energy, and net energy. These values are represented explicitly because a single energy value is not sufficient for bidirectional charging scenarios.
For charge-only sessions, exported energy is zero and the net energy equals the imported energy:
For discharge-only and bidirectional sessions, the general relationship is
This relationship is used as a consistency rule during receipt construction and validation. If one of these fields is modified without preserving the expected relationship, the inconsistency can be detected during verification or audit.
Figure 3 presents the average imported, exported, and net energy values for the generated charge-only, discharge-only, bidirectional, and mixed session groups. The results confirm that the receipt model can represent different energy-flow patterns: charge-only sessions contain only imported energy, discharge-only sessions contain only exported energy and therefore produce negative net energy, while bidirectional sessions include both imported and exported energy values.
Figure 3.
Average import, export, and net energy across generated session types.
The explicit representation of import, export, and net energy also supports settlement verification. The system can distinguish between the cost of imported energy and the credit associated with exported energy, which is relevant for future V2G-ready scenarios where exported energy may be compensated differently from consumed energy [9,19].
Overall, the generated dataset provides a suitable basis for evaluating both conventional EV charging receipt verification and extended bidirectional energy record verification. The following subsections analyze the performance of the Proof-of-Charge pipeline, blockchain anchoring results, and tamper-detection behavior.
7.3. Performance Evaluation of the Proof-of-Charge Pipeline
The performance evaluation uses stage-separated measurements rather than treating the earlier inclusive finalization timer as receipt-construction latency. Synthetic generation is timed independently; the primary receipt pipeline includes deterministic receipt construction, canonical hashing, validation, and actual per-receipt PostgreSQL persistence. Meter-stream Merkle construction, batch commitment, batch verification, and local blockchain operations are retained as separate stages.
The benchmark evaluated 10, 50, 100, 500, and 1000 mixed receipts. For each workload, ten measured runs used seeds 42–51 after one warm-up. The 50 measured runs were randomized, PostgreSQL was reset before every run, and local receipt-file output was disabled. All runs were executed in the single environment described in Section 6.1; therefore, the resulting confidence intervals quantify within-environment variation.
Every measured run passed exact identifier reconciliation across requested, generated, persisted, day-eligible, anchored, verified, and exported receipts. All canonical receipt checks, batch profile and root checks, on-chain roots, on-chain receipt counts, and transaction statuses also passed. Table 7 reports the primary receipt-pipeline results.
Table 7.
Repeated mixed-workload receipt-pipeline results (10 measured runs per workload).
Mean receipt-pipeline latency remained between 7.152 and 7.853 ms per receipt across the five workload sizes. The narrowest observed 95% interval was 7.616–8.090 ms for the 1000-receipt workload, while the 50-receipt workload showed the largest run-to-run standard deviation, 0.793 ms. Mean throughput ranged from 127.54 to 141.23 receipts/s.
The pooled per-receipt percentiles reveal more about tail behavior than a single average. Median latency ranged from 6.693 to 7.704 ms. The p95 values ranged from 9.420 to 12.033 ms, and the p99 values increased from 11.032 ms at 10 receipts to 15.076 ms at 1000 receipts. No observations were removed as outliers.
Exact identifier reconciliation passed in every repeated run. For each workload, the requested, generated, persisted, day-eligible, anchored, verified, and exported receipt sets were identical. The 1000-receipt workloads therefore contained 1000 receipts at every evaluated stage, and all batch roots and on-chain comparisons matched.
Figure 4 shows that the run-level mean remains relatively stable across workload sizes. The intervals overlap substantially, so the local benchmark does not support a claim that one workload size is intrinsically faster than another. It supports the narrower observation that per-receipt pipeline latency remained within a similar range under the tested conditions.
Figure 4.
Mean receipt-pipeline latency with 95% confidence intervals.
Throughput is calculated only from the reconciled receipt count and receipt-pipeline duration. Synthetic generation, dataset export, count reconciliation, and figure generation are excluded.
Figure 5 shows the mean throughput between approximately 128 and 141 receipts/s. The 1000-receipt workload had the lowest mean throughput in the repeated set, while the 50-receipt workload had the highest mean. These values describe the current per-receipt persistence design and are not universal capacity limits.
Figure 5.
Mean receipt throughput with 95% confidence intervals.
Table 8 separates the main processing stages. Receipt construction and meter-stream Merkle computation remained sub-millisecond per receipt, whereas PostgreSQL persistence accounted for most of the receipt-pipeline time. Batch-Merkle construction and verification are reported per batch rather than per receipt.
Table 8.
Stage-separated mean latency under the repeated mixed-workload benchmark.
The blockchain stages are also shown separately. The send-command, transaction-receipt query, and read-verification values describe the installed cast/Anvil execution path with automatic local mining. They are not public-network submission, inclusion, or finality measurements.
For clarity, the earlier single-run comparison by session-generation mode was removed from the main performance table. Charge-only, discharge-only, bidirectional, and mixed records continue to use the same canonical receipt and verification workflow, as described in Section 7.2 and Section 7.6.
At 1000 receipts, mean receipt construction was 0.180 ms per receipt, meter-stream Merkle construction was 0.025 ms per receipt, and database persistence was 7.156 ms per receipt. Batch-Merkle construction required 11.684 ms per batch and complete batch verification, including current-state audit, required 189.122 ms per batch. The local chain stages remained nearly independent of receipt count because one fixed-size root and one receipt count were published per batch.
Database persistence is therefore the dominant component of the current receipt pipeline. This result reflects the implemented per-receipt transaction path, including session and receipt records and ordered meter-value rows. The benchmark did not replace this path with bulk insertion merely to improve the reported values.
Figure 6 highlights the difference between median and tail latency. The p50 remained comparatively stable, while p95 and p99 increased at the larger workloads. The raw per-receipt observations and run-level metrics are preserved in the committed benchmark artifacts.
Figure 6.
Pooled p50, p95, and p99 receipt-pipeline latency.
A focused membership-proof validation complements the throughput results. In a five-receipt PostgreSQL batch, all five proofs were generated and verified, an altered proof was rejected, and a late sixth receipt was detected without changing the historical root. For a deterministic 1000-leaf sample, the tree depth and sibling count were both 10, the compact JSON proof was 2064 bytes, proof generation required approximately 0.060 ms, and verification required approximately 0.057 ms. These timings are diagnostic measurements from the same local environment, not general proof-performance guarantees.
7.4. Blockchain Anchoring Results
This section evaluates the blockchain anchoring component of the Proof-of-Charge prototype. The goal of this component is to publish a compact cryptographic commitment for a batch of off-chain receipts. Instead of storing complete EV charging records on-chain, the platform stores only the Merkle batch root. This preserves the possibility of later verification while avoiding unnecessary on-chain data storage.
For each experimental run, the prototype computed a Merkle batch root from the generated receipt hashes and published it to a local blockchain environment through a smart contract. After publication, the system compared the batch root stored in the backend database with the root retrieved from the blockchain. This comparison is represented by the chain_root_match metric.
The blockchain does not replace the backend database in the proposed architecture. It acts as an external tamper-evident reference point for off-chain records, following the general use of blockchain as a verifiable commitment layer [6,7,16,17]. Table 9 presents the blockchain anchoring results for the mixed session workloads.
Table 9.
Blockchain anchoring results for mixed session workloads.
The on-chain verification was successful for all mixed workload sizes. In each case, the root stored in the backend database matched the root retrieved from the local blockchain. This confirms that the published batch root can serve as an external integrity reference for the corresponding off-chain receipts.
A key observation is that gas usage remains almost constant as the workload increases. For the mixed workload, gas usage changed only slightly, from 143,329 gas units for 10 sessions to 143,365 gas units for 1000 sessions. This behavior is expected because the smart contract stores one fixed-size batch root per run, regardless of how many receipts are included in the batch. The on-chain operation therefore depends mainly on the stored commitment, not on the number or internal structure of the off-chain receipts.
This has a practical scalability implication. Although the off-chain workload grows with the number of charging sessions, the blockchain anchoring operation remains compact. The effective anchoring cost per covered session can be expressed as
where () denotes the transaction fee required to anchor one batch root and () denotes the number of receipts included in the batch. As more receipts are grouped into the same batch, the effective on-chain cost per covered session decreases. This supports the use of Merkle-based batching for auditable EV charging receipts [8].
Figure 7 illustrates the gas units consumed to anchor one batch root for different workload sizes. The nearly constant gas consumption shows the benefit of anchoring a batch commitment instead of anchoring each receipt separately. If each receipt were published individually, the number of blockchain transactions would increase with the number of sessions. In the proposed design, one root represents the full batch.
Figure 7.
Gas units consumed by one batch-anchoring transaction per experimental run.
The transaction fee values in Table 9 are expressed in wei, while gas consumption is reported in gas units and the effective gas price in wei/gas. Since the experiments were executed in a local blockchain environment, these values should not be interpreted as real public network costs. They are useful for comparing the relative behavior of the anchoring transaction under reproducible conditions, but they do not represent production deployment costs.
Table 10 compares the blockchain anchoring behavior for the largest workload size across the four session generation modes.
Table 10.
Blockchain anchoring comparison for 1000-session workloads.
Blockchain anchoring was successful for all session modes. Gas usage remained within a narrow range, between 143,365 and 143,497 gas units. This indicates that the complexity of the off-chain receipt structure does not significantly affect the on-chain anchoring operation. Whether the batch contains charge-only, discharge-only, bidirectional, or mixed receipts, the smart contract receives and stores only the resulting batch root.
This result is important because it separates off-chain data richness from on-chain storage cost. Detailed receipt fields, including import energy, export energy, net energy, pricing, and settlement values, remain in the backend database. The blockchain stores only the cryptographic commitment representing the batch.
Overall, the blockchain anchoring results show that the prototype can publish and verify Merkle batch roots in a local blockchain environment. The results also confirm that batch anchoring is a compact way to connect off-chain EV charging receipts with an external verification layer.
7.5. Tamper-Evidence Evaluation
The tamper-evidence evaluation assessed the response of the layered verification workflow to seven controlled changes introduced after receipt or batch finalization. The scenarios target different integrity surfaces so that the contribution of each verification layer can be observed separately.
The PostgreSQL-backed evaluation covers modification of a receipt energy field, modification of a normalized import meter value, deletion of one normalized meter-value row, modification of the normalized receipt Merkle-root column, removal of one recorded batch membership, replacement of the stored batch root, and comparison with an alternative external blockchain root. Each scenario starts from a valid baseline and is executed inside a database savepoint, allowing the stored state to be restored before the next scenario.
The expected detection path follows the data committed by each layer. Receipt-content changes affect the canonical receipt hash and the database audit. Meter-value modification or deletion affects independent meter-root reconstruction and the audit result. A change limited to a normalized receipt column is detected by the database audit, while membership and stored-root changes affect batch verification. An inconsistent external root is detected by the blockchain comparison.
All seven scenarios produced the corresponding layer-specific mismatches. T1 caused receipt-hash and database-audit mismatches. T2 and T3 caused meter-stream and audit mismatches while the stored receipt hash remained valid. T4 was identified by the database audit. T5 caused batch-root and membership-count mismatches. T6 affected both batch verification and blockchain comparison. T7 left the local receipt, meter, audit, and batch checks valid while the external-root comparison reported a mismatch.
All seven scenarios were completed independently, and the database state was restored after each controlled change. This isolation prevented one scenario from influencing the outcome of another. For T7, an alternative external root was supplied directly to the blockchain-verification component, isolating the comparison behavior from the locally stored batch commitment.
Table 11 summarizes the recorded outcomes for the seven scenarios. Together, the results show that the verification layers cover complementary post-finalization integrity surfaces rather than duplicating the same check.
Table 11.
Experimentally recorded layer-specific results for the seven controlled tamper scenarios.
In Table 11, “Pass” means that the layer remained consistent, while “Mismatch” means that the controlled inconsistency was detected at that layer. T7 used the blockchain verifier’s dependency-injected reader; no real Anvil transaction was deliberately corrupted. Every scenario met its predefined behavior and the original database state was restored successfully.
The results demonstrate the complementary scope of the layers. Receipt hashing protects the stored canonical receipt, meter-root recomputation protects the normalized ordered sample sequence, the audit layer compares session reconstruction, JSON, normalized receipt columns, and normalized meter rows; batch verification protects the recorded membership snapshot; and the on-chain comparison checks consistency between the local anchor and the externally supplied commitment.
The tested scenarios represent modified receipt content, meter-stream alteration or omission, disagreement between JSON and normalized columns, changed membership, a replaced local anchor, and an incorrect on-chain reference. In operational systems, related inconsistencies may arise from unauthorized backend changes, partial database updates, software or schema-migration defects, meter reset, clock drift, duplicate or missing samples, incorrect unit or direction mapping, tariff-version mismatch, use of an incorrect network or contract, or key compromise. Fabrication or omission before the first trusted commitment remains outside the detection guarantee.
When an inconsistency is detected, the current prototype records and reports the failure while preserving the original anchored commitment; it does not automatically repair the data. In a real deployment, the affected receipt should be quarantined from billing or settlement, reconstructed from trusted session and meter records, and verified again. If reconciliation succeeds, a corrected receipt version should be generated and included in a new batch anchor without replacing the original commitment. Unresolved cases should be escalated to the charging operator, roaming provider, or an independent auditor.
Overall, the expanded evaluation confirms that layered recomputation can localize several classes of inconsistency while detailed data remain off-chain. Receipt hashing, meter-stream reconstruction, database audit, batch verification, and on-chain comparison operate as complementary checks over the same receipt lifecycle.
7.6. Discussion of Findings
The experimental results show that the architecture can generate deterministic receipts, preserve ordered meter commitments, anchor recorded batches, verify individual membership, and compare current off-chain records with earlier commitments under controlled conditions. Together, these mechanisms create a coherent audit trail from session data to the external batch anchor.
Across the 50 measured runs, mean receipt-pipeline latency remained between 7.152 and 7.853 ms per receipt, while throughput ranged from 127.54 to 141.23 receipts/s. Receipt construction and meter-stream Merkle processing contributed only a small share of total latency compared with per-receipt PostgreSQL persistence. The p95 and p99 values increased at larger workloads, indicating greater tail latency even though the run-level mean remained relatively stable.
The blockchain anchoring results support the use of Merkle batch commitments. Instead of publishing each receipt separately, the system publishes one batch root for a group of receipts. This keeps the on-chain payload compact and explains why gas usage remains nearly constant across workload sizes. The effective anchoring cost per covered session therefore decreases as more receipts are included in the same batch. This finding supports the suitability of Merkle-based aggregation for scalable EV charging record verification.
The evaluation also shows that V2G-ready fields can be included without changing the core verification workflow. Charge-only, discharge-only, bidirectional, and mixed workloads are all processed using the same receipt construction, hashing, batching, and anchoring mechanisms. This indicates that import, export, and net-energy values can be treated as extensions of the receipt schema, rather than as a separate verification model.
The tamper-evidence evaluation demonstrated the role of layered verification across seven controlled scenarios. Modifications to receipt content, normalized meter values, database audit fields, batch membership, stored batch roots, and the external anchor were detected by the verification layer responsible for the affected data. After each scenario, the modified records were restored and the baseline checks were repeated successfully. Changes to off-chain records did not alter previously recorded blockchain anchors, while the corresponding local consistency checks identified the affected data.
The local blockchain environment supported reproducible evaluation of transaction submission, gas consumption, batch-root anchoring, and subsequent root verification. In the proposed architecture, blockchain provides an external commitment point for finalized batch roots. Other mechanisms, including digital signatures, trusted timestamps, secure key management, access control, and operational availability measures, can complement this commitment layer in production deployments.
The experimental workflow records raw timing observations in nanoseconds and evaluates each workload using ten deterministic seeds and a randomized execution order. Database state is reset between runs, and correctness checks are applied before a run is included in the statistical analysis. Mean values, sample standard deviations, Student’s -based 95% confidence intervals, and pooled latency percentiles are reported together with hardware and software environment information. Canonicalization and batch-Merkle behavior are also validated using cross-language test vectors, membership proofs, and reproducible validation artifacts.
The evaluation has several limitations. The charging sessions are synthetically generated rather than collected from operational OCPP or OCPI deployments. The repeated benchmark was conducted on one Apple M1 Max environment, so the reported confidence intervals describe variability within that environment rather than performance across different platforms. Cross-language canonicalization was evaluated using Python and JavaScript implementations, but not every possible programming language or serializer. The local Anvil network uses automatic block production and does not represent public-network congestion, censorship, reorganizations, or confirmation delays. The current platform also does not implement meter-level digital signatures, issuer certificate validation, trusted timestamps, key lifecycle management, privacy-preserving disclosure, or reconciliation against an external authoritative session registry. Consequently, a charging event that is never submitted to the platform cannot be detected through the Merkle commitment alone.
Overall, the results demonstrate a reproducible platform for auditable EV-charging receipts. The contribution combines deterministic receipt construction, ordered meter-stream commitments, versioned batch commitments with membership proofs, exact dataset reconciliation, layered verification, and blockchain-based batch anchoring within a single implemented workflow.
8. Conclusions and Future Work
This paper presented a blockchain-anchored Proof-of-Charge platform for generating, anchoring, and verifying auditable EV-charging receipts. The approach combines off-chain storage, deterministic receipt generation, cryptographic hashing, ordered meter commitments, Merkle batch proofs, and blockchain anchoring within one reproducible workflow.
The implemented prototype transforms structured charging-session input into profile-governed canonical receipts and temporally ordered batch commitments. Python and JavaScript produced identical canonical bytes and SHA-256 output for the committed conformance vector. The versioned batch profile binds context and receipt count, rejects duplicate memberships, supports standalone membership proofs, and distinguishes historical snapshot validity from later changes in the current eligible dataset.
The expanded tamper-evidence evaluation executed seven controlled modifications affecting receipt content, normalized meter samples, normalized receipt columns, membership records, local anchors, and an external-root comparison. All seven scenarios met their predefined layer-specific behavior and the original state was restored after every test. The results confirm the complementary role of receipt, meter, audit, batch, and on-chain verification layers.
The prototype also includes V2G-ready receipt fields by explicitly representing imported energy, exported energy, and net energy. This shows that the same verification model can support charge-only, discharge-only, and bidirectional session records without changing the core architecture. In this work, however, V2G is treated as an extension of the receipt model, not as a complete market or grid-optimization framework.
Future evaluation should use real-world EV charging datasets and operational OCPP- or OCPI-based systems, repeat the measurements on additional hardware and database deployments, and extend canonicalization conformance testing to more independent languages and implementations. Production-oriented research should also integrate meter and CPO/eMSP digital signatures, certificate-chain validation, trusted timestamps, secure key custody, rotation and revocation, privacy-preserving disclosure, and reconciliation against an authoritative session register.
Migration from Anvil will follow a staged path through Ethereum and EVM-compatible public test networks. The publisher should use asynchronous submission and receipt polling, configurable confirmation thresholds, timeout and replacement policies, and separate measurements of submission, inclusion, and finality. Public-network studies should compare static and adaptive batching, fee variability, failure rates, Layer-1 and Layer-2 behavior, and cost per covered receipt without treating local automatic-mining results as public-network latency [32,33,34,35,36].
Additional work should evaluate privacy-preserving disclosure, role-based access, archival storage, contract governance and independent audit, transparency-log and WORM baselines, and operational handling of corrected or late receipts. The current membership audit already reports late, missing, hash-modified, and timestamp-modified records, providing a foundation for future reconciliation workflows.
Future research may also examine how verifiable operational records can support other new-energy transport systems, including fuel-cell buses. Recent work on predictive energy management for fuel-cell buses illustrates the growing role of data-driven coordination across alternative propulsion platforms [37].
The results indicate that the platform provides a feasible and reproducible foundation for auditable EV-charging receipts and V2G-ready settlement records. Across all 50 measured runs, exact count reconciliation, batch verification, and local on-chain comparison succeeded.
Author Contributions
Conceptualization, N.S.-R.; methodology, N.S.-R., E.R. and V.R.; software, N.S.-R. and E.R.; validation, N.S.-R., E.R., V.A. and F.I.; formal analysis, N.S.-R. and E.R.; investigation, N.S.-R., E.R. and F.I.; resources, N.S.-R., V.A. and F.I.; data curation, N.S.-R. and E.R.; writing—original draft preparation, N.S.-R.; writing—review and editing, N.S.-R., V.A., F.I., V.R., E.R. and A.R.; visualization, N.S.-R. and E.R.; supervision, V.R. and A.R.; project administration, N.S.-R. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Data Availability Statement
The data used in this study were synthetically generated for reproducible experimental evaluation. The source code, synthetic data generation scripts, experiment workflows, generated datasets, raw timing observations, run-level metrics, statistical summaries, figures, canonicalization vectors, membership proofs, tamper-matrix outputs, and provenance manifests are publicly available in the project repository: https://github.com/ErenisR/proof-of-charge (accessed on 7 August 2026). The repository includes materials for reproducing receipt generation, canonical hashing, versioned Merkle batch anchoring, proof verification, blockchain anchoring, audit, export, and repeated performance workflows. No real EV charging user data or personally identifiable charging records were used in this study.
Conflicts of Interest
Author Erenis Ramadani is employed by the company Tarmac LLC. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| API | Application Programming Interface |
| CDR | Charge Detail Record |
| CID | Content Identifier |
| CPO | Charge Point Operator |
| CSV | Comma-Separated Values |
| DSO | Distribution System Operator |
| EIP-1559 | Ethereum Improvement Proposal 1559 |
| EMSP | E-Mobility Service Provider |
| EV | Electric Vehicle |
| EVM | Ethereum Virtual Machine |
| EVSE | Electric Vehicle Supply Equipment |
| IPFS | InterPlanetary File System |
| JSON | JavaScript Object Notation |
| OCA | Open Charge Alliance |
| OCPI | Open Charge Point Interface |
| OCPP | Open Charge Point Protocol |
| REST | Representational State Transfer |
| RPC | Remote Procedure Call |
| SHA-256 | Secure Hash Algorithm 256-bit |
| SQL | Structured Query Language |
References
- International Energy Agency. Global EV Outlook 2025; IEA: Paris, France, 2025; Available online: https://www.iea.org/reports/global-ev-outlook-2025 (accessed on 5 July 2026).
- International Energy Agency. Electric Vehicle Charging. In Global EV Outlook 2025; IEA: Paris, France, 2025; Available online: https://www.iea.org/reports/global-ev-outlook-2025/electric-vehicle-charging (accessed on 5 July 2026).
- Open Charge Alliance. Open Charge Point Protocol 2.0.1: Specification; Open Charge Alliance: Arnhem, The Netherlands, 2020; Available online: https://openchargealliance.org/introducing-the-latest-update-ocpp-2-0-1-specifications/ (accessed on 5 July 2026).
- EVRoaming Foundation. Open Charge Point Interface 2.2.1: Specification. 2021. Available online: https://evroaming.org/ocpi-downloads/ (accessed on 5 July 2026).
- Garofalaki, Z.; Kosmanos, D.; Moschoyiannis, S.; Kallergis, D.; Douligeris, C. Electric vehicle charging: A survey on the security issues and challenges of the Open Charge Point Protocol (OCPP). IEEE Commun. Surv. Tutor. 2022, 24, 1504–1533. [Google Scholar] [CrossRef] [Scilit]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. 2008. Available online: https://bitcoin.org/bitcoin.pdf (accessed on 5 July 2026).
- Buterin, V. Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform. 2014. Available online: https://ethereum.org/content/whitepaper/whitepaper-pdf/Ethereum_Whitepaper_-_Buterin_2014.pdf (accessed on 5 July 2026).
- Merkle, R.C. A Digital Signature Based on a Conventional Encryption Function. In Advances in Cryptology—CRYPTO ’87; Pomerance, C., Ed.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1988; Volume 293, pp. 369–378. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kempton, W.; Tomić, J. Vehicle-to-grid power fundamentals: Calculating capacity and net revenue. J. Power Sources 2005, 144, 268–279. [Google Scholar] [CrossRef] [Scilit]
- Shuai, W.; Maillé, P.; Pelov, A. Charging Electric Vehicles in the Smart City: A Survey of Economy-Driven Approaches. IEEE Trans. Intell. Transp. Syst. 2016, 17, 2089–2106. [Google Scholar] [CrossRef] [Scilit]
- ISO 15118-20:2022; Road Vehicles—Vehicle to Grid Communication Interface—Part 20: 2nd Generation Network Layer and Application Layer Requirements. ISO: Geneva, Switzerland, 2022. Available online: https://www.iso.org/standard/77845.html (accessed on 5 July 2026).
- Van Aubel, P.; Poll, E. Security of EV-Charging Protocols. arXiv 2022, arXiv:2202.04631. [Google Scholar] [CrossRef] [Scilit]
- Zhou, C.; Yan, Q.; Yu, Z.; Dixit, E.; Zhang, N.; Zeng, H.; Safdari Ghanhdari, A. ChargeX: Exploring State Switching Attack on Electric Vehicle Charging Systems. arXiv 2023, arXiv:2305.08037. [Google Scholar] [CrossRef] [Scilit]
- Andoni, M.; Robu, V.; Flynn, D.; Abram, S.; Geach, D.; Jenkins, D.; McCallum, P.; Peacock, A. Blockchain Technology in the Energy Sector: A Systematic Review of Challenges and Opportunities. Renew. Sustain. Energy Rev. 2019, 100, 143–174. [Google Scholar] [CrossRef] [Scilit]
- Li, H.; Xiao, F.; Yin, L.; Wu, F. Application of Blockchain Technology in Energy Trading: A Review. Front. Energy Res. 2021, 9, 671133. [Google Scholar] [CrossRef] [Scilit]
- Yaga, D.; Mell, P.; Roby, N.; Scarfone, K. Blockchain Technology Overview; NISTIR 8202; National Institute of Standards and Technology: Gaithersburg, MD, USA, 2018. [CrossRef] [Scilit]
- Wood, G. Ethereum: A Secure Decentralised Generalised Transaction Ledger; Ethereum Project Yellow Paper. 2014. Available online: https://ethereum.github.io/yellowpaper/paper.pdf (accessed on 5 July 2026).
- Benet, J. IPFS—Content Addressed, Versioned, P2P File System. arXiv 2014, arXiv:1407.3561. [Google Scholar] [CrossRef] [Scilit]
- Sortomme, E.; El-Sharkawi, M.A. Optimal Charging Strategies for Unidirectional Vehicle-to-Grid. IEEE Trans. Smart Grid 2011, 2, 131–138. [Google Scholar] [CrossRef] [Scilit]
- Sejfuli-Ramadani, N.; Ramadani, E.; Gjorgjev, J.; Angelkoska, V.; Shemshi, V.; Risteski, A. Proof of Charge: Auditable EV-Charging Receipts with Off-Chain Hashing and On-Chain Anchors. In 2026 15th Mediterranean Conference on Embedded Computing (MECO); IEEE: Piscataway, NJ, USA, 2026. [Google Scholar] [CrossRef] [Scilit]
- Sejfuli-Ramadani, N.; Gjorgjev, J.; Angelkoska, V.; Ramadani, E.; Idrizi, F.; Risteski, A. Immutable Audit of EV Charging Sessions Using Blockchain and IPFS. In 2025 6th International Conference on Communications, Information, Electronic and Energy Systems (CIEES); IEEE: Piscataway, NJ, USA, 2025. [Google Scholar] [CrossRef] [Scilit]
- Huo, X.; Liu, M. Distributed Privacy-Preserving Electric Vehicle Charging Control Based on Secret Sharing. Electr. Power Syst. Res. 2022, 211, 108357. [Google Scholar] [CrossRef] [Scilit]
- Chen, Y.; Lei, X.; Jian, L. Addressing Trust Issues for Vehicle to Grid in Distributed Power Grids Using Blockchains. arXiv 2024, arXiv:2407.16180. [Google Scholar] [CrossRef] [Scilit]
- Brömme, A.; Yavas, T. snaproot: Decentralized File Integrity Verification Using Blockchain-Anchored Cryptographic Hashing. arXiv 2026, arXiv:2606.10625. [Google Scholar] [CrossRef] [Scilit]
- Alharby, M.; van Moorsel, A. Blockchain-Based Smart Contracts: A Systematic Mapping Study. arXiv 2017, arXiv:1710.06372. [Google Scholar] [CrossRef] [Scilit]
- Hu, Y.; Liyanage, M.; Mansoor, A.; Thilakarathna, K.; Jourjon, G.; Seneviratne, A. Blockchain-Based Smart Contracts—Applications and Challenges. arXiv 2018, arXiv:1810.04699. [Google Scholar] [CrossRef] [Scilit]
- Ramírez, S. FastAPI Documentation. Available online: https://fastapi.tiangolo.com/ (accessed on 5 July 2026).
- PostgreSQL Global Development Group. PostgreSQL Documentation. Available online: https://www.postgresql.org/docs/ (accessed on 5 July 2026).
- Bayer, M. SQLAlchemy Documentation. Available online: https://docs.sqlalchemy.org/ (accessed on 5 July 2026).
- Bayer, M. Alembic Documentation. Available online: https://alembic.sqlalchemy.org/en/latest/ (accessed on 1 August 2026).
- Antunes, B.A.; Hill, D.R.C. Reproducibility, Replicability and Repeatability: A Survey of Reproducible Research with a Focus on High Performance Computing. Comput. Sci. Rev. 2024, 53, 100655. [Google Scholar] [CrossRef] [Scilit]
- Ethereum Foundation. Networks. Available online: https://ethereum.org/developers/docs/networks/ (accessed on 24 July 2026).
- Ethereum Foundation. Gas and Fees. Available online: https://ethereum.org/developers/docs/gas/ (accessed on 24 July 2026).
- Optimism Collective. Connecting to OP Mainnet and OP Sepolia. Available online: https://docs.optimism.io/op-mainnet/network-information/connecting-to-op (accessed on 24 July 2026).
- Offchain Labs. Arbitrum Documentation. Available online: https://docs.arbitrum.io/ (accessed on 24 July 2026).
- Polygon Labs. Building on Polygon PoS. Available online: https://docs.polygon.technology/pos/get-started/building-on-polygon/ (accessed on 24 July 2026).
- Jia, C.; He, H.; Zhou, J.; Li, J.; Wei, Z.; Li, K.; Li, M. A Novel Deep Reinforcement Learning-Based Predictive Energy Management for Fuel Cell Buses Integrating Speed and Passenger Prediction. Int. J. Hydrogen Energy 2025, 100, 456–465. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.






