From 78ddc8f32c9b839d512d01cad738cabc31870ded Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Sat, 10 May 2025 19:24:14 +0200 Subject: [PATCH 1/9] ERC to encode chain ID with tx hash --- ERCS/erc-encode-idhash-md | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 ERCS/erc-encode-idhash-md diff --git a/ERCS/erc-encode-idhash-md b/ERCS/erc-encode-idhash-md new file mode 100644 index 00000000000..f900dab048d --- /dev/null +++ b/ERCS/erc-encode-idhash-md @@ -0,0 +1,48 @@ +--- +title: Encode chain id with transaction hash +description: A standard for encoding a chain ID and transaction hash into a unique string format +author: Lauri Peltonen (@microbecode) +discussions-to: https://ethereum-magicians.org/t/a-new-standard-for-encoding-chain-id-transaction-hash/23782 +status: Draft +type: Standards Track +category: ERC +created: 2025-05-10 +requires: 155 +--- + +## Abstract + +This standard proposes a way to encode the combination of a chain ID and a transaction hash into one string. + +## Motivation + +Looking up a transaction by its hash always requires the context of the chain - a transaction hash alone is not enough to identify the used chain. If the chain information is included in the string itself, finding the right chain for the transaction is easy. + +Such strings can then be used, for example, in a forwarder service that forwards to the correct blockchain explorer. + +## Specification + +The encoded string has three components: +- A chain ID, denoted as `chainId`. The used chain id MUST be based on [EIP-155](./eip-155.md) and the chain ID repository stated in that EIP. +- A transaction hash, denoted as `txHash`. The hash MUST include the `0x` prefix. +- A static string `tx`, acting as a type identifier. + +The syntax is: `chainId:txHash:tx`. + +An example for a transaction with hash `0xc55e2b90168af6972193c1f86fa4d7d7b31a29c156665d15b9cd48618b5177ef` that was issued on chain ID `1` is: `1:0xc55e2b90168af6972193c1f86fa4d7d7b31a29c156665d15b9cd48618b5177ef:tx`. + +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. + +## Rationale + +The chain ID is the most important detail when routing queries based on this standard and is therefore the first element in the string. The transaction hash is the second most important element. + +The suffix `tx` is used to differentiate from, for example, addresses. Without the `tx` it would remain unclear whether an encoded string refers to an address, a transaction hash or something else. + +## Security Considerations + +Needs discussion. + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE.md). From c5af0410a767d4528c31518eeeb56bcdeffe44ab Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Sat, 10 May 2025 19:33:05 +0200 Subject: [PATCH 2/9] Fix filename --- ERCS/{erc-encode-idhash-md => erc-encode-idhash.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ERCS/{erc-encode-idhash-md => erc-encode-idhash.md} (100%) diff --git a/ERCS/erc-encode-idhash-md b/ERCS/erc-encode-idhash.md similarity index 100% rename from ERCS/erc-encode-idhash-md rename to ERCS/erc-encode-idhash.md From 779f22505addd878488b49d2d73af0a191d198e4 Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Wed, 21 May 2025 18:28:06 +0300 Subject: [PATCH 3/9] Remove EIP link since those are in different repo --- ERCS/erc-encode-idhash.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-encode-idhash.md b/ERCS/erc-encode-idhash.md index f900dab048d..ef6ea2595fb 100644 --- a/ERCS/erc-encode-idhash.md +++ b/ERCS/erc-encode-idhash.md @@ -7,7 +7,6 @@ status: Draft type: Standards Track category: ERC created: 2025-05-10 -requires: 155 --- ## Abstract @@ -23,7 +22,8 @@ Such strings can then be used, for example, in a forwarder service that forwards ## Specification The encoded string has three components: -- A chain ID, denoted as `chainId`. The used chain id MUST be based on [EIP-155](./eip-155.md) and the chain ID repository stated in that EIP. + +- A chain ID, denoted as `chainId`. The used chain id MUST be based on EIP-155 and the chain ID repository stated in that EIP. - A transaction hash, denoted as `txHash`. The hash MUST include the `0x` prefix. - A static string `tx`, acting as a type identifier. From 221dfe8ceba62455ab0bb3e838c171215618e97e Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Wed, 21 May 2025 18:30:33 +0300 Subject: [PATCH 4/9] Rename file --- ERCS/{erc-encode-idhash.md => erc-encode_idhash.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ERCS/{erc-encode-idhash.md => erc-encode_idhash.md} (100%) diff --git a/ERCS/erc-encode-idhash.md b/ERCS/erc-encode_idhash.md similarity index 100% rename from ERCS/erc-encode-idhash.md rename to ERCS/erc-encode_idhash.md From 9a51f771915b4eaebc3a69465856b040c8c75bf8 Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Thu, 22 May 2025 15:45:52 +0300 Subject: [PATCH 5/9] Add number Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com> --- ERCS/erc-encode_idhash.md | 1 + 1 file changed, 1 insertion(+) diff --git a/ERCS/erc-encode_idhash.md b/ERCS/erc-encode_idhash.md index ef6ea2595fb..9183b5046c8 100644 --- a/ERCS/erc-encode_idhash.md +++ b/ERCS/erc-encode_idhash.md @@ -1,4 +1,5 @@ --- +eip: 7950 title: Encode chain id with transaction hash description: A standard for encoding a chain ID and transaction hash into a unique string format author: Lauri Peltonen (@microbecode) From a7e8642b379cc7ba06a99e652a27c71418531b2b Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Thu, 22 May 2025 15:49:43 +0300 Subject: [PATCH 6/9] Rename file with EIP number --- ERCS/{erc-encode_idhash.md => erc-7950.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ERCS/{erc-encode_idhash.md => erc-7950.md} (100%) diff --git a/ERCS/erc-encode_idhash.md b/ERCS/erc-7950.md similarity index 100% rename from ERCS/erc-encode_idhash.md rename to ERCS/erc-7950.md From 00d31d1458e23b4575831424327bc62b34212e6c Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Thu, 22 May 2025 15:56:20 +0300 Subject: [PATCH 7/9] Resolve formatting issues --- ERCS/erc-7950.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-7950.md b/ERCS/erc-7950.md index 9183b5046c8..bf019278a9a 100644 --- a/ERCS/erc-7950.md +++ b/ERCS/erc-7950.md @@ -1,7 +1,7 @@ --- eip: 7950 title: Encode chain id with transaction hash -description: A standard for encoding a chain ID and transaction hash into a unique string format +description: Way to encode a chain ID and transaction hash into a unique string format author: Lauri Peltonen (@microbecode) discussions-to: https://ethereum-magicians.org/t/a-new-standard-for-encoding-chain-id-transaction-hash/23782 status: Draft @@ -24,7 +24,7 @@ Such strings can then be used, for example, in a forwarder service that forwards The encoded string has three components: -- A chain ID, denoted as `chainId`. The used chain id MUST be based on EIP-155 and the chain ID repository stated in that EIP. +- A chain ID, denoted as `chainId`. The used chain id MUST be based on EIP 155 and the chain ID repository stated in that EIP. - A transaction hash, denoted as `txHash`. The hash MUST include the `0x` prefix. - A static string `tx`, acting as a type identifier. From eba2036786c1b8fadfe9330a71b727a0f40ca1a0 Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Thu, 22 May 2025 16:05:54 +0300 Subject: [PATCH 8/9] Add link to EIP --- ERCS/erc-7950.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ERCS/erc-7950.md b/ERCS/erc-7950.md index bf019278a9a..8994213bf7a 100644 --- a/ERCS/erc-7950.md +++ b/ERCS/erc-7950.md @@ -8,6 +8,7 @@ status: Draft type: Standards Track category: ERC created: 2025-05-10 +requires: EIP-155 --- ## Abstract @@ -24,7 +25,7 @@ Such strings can then be used, for example, in a forwarder service that forwards The encoded string has three components: -- A chain ID, denoted as `chainId`. The used chain id MUST be based on EIP 155 and the chain ID repository stated in that EIP. +- A chain ID, denoted as `chainId`. The used chain id MUST be based on [EIP-155](https://eips.ethereum.org/EIPS/eip-155) and the chain ID repository stated in that EIP. - A transaction hash, denoted as `txHash`. The hash MUST include the `0x` prefix. - A static string `tx`, acting as a type identifier. From 669d58522a33a98311ca7a2b10168b69cf1ed07c Mon Sep 17 00:00:00 2001 From: Lauri Peltonen <20242241+microbecode@users.noreply.github.com> Date: Thu, 22 May 2025 16:08:57 +0300 Subject: [PATCH 9/9] fix syntax --- ERCS/erc-7950.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/erc-7950.md b/ERCS/erc-7950.md index 8994213bf7a..253570f47ac 100644 --- a/ERCS/erc-7950.md +++ b/ERCS/erc-7950.md @@ -8,7 +8,7 @@ status: Draft type: Standards Track category: ERC created: 2025-05-10 -requires: EIP-155 +requires: 155 --- ## Abstract