feat(plugin): auctionlog — privacy-preserving audit trails via HCS#1471
Open
atharvalade wants to merge 3 commits intohiero-ledger:mainfrom
Open
feat(plugin): auctionlog — privacy-preserving audit trails via HCS#1471atharvalade wants to merge 3 commits intohiero-ledger:mainfrom
atharvalade wants to merge 3 commits intohiero-ledger:mainfrom
Conversation
Adds a new 'auctionlog' plugin that publishes cryptographic commitment hashes to Hedera Consensus Service (HCS) topics. This enables tamper- evident public audit trails for auction workflows without revealing any business-sensitive data like bid values, delivery terms, or identities. Commands: - publish: publish a commitment hash for an auction stage to HCS - verify: re-compute and validate stored commitment hashes - export: export the full audit timeline as JSON or CSV - list: list all tracked auctions with stage counts The commitment is SHA-256(auctionId, stage, cantonRef, adiTx, timestamp, nonce). Only the hash and stage are published publicly — the preimage fields stay local. Anyone can verify timing and ordering; nobody can reverse-engineer the business data. Includes: - Zod input/output schemas with strict validation - Handlebars templates for human-readable CLI output - State persistence under 'auctionlog-data' namespace - 14 unit tests across all 4 commands - Plugin README with usage examples and expected output Resolves hiero-ledger#1194 Signed-off-by: atharvalade <atharvalade@users.noreply.github.com>
Import and add auctionlogPluginManifest to DEFAULT_PLUGIN_STATE so the auctionlog commands are available out of the box. Part of hiero-ledger#1194 Signed-off-by: atharvalade <atharvalade@users.noreply.github.com>
23e7cb1 to
0f25103
Compare
…ering, secure nonces, and redact mode - Replace insecure Math.random() nonce with crypto.randomBytes(16) - Add two-layer verification: local SHA-256 + on-chain mirror node (api.mirror) - Enforce chronological stage ordering; reject duplicate stage publications - Allow 'disputed' at any time after auction creation - Replace Canton/ADI-specific fields with generic 'metadata' field - Add --on-chain flag to verify command (fetches HCS messages via mirror node) - Add --redact flag to export command (strips nonces/metadata for safe sharing) - Fix CSV export with proper field escaping for commas/quotes/newlines - Harden file write error handling in export (validate dir exists, catch errors) - Fix keccak256 naming inconsistency — consistently document as SHA-256 - Use shared makeArgs/makeLogger test helpers in all test files - Expand test suite from 14 to 25 tests (new: stage ordering, on-chain verify, redact mode, mirror failure graceful degradation, hash determinism) - Update Zod schemas, Handlebars templates, and README to reflect all changes - TypeScript: npx tsc --noEmit is clean; all 25 tests pass Signed-off-by: Atharva Lade <ladeatharva@gmail.com>
ea25f78 to
6e99f72
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New auctionlog plugin that publishes cryptographic commitment hashes to Hedera Consensus Service (HCS) topics, enabling tamper-evident public audit trails for auction and procurement workflows — without revealing any business-sensitive data.
Resolves #1194 (ETHDenver 2026 — Build the Best Hiero CLI Plugin)
What it does
At each critical stage of an auction (created → bidding-open → bidding-closed → awarded → settled → disputed), the plugin publishes a commitment hash to an HCS topic:
Anyone can verify the sequence and timing of events. Nobody can reverse-engineer the hash into actual bid values, delivery terms, or party identities.
Commands
hcli auctionlog publishhcli auctionlog verifyhcli auctionlog exporthcli auctionlog listExample usage
Why this is useful beyond the hackathon
The
publish → verify → exportpattern is generic enough for any workflow that needs a tamper-evident public timeline on Hedera:Architecture fit
CommandHandlerArgsinjection)api.topic.createTopic()andapi.topic.submitMessage()for HCS operationsauctionlog-datanamespace viaapi.stateCommandExecutionResultreturn type on all handlersTesting
14 unit tests across all 4 commands, using the same
makeArgs/makeLoggertest helpers from@/__tests__/mocks/mocks:All pass with
npx jest --testPathPatterns="auctionlog"andnpx tsc --noEmitis clean.Files changed
src/plugins/auctionlog/— 24 files (manifest, types, index, 4 commands with handler/input/output/index each, README, 4 test files)src/core/shared/config/cli-options.ts— 2 lines added (import + array entry)Documentation
Full plugin README at
src/plugins/auctionlog/README.mdwith: