-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
LGTM! |
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. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**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. | |
There was a problem hiding this comment.
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 :
- Introduces a standard approach for indicating the presence of an index canister for ICRC-1 tokens through ledger metadata.
- 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
There was a problem hiding this comment.
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:
- Our Index complies with ICRC-106, but our Ledger does not support that standard yet.
- Our Ledger complies with ICRC-106, but our Index does not support that standard yet.
- We have an ICRC-106-compliant Ledger suite.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 [...]
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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) |
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.