hiero-ledger / hiero-ledger/hiero-sdk-python

Update `Transaction.to_bytes() / from_bytes()` to support multiple node IDs and chunked transactions

Open
#2,302 8 comments 0 reactions 1 assignee Claimed by @manishdait View on GitHub
skill: advanced
Dominant language
Python
Stars
63
Forks
298
Avg merge
3d 18h
Merged PRs (30d)
38

Description

**Description**
The current implementation of `Transaction.to_bytes()` and `Transaction.from_bytes()` only properly serializes and restores a single node transaction, even when the transaction itself contains multiple node IDs internally.

As a result:

- Transactions frozen with multiple node IDs lose information after `to_bytes()`
- `from_bytes()` cannot correctly restore all node contexts

**Proposed Solution**

- [ ] Update `Transaction.to_bytes()` to serialize each transactions for node_ids using the protobuf `TransactionList` type instead of serializing only a single `Transaction`.
- [ ] Similarly, update `Transaction.from_bytes()` to parse the `TransactionList` and reconstruct all node-specific transaction bodies.

**Additional Notes**

Potential considerations for the implementation:
- [ ] Preserve backward compatibility with previously serialized single-transaction bytes if possible
- [ ] Ensure signatures remain associated with the correct node-specific body bytes
- [ ] Ensure chunked transactions continue working correctly

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.