From bafc87ff6a2b960782b7d8d692888262da5291b0 Mon Sep 17 00:00:00 2001 From: bumblefudge Date: Mon, 20 Mar 2023 17:37:21 +0100 Subject: [PATCH 1/4] create strawman --- caip-220.md | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 caip-220.md diff --git a/caip-220.md b/caip-220.md new file mode 100644 index 00000000..fcc6bee9 --- /dev/null +++ b/caip-220.md @@ -0,0 +1,92 @@ +--- +caip: CAIP-X +title: Block 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 specific bundles of verifiable transactions +(i.e. "blocks") in blockchains, directed acyclical graphs, or other +cryptographical data systems. + +## Abstract + +While namespace-specific syntaxes will always exist and be preferable for single-namespace + +## 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 block. 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 constraint the values and add namespace-specific properties that may be +important to cross-namespace use cases. + +## Specification + +Blocks are addressed as follows: + +``` +block_address: chain_id + ":block/" + account_address + ["." + property]? +chain_id: [-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32} (See [CAIP-2][]) +block_height: [-%a-zA-Z0-9]{1,128} +property (optional): (hash|height|time|nonce|prev|txncount|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|hash|body.execution_payload_header.block_hash| +|height|n/a|body.execution_payload_header.block_number| +|time|time|body.execution_payload_header.timestamp| +|nonce|nonce|body.execution_payload.timestamp.prev_randao| +|prev|previousblockhash|body.execution_payload.parent_hash| +|txncount|txn_count|body.execution_payload.transactions.length*| +|txns|tx|body.execution_payload.transactions| +|size|size|body.execution_payload.gas_limit| +|data|coinbase*, tx.0.txinwitness (in RPC)|body.execution_payload.extra_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:tx.0.txinwitness + +``` +Sources: [bip122](https://www.blockchain.com/explorer/blocks/btc/0) | + +## Security Considerations + + +## Privacy Considerations + + +## Backwards Compatibility + +TBD + +## Links + + +[namespaces]: https://namespaces.chainagnostic.org/ + +## Copyright +Copyright and related rights waived via [CC0](../LICENSE). From b0c2d337146b63fc57a77d531cce12fc6f6536da Mon Sep 17 00:00:00 2001 From: bumblefudge Date: Mon, 20 Mar 2023 17:46:03 +0100 Subject: [PATCH 2/4] move caip-220.md --- caip-220.md => CAIPs/caip-220.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename caip-220.md => CAIPs/caip-220.md (100%) diff --git a/caip-220.md b/CAIPs/caip-220.md similarity index 100% rename from caip-220.md rename to CAIPs/caip-220.md From 734bd7ad41f07bbb63322014b50fb48ce933d866 Mon Sep 17 00:00:00 2001 From: bumblefudge Date: Tue, 21 Mar 2023 12:14:01 +0100 Subject: [PATCH 3/4] fix example --- CAIPs/caip-220.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CAIPs/caip-220.md b/CAIPs/caip-220.md index fcc6bee9..59f19097 100644 --- a/CAIPs/caip-220.md +++ b/CAIPs/caip-220.md @@ -69,9 +69,14 @@ TBD - will just summarize PR debates if good input is forthcoming! ``` # bip122:000000000019d6689c085ae165831e93:tx.0.txinwitness +## https://www.blockchain.com/explorer/blocks/btc/0 +OP_PUSHBYTES_4 ffff001d OP_PUSHBYTES_1 04 OP_PUSHBYTES_69 5468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73 + +## Decoded: +The Times 03/Jan/2009 Chancellor on brink of second bailout for banks ``` -Sources: [bip122](https://www.blockchain.com/explorer/blocks/btc/0) | + ## Security Considerations From 61d8d8200d95c3f404526e112978034241c07e18 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Fri, 19 May 2023 13:50:43 +0200 Subject: [PATCH 4/4] Update CAIPs/caip-220.md Co-authored-by: Antonio --- CAIPs/caip-220.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CAIPs/caip-220.md b/CAIPs/caip-220.md index 59f19097..2015af1a 100644 --- a/CAIPs/caip-220.md +++ b/CAIPs/caip-220.md @@ -1,7 +1,7 @@ --- caip: CAIP-X title: Block 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