From 41a8caa54d8691b7fa98795d31f401e1df31e18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Tue, 22 Oct 2024 17:16:39 +0200 Subject: [PATCH 1/6] imp: note that commitments must be lexographically ordered to maintain soundness (#1153) --- spec/core/ics-023-vector-commitments/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/core/ics-023-vector-commitments/README.md b/spec/core/ics-023-vector-commitments/README.md index 2abd82483..534c1291b 100644 --- a/spec/core/ics-023-vector-commitments/README.md +++ b/spec/core/ics-023-vector-commitments/README.md @@ -249,6 +249,8 @@ For any prefix `prefix` and any path `path` not set in the commitment `acc`, for Probability(verifyMembership(root, proof, applyPrefix(prefix, path), value) === true) negligible in k ``` +To ensure the commitment proofs are *sound*, the commitment must be lexographically ordered to ensure that non-existence proofs of the key `b` may be proven by showing the existence of key `a` and key `c` in addition to proving that these two keys are neightbors in the commitment. + #### Position binding Commitment proofs MUST be *position binding*: a given commitment path can only map to one value, and a commitment proof cannot prove that the same path opens to a different value except with probability negligible in k. From 6e51b71f83b3e60c119bd760f61bc232c5fc478a Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:08:39 +0200 Subject: [PATCH 2/6] restructure ibc keys --- spec/core/v2/ics-024-host-requirements/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/core/v2/ics-024-host-requirements/README.md b/spec/core/v2/ics-024-host-requirements/README.md index c967197dc..3374a3240 100644 --- a/spec/core/v2/ics-024-host-requirements/README.md +++ b/spec/core/v2/ics-024-host-requirements/README.md @@ -110,11 +110,11 @@ IBC/TAO implementations MUST implement the following paths for the `provableStor Future paths may be used in future versions of the protocol, so the entire key-space in the provable store MUST be reserved for the IBC handler. -| Store | Path format | Value type | Defined in | -| -------------- | -------------------------------------------------------------------------- | ----------------- | ---------------------- | -| provableStore | "commitments/channels/{identifier}/sequences/{bigEndianUint64Sequence}" | bytes | [ICS 4](../ics-004-packet-semantics) | -| provableStore | "receipts/channels/{identifier}/sequences/{bigEndianUint64Sequence}" | bytes | [ICS 4](../ics-004-packet-semantics) | -| provableStore | "acks/channels/{identifier}/sequences/{bigEndianUint64Sequence}" | bytes | [ICS 4](../ics-004-packet-semantics) | +| Store | Path format | Value type | Defined in | +| -------------- | ------------------------------------------------- | ---------- | ------------------------------------ | +| provableStore | {channelIdentifier}|0x1|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | +| provableStore | {channelIdentifier}|0x2|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | +| provableStore | {channelIdentifier}|0x3|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | ### Provable Commitments From a91410dd566dd1c1c1b500f508bccec15cc2a3b3 Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:04:48 +0100 Subject: [PATCH 3/6] add value instead of redundant provable store column --- spec/core/v2/ics-024-host-requirements/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/core/v2/ics-024-host-requirements/README.md b/spec/core/v2/ics-024-host-requirements/README.md index 3374a3240..488be54db 100644 --- a/spec/core/v2/ics-024-host-requirements/README.md +++ b/spec/core/v2/ics-024-host-requirements/README.md @@ -110,11 +110,11 @@ IBC/TAO implementations MUST implement the following paths for the `provableStor Future paths may be used in future versions of the protocol, so the entire key-space in the provable store MUST be reserved for the IBC handler. -| Store | Path format | Value type | Defined in | -| -------------- | ------------------------------------------------- | ---------- | ------------------------------------ | -| provableStore | {channelIdentifier}|0x1|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | -| provableStore | {channelIdentifier}|0x2|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | -| provableStore | {channelIdentifier}|0x3|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | +| Value | Path format | Value type | Defined in | +| -------------------------- | ------------------------------------------------- | ---------- | ------------------------------------ | +| Packet Commitment | {channelIdentifier}|0x1|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | +| Packet Receipt | {channelIdentifier}|0x2|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | +| Acknowledgement Commitment | {channelIdentifier}|0x3|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | ### Provable Commitments From 499818e9c4b136029717a436a04af15113f4424f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:15:40 +0100 Subject: [PATCH 4/6] chore: remove myself as codeowner (#1156) --- .github/CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 26e5af5f8..19e47d006 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,7 @@ # Default owners for repository # 2/n quorum required for merge -* @adityasripal @cwgoes @angbrav @colin-axner @damiannolan @sangier +* @adityasripal @cwgoes @angbrav @damiannolan @sangier # CODEOWNERS for the CODEOWNER file @@ -9,6 +9,6 @@ # CODEOWNERS for the specs -/spec/app @adityasripal @cwgoes @colin-axner @damiannolan @sangier +/spec/app @adityasripal @cwgoes @damiannolan @sangier /spec/app/ics-028-cross-chain-validation @mpoke @adityasripal @cwgoes @angbrav @insumity From 47fea20d4d400e967721396092c6b43398c65d78 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Wed, 6 Nov 2024 22:09:56 +0700 Subject: [PATCH 5/6] Fix variable name (#1162) --- spec/eureka/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/eureka/README.md b/spec/eureka/README.md index 8fee7e571..5daaff97b 100644 --- a/spec/eureka/README.md +++ b/spec/eureka/README.md @@ -191,17 +191,17 @@ function sendPacket( assert(timeoutHeight === 0 || latestClientHeight < timeoutHeight) // if the sequence doesn't already exist, this call initializes the sequence to 0 - sequence = channelStore.get(nextSequenceSendPath(commitPort, sourceChannel)) + sequence = channelStore.get(nextSequenceSendPath(sourcePort, sourceChannel)) // store commitment to the packet data & packet timeout channelStore.set( - packetCommitmentPath(commitPort, sourceChannel, sequence), + packetCommitmentPath(sourcePort, sourceChannel, sequence), hash(hash(data), timeoutHeight, timeoutTimestamp) ) // increment the sequence. Thus there are monotonically increasing sequences for packet flow // from sourcePort, sourceChannel pair - channelStore.set(nextSequenceSendPath(commitPort, sourceChannel), sequence+1) + channelStore.set(nextSequenceSendPath(sourcePort, sourceChannel), sequence+1) // log that a packet can be safely sent emitLogEntry("sendPacket", { From 1144d7619628019d7ffee210c43457d3f0f912ad Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:32:32 +0100 Subject: [PATCH 6/6] fix link and put new provable keys into 04-channel spec --- spec/core/v2/ics-004-channel-and-packet-semantics/README.md | 6 +++--- spec/core/v2/ics-024-host-requirements/README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/core/v2/ics-004-channel-and-packet-semantics/README.md b/spec/core/v2/ics-004-channel-and-packet-semantics/README.md index b49b3dadf..4d8d80430 100644 --- a/spec/core/v2/ics-004-channel-and-packet-semantics/README.md +++ b/spec/core/v2/ics-004-channel-and-packet-semantics/README.md @@ -163,7 +163,7 @@ Thus, constant-size commitments to packet data fields are stored under the packe ```typescript function packetCommitmentPath(channelSourceId: bytes, sequence: BigEndianUint64): Path { - return "commitments/channels/{channelSourceId}/sequences/{sequence}" + return "{channelSourceId}|0x1|{bigEndianUint64Sequence}" } ``` @@ -173,7 +173,7 @@ Packet receipt data are stored under the `packetReceiptPath`. In the case of a s ```typescript function packetReceiptPath(channelDestId: bytes, sequence: BigEndianUint64): Path { - return "receipts/channels/{channelDestId}/sequences/{sequence}" + return "{channelDestId}|0x2|{bigEndianUint64Sequence}" } ``` @@ -181,7 +181,7 @@ Packet acknowledgement data are stored under the `packetAcknowledgementPath`: ```typescript function packetAcknowledgementPath(channelSourceId: bytes, sequence: BigEndianUint64): Path { - return "acks/channels/{channelSourceId}/sequences/{sequence}" + return "{channelSourceId}|0x3|{bigEndianUint64Sequence}" } ``` diff --git a/spec/core/v2/ics-024-host-requirements/README.md b/spec/core/v2/ics-024-host-requirements/README.md index 488be54db..01203befd 100644 --- a/spec/core/v2/ics-024-host-requirements/README.md +++ b/spec/core/v2/ics-024-host-requirements/README.md @@ -112,9 +112,9 @@ Future paths may be used in future versions of the protocol, so the entire key-s | Value | Path format | Value type | Defined in | | -------------------------- | ------------------------------------------------- | ---------- | ------------------------------------ | -| Packet Commitment | {channelIdentifier}|0x1|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | -| Packet Receipt | {channelIdentifier}|0x2|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | -| Acknowledgement Commitment | {channelIdentifier}|0x3|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-packet-semantics) | +| Packet Commitment | {channelIdentifier}|0x1|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-channel-and-packet-semantics) | +| Packet Receipt | {channelIdentifier}|0x2|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-channel-and-packet-semantics) | +| Acknowledgement Commitment | {channelIdentifier}|0x3|{bigEndianUint64Sequence} | bytes | [ICS 4](../ics-004-channel-and-packet-semantics) | ### Provable Commitments