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

CAIP-19: Add block number tag #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TimDaub
Copy link

@TimDaub TimDaub commented Jun 30, 2022

Survey

Did a survey on which chains use ascending block number heights. All that I checked use the concept except for Hedera

ethereum: https://etherscan.io/block/15051057
bitcoin: https://blockchair.com/bitcoin/block/743020
cosmos: https://www.mintscan.io/cosmos/blocks/11082723
litecoin: https://blockchair.com/litecoin/block/2289502
lisk: https://legacy-explorer.lisk.com/block/11289477821881538126
eos: https://eosauthority.com/block/254866414?network=eos
polkadot: https://explorer.polkascan.io/polkadot/block/10964158
filecoin: https://explorer.bitquery.io/filecoin/height/1943190
handshake: https://e.hnsfans.com/block/126736
tezos: https://tzstats.com/2494326
stellar: https://stellarchain.io/ledger/41553526
solana: https://explorer.solana.com/block/139663191
hedera: doesn't use block tags

@qizhou
Copy link

qizhou commented Jul 11, 2022

Do we want to be HTTP compatible (e.g., can be used by an HTTP gateway with translated HTTP URL)? If so, I would suggest using a character other than "#" as "#" will be treated as a hashtag in HTTP.

@TimDaub
Copy link
Author

TimDaub commented Jul 11, 2022

not sure if I understand this. Wouldn't slashes and colons also interfere? I understand that if you wanted to use CAIP19 as an ID in an URL you'd be running into trouble.

Actually, I've also called this out in an issue but there is someone missing who is making the problematic abundantly clear IMO: #81

@qizhou
Copy link

qizhou commented Jul 11, 2022

The issue with hashtag # is that in modern browsers, the fragment after hashtag will not be passed to the webservers, i.e., if the webservers need to process the fragment part, it will never find it in the request if the link is visited by a browser (e.g., visited by gateway_link + CAIP19_link).

For slashes and colons, I think they are fine as long as they are passed to the server (e.g., https://web3q.io/vitalikca.eth:4/ works for ERC-4804-translated URL).

@TimDaub
Copy link
Author

TimDaub commented Jul 12, 2022

Great point, but then I think the block number tag should come after the chainId and it'll break existing CAIP-19

@qizhou
Copy link

qizhou commented Jul 12, 2022

Have ever tried a query with blockNumber attribute? This may become

asset_type: chain_id + "/" + asset_namespace + ":" + asset_reference + "&" + query

query = ("blockNumber" | "n") "=" blockNumber

@TimDaub
Copy link
Author

TimDaub commented Jul 13, 2022

great suggestion, feel free to submit this directly as a PR superseeding/updating mine. I'll be a week on Holiday so I won't make the change sooon

qizhou added a commit to qizhou/CAIPs that referenced this pull request Jul 14, 2022
@qizhou
Copy link

qizhou commented Jul 14, 2022

See #125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants