From 24f0d14b750937a1859e44b78966697217bcbb2e Mon Sep 17 00:00:00 2001 From: bumblefudge Date: Mon, 20 Mar 2023 20:01:47 +0100 Subject: [PATCH 1/6] create strawman for txn obj addressing caip --- CAIPs/caip-221.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 CAIPs/caip-221.md diff --git a/CAIPs/caip-221.md b/CAIPs/caip-221.md new file mode 100644 index 00000000..a39770e6 --- /dev/null +++ b/CAIPs/caip-221.md @@ -0,0 +1,94 @@ +--- +caip: CAIP-X +title: Transaction Object Addressing +author: Juan Caballero (@bumblefudge), Sebastian Posth , and Antonio Antonioni (@ntn-x2) +discussions-to: https://github.com/chainAgnostic/CAIPs/pull/220 +status: Draft +type: Standard +created: 2023-03-20 +updated: 2023-03-20 +requires: 2 +replaces: +--- + +## Simple Summary + +Universal syntax for addressing a specific transaction in current state of +blockchains, directed acyclical graphs, or other cryptographical data systems. + +## Abstract + +A general-purpose abstraction for how various namespaces address transaction +objects and a minimal set of properties commonly contained in them across +namespaces. + +## Motivation + +While block explorers for newer systems tend to inherit their user experience +and syntax from prior art, there is much divergence in both their public-facing +routes (see [CAIP-200][]) and in the properties queriable per transaction. This +specification defines a minimal set of commonly-used properties to serve as a +translation layer across those syntaxes, with per-namespace profiles needed to +further define and caveat the values and add namespace-specific properties that +may be important to cross-namespace use cases. + +## Specification + +Transactions are addressed as follows: + +``` +block_address: chain_id + ":" [ + "block:"]? + "txn/" + transaction_id + ["." + property]? +chain_id: [-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32} (See [CAIP-2][]) +transaction_id: [-%a-zA-Z0-9]{1,128} +property (optional): (hash|data) +``` + +The *name* of each value in its native namespace varies; a few illustrative +examples follow: + +|CAIP-220 property|BTC block property|ETH2 block property| +|---|---|---| +|hash|?|?| +|data|?|?| + +The *value* of each of these properties varies widely by namespace, so see the +[namespace profiles][namespaces] for each for validation guidance. + +## Rationale + +TBD - will just summarize PR debates if good input is forthcoming! + +## Test Cases + + +``` +# bip122:000000000019d6689c085ae165831e93:666666:tx/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99.data +# https://www.blockchain.com/explorer/transactions/btc/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99 + +Do not be overcome by evil, but overcome evil with good - Romans 12:21 + +# eip155:6:tx/0x3edb98c24d46d148eb926c714f4fbaa117c47b0c0821f38bfce9763604457c33.data + +# Name Type Data +0 iscc string KACXDCTNRPRCRYPBDJNYOYLWTRAOKTTCAUS42ZO5T4IZVU467KHHNUY +1 url string https://ipfs.io/ipfs/QmSBF81KWqGANVCc8AxgRvyoD1kiTjhrc5MypLevJoguV8 +2 message string LICCIUM_TESTDECLARE +``` + +## Security Considerations + + +## Privacy Considerations + + +## Backwards Compatibility + +TBD + +## Links + + +[namespaces]: https://namespaces.chainagnostic.org/ + +## Copyright +Copyright and related rights waived via [CC0](../LICENSE). From 1848a322b21a7f1ef1af1a472741080c8bc72074 Mon Sep 17 00:00:00 2001 From: bumblefudge Date: Tue, 21 Mar 2023 11:52:34 +0100 Subject: [PATCH 2/6] more properties mapped to btc+eth --- CAIPs/caip-221.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/CAIPs/caip-221.md b/CAIPs/caip-221.md index a39770e6..9c02a498 100644 --- a/CAIPs/caip-221.md +++ b/CAIPs/caip-221.md @@ -40,7 +40,7 @@ Transactions are addressed as follows: block_address: chain_id + ":" [ + "block:"]? + "txn/" + transaction_id + ["." + property]? chain_id: [-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32} (See [CAIP-2][]) transaction_id: [-%a-zA-Z0-9]{1,128} -property (optional): (hash|data) +property (optional): (from|to|outputs|feePaid|inputs) ``` The *name* of each value in its native namespace varies; a few illustrative @@ -48,8 +48,13 @@ examples follow: |CAIP-220 property|BTC block property|ETH2 block property| |---|---|---| -|hash|?|?| -|data|?|?| +|from|?|?| +|to|?|?| +|type|?|?| +|position|?|?| +|output|?|?| +|feePaid|?|?| +|inputs|?|?| The *value* of each of these properties varies widely by namespace, so see the [namespace profiles][namespaces] for each for validation guidance. @@ -63,15 +68,24 @@ TBD - will just summarize PR debates if good input is forthcoming! ``` # bip122:000000000019d6689c085ae165831e93:666666:tx/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99.data -# https://www.blockchain.com/explorer/transactions/btc/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99 +## https://www.blockchain.com/explorer/transactions/btc/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99 + +OP_RETURN OP_PUSHBYTES_70 446f206e6f74206265206f766572636f6d65206279206576696c2c20627574206f766572636f6d65206576696c207769746820676f6f64202d20526f6d616e732031323a3231 + +# Decoded: Do not be overcome by evil, but overcome evil with good - Romans 12:21 -# eip155:6:tx/0x3edb98c24d46d148eb926c714f4fbaa117c47b0c0821f38bfce9763604457c33.data +# eip155:6:tx/0x3edb98c24d46d148eb926c714f4fbaa117c47b0c0821f38bfce9763604457c33.inputs +## https://goerli.etherscan.io/tx/0x3edb98c24d46d148eb926c714f4fbaa117c47b0c0821f38bfce9763604457c33 + +0x82f71739000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000000374b4143584443544e5250524352595042444a4e594f594c575452414f4b54544341555334325a4f355434495a56553436374b48484e5559000000000000000000000000000000000000000000000000000000000000000000000000000000004368747470733a2f2f697066732e696f2f697066732f516d53424638314b577147414e564363384178675276796f44316b69546a687263354d79704c65764a6f67755638000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000134c49434349554d5f544553544445434c41524500000000000000000000000000 + +## decoded: # Name Type Data -0 iscc string KACXDCTNRPRCRYPBDJNYOYLWTRAOKTTCAUS42ZO5T4IZVU467KHHNUY -1 url string https://ipfs.io/ipfs/QmSBF81KWqGANVCc8AxgRvyoD1kiTjhrc5MypLevJoguV8 +0 iscc string KACXDCTNRPRCRYPBDJNYOYLWTRAOKTTCAUS42ZO5T4IZVU467KHHNUY +1 url string https://ipfs.io/ipfs/QmSBF81KWqGANVCc8AxgRvyoD1kiTjhrc5MypLevJoguV8 2 message string LICCIUM_TESTDECLARE ``` From 25c4543f2b74082ef1f871edbf505a6745ceae4b Mon Sep 17 00:00:00 2001 From: bumblefudge Date: Tue, 21 Mar 2023 12:03:26 +0100 Subject: [PATCH 3/6] more properties mapped to btc+eth --- CAIPs/caip-221.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CAIPs/caip-221.md b/CAIPs/caip-221.md index 9c02a498..1ca05eb9 100644 --- a/CAIPs/caip-221.md +++ b/CAIPs/caip-221.md @@ -40,7 +40,7 @@ Transactions are addressed as follows: block_address: chain_id + ":" [ + "block:"]? + "txn/" + transaction_id + ["." + property]? chain_id: [-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32} (See [CAIP-2][]) transaction_id: [-%a-zA-Z0-9]{1,128} -property (optional): (from|to|outputs|feePaid|inputs) +property (optional): (signer|recipients|type|outputs|inputs) ``` The *name* of each value in its native namespace varies; a few illustrative @@ -48,13 +48,11 @@ examples follow: |CAIP-220 property|BTC block property|ETH2 block property| |---|---|---| -|from|?|?| -|to|?|?| -|type|?|?| -|position|?|?| -|output|?|?| -|feePaid|?|?| -|inputs|?|?| +|signer|*(derived from scriptsig)|from| +|recipients|*(derived from outputs)|to| +|type|?|TransactionType (see [EIP-2718][])| +|outputs|outputs[]|value| +|inputs|inputs[]|data[]| The *value* of each of these properties varies widely by namespace, so see the [namespace profiles][namespaces] for each for validation guidance. @@ -103,6 +101,7 @@ TBD [namespaces]: https://namespaces.chainagnostic.org/ +[EIP-2718]: https://eips.ethereum.org/EIPS/eip-2718 ## Copyright Copyright and related rights waived via [CC0](../LICENSE). From 9a4023a332a13d2b2d8375c59f40ec3306624997 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Tue, 21 Mar 2023 15:02:26 +0100 Subject: [PATCH 4/6] author's name typo Co-authored-by: Antonio --- CAIPs/caip-221.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-221.md b/CAIPs/caip-221.md index 1ca05eb9..9411a4f0 100644 --- a/CAIPs/caip-221.md +++ b/CAIPs/caip-221.md @@ -1,7 +1,7 @@ --- caip: CAIP-X title: Transaction Object Addressing -author: Juan Caballero (@bumblefudge), Sebastian Posth , and Antonio Antonioni (@ntn-x2) +author: Juan Caballero (@bumblefudge), Sebastian Posth , and Antonio Antonino (@ntn-x2) discussions-to: https://github.com/chainAgnostic/CAIPs/pull/220 status: Draft type: Standard From 52c2fcfc90e6af78fad95d434d07357dee68f53e Mon Sep 17 00:00:00 2001 From: bumblefudge Date: Tue, 21 Mar 2023 16:47:31 +0100 Subject: [PATCH 5/6] typo in test case #1 (thanks ntn-x2) --- CAIPs/caip-221.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-221.md b/CAIPs/caip-221.md index 9411a4f0..f18bccd3 100644 --- a/CAIPs/caip-221.md +++ b/CAIPs/caip-221.md @@ -65,7 +65,7 @@ TBD - will just summarize PR debates if good input is forthcoming! ``` -# bip122:000000000019d6689c085ae165831e93:666666:tx/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99.data +# bip122:000000000019d6689c085ae165831e93:666666:tx/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99.inputs ## https://www.blockchain.com/explorer/transactions/btc/057954bb28527ff9c7701c6fd2b7f770163718ded09745da56cc95e7606afe99 OP_RETURN OP_PUSHBYTES_70 446f206e6f74206265206f766572636f6d65206279206576696c2c20627574206f766572636f6d65206576696c207769746820676f6f64202d20526f6d616e732031323a3231 From 1849df739f05fe93d6446554a31ec78e42632620 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Thu, 15 Aug 2024 16:09:25 +0200 Subject: [PATCH 6/6] Author typo --- CAIPs/caip-221.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-221.md b/CAIPs/caip-221.md index f18bccd3..401315fa 100644 --- a/CAIPs/caip-221.md +++ b/CAIPs/caip-221.md @@ -1,7 +1,7 @@ --- caip: CAIP-X title: Transaction Object Addressing -author: Juan Caballero (@bumblefudge), Sebastian Posth , and Antonio Antonino (@ntn-x2) +author: Bumblefudge (@bumblefudge), Sebastian Posth , and Antonio Antonino (@ntn-x2) discussions-to: https://github.com/chainAgnostic/CAIPs/pull/220 status: Draft type: Standard