Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BlockExplorer-routes CAIP #200

Merged
merged 10 commits into from
Apr 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions CAIPs/caip-X.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--
caip: <to be assigned>
ligi marked this conversation as resolved.
Show resolved Hide resolved
title: BlockExplorer API Routes
author: Pedro Gomes (@pedrouid), ligi (@ligi)
discussions-to: https://github.com/ChainAgnostic/CAIPs/discussions/199
status: Draft
type: Standard
created: 2023-1-11
---

## Simple Summary

Standard API Routes for Blockchain explorers

## Abstract

This CAIP standardizes the routes for addesses and transactions between BlockExplorers.

## Motivation

For the Ethereum ecosystem Pedro Gomez already created EIP-3091 and it already helped getting explorers to use the same routes. Ligi was verifying compatibility in ethereum-lists/chains often. And noticed that only addresses and transactions are really meaningfully used - and tokens/blocks where causing work verifying and failing verifications while not really being used. Also some L2s go away from the concept of blocks.
This is a CAIP with minimal routes that are used most of the time. If other routes are used in the future other CAIPs can inherit from this one and extend it. This way we can also differentiate between CAIPs with different feature-sets.

## Specification

Block explorers will route their webpages accordingly for the following data:

### Blocks

`<BLOCK_EXPORER_URL>/block/<BLOCK_HASH_OR_HEIGHT>`

### Transactions

`<BLOCK_EXPORER_URL>/tx/<TX_HASH>`

### Addresses

`<BLOCK_EXPORER_URL>/address/<ACCOUNT_ADDRESS>`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's ACCOUNT_ADDRESS here? Would it make sense to rely on CAIP-10?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice - but then no explorer would be compatible and guess this CAIP would not get traction
But would really be nice for multi-chain explorers (are there any yet btw - did not yet stumble upon them)


## Backwards Compatibility

This EIP was designed with existing API routes in mind to reduce disruption. Incompatible block explorers should include either 301 redirects to their existing API routes to match this EIP.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This EIP was designed with existing API routes in mind to reduce disruption. Incompatible block explorers should include either 301 redirects to their existing API routes to match this EIP.
Incompatible block explorers should include either 301 redirects to their existing API routes to match this EIP.

Is there an "or XXX" missing here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea - there is something missing actually - but same in the EIP - cc https://github.com/pedrouid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I think we can keep the sentence "This EIP was designed with existing API routes in mind to reduce disruption. " - just change EIP to CAIP

ligi marked this conversation as resolved.
Show resolved Hide resolved
Explorers compatible with EIP-3091 are automatically comatible with this CAIP.
ligi marked this conversation as resolved.
Show resolved Hide resolved

## Links

- [EIP-3091](https://eips.ethereum.org/EIPS/eip-3091)

## Copyright

Copyright and related rights waived
via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).