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

Standard for index discovery from ledgers #106

Closed
wants to merge 22 commits into from
Closed

Conversation

bogwar
Copy link

@bogwar bogwar commented Oct 30, 2024

A standard to allow for the discovery of the index canister from the corresponding ledger. This standard will exist in draft form only since we will work on a proper ICRC standard for index canisters (which will include discoverability).
A secondary goal for the standard is to document the interface of the current index canister.

@bogwar bogwar changed the title get git number for the discover index standard Standard for index discovery from ledgers Nov 7, 2024
ICRCs/ICRC-106/ICRC-106.md Outdated Show resolved Hide resolved
ICRCs/ICRC-106/ICRC-106.md Outdated Show resolved Hide resolved
ICRCs/ICRC-106/ICRC-106.md Outdated Show resolved Hide resolved
ICRCs/ICRC-106/ICRC-106.md Outdated Show resolved Hide resolved
ICRCs/ICRC-106/ICRC-106.md Outdated Show resolved Hide resolved
ICRCs/ICRC-106/ICRC-106.md Outdated Show resolved Hide resolved
bogwar and others added 4 commits November 19, 2024 23:43
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
@aterga
Copy link

aterga commented Nov 20, 2024

LGTM!

bogwar and others added 4 commits November 26, 2024 11:36
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
**ICRC-106** introduces a standard approach for:
1. Indicating the presence of an index canister for ICRC-1 tokens through ledger metadata.
2. Defining a minimal interface for the index canister to facilitate querying transaction history in a consistent manner.

Copy link

@aterga aterga Nov 26, 2024

Choose a reason for hiding this comment

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

Suggested change
**Which canisters are in scope of this standard?**
The standard is specifying the behavior of an Index canister. Additionally, it suggests, but does not prescribe, how to design the API of the corresponding Ledger canister.

Copy link
Author

Choose a reason for hiding this comment

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

This is more accurate:

Standard ICRC-106 :

  1. Introduces a standard approach for indicating the presence of an index canister for ICRC-1 tokens through ledger metadata.
  2. Defines a minimal interface for the associated index canister to facilitate querying transaction history in a consistent manner.

Since the index is not standardized anywhere, here we prescribe the API one should expect, since otherwise discovering the index is not very useful

Copy link

Choose a reason for hiding this comment

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

Thanks, this is better.

I suppose it's still a bit implicit what canisters are restricted by this standard.

To make it concrete, which of the following statements would make sense:

  1. Our Index complies with ICRC-106, but our Ledger does not support that standard yet.
  2. Our Ledger complies with ICRC-106, but our Index does not support that standard yet.
  3. We have an ICRC-106-compliant Ledger suite.

Copy link
Author

Choose a reason for hiding this comment

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

Right now 1 is true. Once we make the changes to the ledger 3 will be true.


## 3. Index Canister Interface

The index canister associated with the ledger SHOULD implement the following minimal Candid interface:

Choose a reason for hiding this comment

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

for me it's a bit confusing that we're saying the index SHOULD implement the candid interface, but then further down suggest that they are definitely there and somehow part of this standard

The index canister provides methods to facilitate querying of transaction history and metadata associated with accounts. Below is a description of the relevant methods specified in this standard, including their purpose, input, output, and typical use case.

While the methods defined in this standard are sufficient for compliance with ICRC-106, certain implementations of the index canister may include additional methods to extend functionality. These methods are not required by ICRC-106 but may be present for advanced use cases:

  • Any changes to the index canister interface should maintain backward compatibility.

By adhering to ICRC-106, ledger canisters provide a standardized mechanism for clients to discover and interact with their associated index canisters, improving integration and user experience within the Internet Computer ecosystem.

why not standardise the index canisters interface first and then how it can be discovered from a ledger?

Copy link
Author

Choose a reason for hiding this comment

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

There's two reasons why we proceed this way:

  • standardized interfaces need to have name spaced methods, so a standardised index interface would have methods like icrc143_get_transactions().

  • There's many different opinions about index canisters and converging on a standard will take time. We don't want to postpone adding this metadata until we have a proper standard for index canisters.

So this standard, which we don't plan to vote on really plays the role of documentation for: discovering the current index & the relevant part of the API of the current index.

Choose a reason for hiding this comment

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

Ok, that makes sense. I would still try to change the wording in the current standard to avoid giving the impression there is some sort of standardised interface when in reality there is not.

Below is a description of the relevant methods specified in this standard [...]

While the methods defined in this standard are sufficient for compliance with ICRC-106 [...]

By adhering to ICRC-106, ledger canisters provide a standardized mechanism for clients to discover and interact with their associated index canisters [...]

Choose a reason for hiding this comment

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

Maybe also make it explicit that the interface of the index is subject to further discussions and another ICRC

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestion @letmejustputthishere. I've added something along these lines in the introduction of the standard.

@bogwar
Copy link
Author

bogwar commented Nov 28, 2024

I'm closing this PR in favour of: dfinity/ICRC-1#196 since this changes cannot be merged into the main ICRCs repo (since we don't plan to finalise this draft)

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.

3 participants