hashgraph / hashgraph/hedera-transaction-tool

Transaction History should only be visible to those that were involved

Open
#2,007 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
18
Avg merge
1d 9h
Merged PRs (30d)
85

Description

# Implement Transaction Visibility Access Control

## Problem

Currently, transaction history is visible to all users within an organization. In large organizations, this creates privacy concerns as users can see transactions that don't involve their keys or accounts. We need to ensure users only see transactions they are actually involved in.

## Proposed Solution

Create a transaction visibility table that acts as an access control list, populated when transactions reach a final state.

### Database Schema
```sql
CREATE TABLE transaction_visibility (
transaction_id INTEGER NOT NULL REFERENCES transactions(id) ON DELETE CASCADE,
user_key_id INTEGER NOT NULL REFERENCES user_keys(id) ON DELETE CASCADE,
PRIMARY KEY (transaction_id, user_key_id),
INDEX idx_transaction_lookup (transaction_id),
INDEX idx_user_key_lookup (user_key_id)
);
```

### Implementation

When a transaction is **submitted**, **expired**, or **archived**:

1. Determine all entities involved in the transaction (accounts, nodes, files, etc.)
2. Get all public keys associated with those entities
3. Find all `user_key_id` values where users own any of those public keys
4. Insert a row into `transaction_visibility` for each `user_key_id`

This approach enables fast, indexed lookups to filter transaction history to only show transactions the user is authorized to view.

### Benefits

- Users only see transactions involving their keys
- Fast query performance using indexed lookups
- Scales well for large organizations
- Clear access control model

Contributor guide

Open the contributing guide

Research direction

Start by tracing the transaction submission, expiration, and archival paths, then locate the transactions, user_keys, and related entity models. Map how involved entities and public keys are currently resolved; done means populating transaction_visibility and filtering transaction history to authorized users with indexed lookups.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, typescript
Domain
authorization, backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.