Skip to content

Add CIP-172: Canonical Transaction RLP Encoding#172

Open
peilun-conflux wants to merge 4 commits into
Conflux-Chain:masterfrom
peilun-conflux:cip-canonical-tx-encoding
Open

Add CIP-172: Canonical Transaction RLP Encoding#172
peilun-conflux wants to merge 4 commits into
Conflux-Chain:masterfrom
peilun-conflux:cip-canonical-tx-encoding

Conversation

@peilun-conflux

@peilun-conflux peilun-conflux commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

This CIP specifies the consensus change implemented in conflux-rust #3561 (branch fix/typed-tx-canonical-hash).

Conflux computes a transaction's hash over the exact bytes the transaction was decoded from, while the RLP decoder also accepts non-minimal encodings, so the same transaction can appear under more than one hash. This breaks the unique-hash assumption behind transactions_root, receipts, inclusion proofs, transaction pool deduplication, and RPC — most visibly, blocks that pack a malleated transaction are rejected by other nodes over the transactions_root mismatch.

From an activation height, this CIP makes a block invalid if any transaction in its body is not canonically encoded. It also recommends that upgraded clients reject non-canonically encoded transactions at transaction pool insertion immediately, ahead of activation.

The CIP number 172 follows the PR ID, per the README's provisional-ID convention.

🤖 Generated with Claude Code


This change is Reviewable

peilun-conflux and others added 2 commits July 6, 2026 12:44
Conflux computes a transaction hash over the exact received bytes while its RLP decoder accepts non-minimal encodings, so one transaction can carry multiple hashes, breaking the unique-hash assumption behind transactions_root, receipts, inclusion proofs, deduplication, and RPC; most visibly, blocks that pack a malleated transaction are rejected by other nodes over the root mismatch.

The fix (conflux-rust #3561) rejects non-canonically encoded transactions, which tightens block validity and is therefore a spec-breaking consensus change that requires a CIP before it can merge; this drafts that CIP as a height-gated consensus rule plus an immediate node-local mempool policy.

CIP number is left "<to be assigned>" for an editor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Per the README, the PR ID serves as the CIP ID at the submitter's discretion; this PR is Conflux-Chain#172, so the file is renamed to cip-172.md and the header updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@peilun-conflux peilun-conflux changed the title Add CIP: Canonical Transaction RLP Encoding Add CIP-172: Canonical Transaction RLP Encoding Jul 6, 2026
peilun-conflux and others added 2 commits July 6, 2026 13:18
CIP-1 forbids the Discussions header from pointing to a GitHub pull request, and the header is optional for CIPs discussed within the dev team; the reference-implementation PR remains linked in the Implementation section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CIP bodies should not reference code-level identifiers; the config key name lives in the reference PR, and the spec-level parameter name suffices.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant