# Decentralized DAB by NFID Labs

**URL:** <https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312>\
**Category:** Developers\
**Created:** [October 18, 2024, 2:49pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312 "2024-10-18T14:49:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dostro](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dostro/32/1161_2.png) [@dostro](https://forum.dfinity.org/u/dostro)\
**Post date:** [October 18, 2024, 2:49pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/1 "2024-10-18T14:49:12Z")

</div>

We’ve built a v1 governable ICRC-1 token API that we’re already using in NFID Wallet, is being used by the Bity team in their wallet, and that we’d like to roll out for the whole ecosystem after a bit of additional polish.

There’s something wonky with our dfx metadata so for now you’ll have to access the get\_all\_icrc1\_canisters endpoint for the zjahs-wyaaa-aaaal-qjuia-cai canister through the [candid UI](https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app/) with the did pasted at the bottom (sorry, don’t have forum permission to post the file itself).

@nadiein and I have a couple of questions regarding token data retrieval:

1. What’s the most reliable method to fetch all SNS tokens?  
We’ve found two endpoints, but neither solves the issue completely:

- [https://sns-api.internetcomputer.org/api/v1/snses](https://sns-api.internetcomputer.org/api/v1/snses)  
This one seems to return the correct list of tokens, but it’s missing the ledger canister ID and index canister ID, which are fundamental for token identification.
- [https://icrc-api.internetcomputer.org/api/v1/ledgers?token\_types=sns](https://icrc-api.internetcomputer.org/api/v1/ledgers?token_types=sns)  
This provides the ledger canister ID, but not all SNS tokens, and it includes some SNS projects that hadn’t succeed through the swap (e.g., Juno Build).

1. How can we determine if an ICRC-1 token has an index canister?  
From the limited research we’ve done so far, there’s not yet a reliable answer.

Thanks, everyone!

did file for canister zjahs-wyaaa-aaaal-qjuia-cai:

```auto
type Category = variant {
    Sns;
    Known;
    Spam;
    ChainFusionTestnet;
    ChainFusion;
    Community;
    Native;
};

type Conf = record {
    controllers : opt vec principal;
    im_canister : opt principal;
};

type ICRC1 = record {
    logo : opt text;
    name : text;
    ledger : text;
    category : Category;
    index : opt text;
    symbol : text;
    decimals : nat8;
    fee : nat;
};

type ICRC1Request = record {
    logo : opt text;
    name : text;
    ledger : text;
    index : opt text;
    symbol : text;
    decimals : nat8;
    fee : nat;
};service : (opt Conf) -> {
    get_all_icrc1_canisters : () -> (vec ICRC1) query;
    replace_icrc1_canisters : (vec ICRC1) -> ();
    store_new_icrc1_canisters : (vec ICRC1) -> ();
    store_icrc1_canister : (ICRC1Request) -> ();
    sync_controllers: () -> (vec text);
}

```

---

<div class="post-metadata">

**Author:** ![mathiasb](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@mathiasb](https://forum.dfinity.org/u/mathiasb)\
**Post date:** [October 22, 2024, 12:34pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/2 "2024-10-22T12:34:40Z")

</div>

1. With the first step, you’re halfway there. [https://sns-api.internetcomputer.org/api/v1/snses](https://sns-api.internetcomputer.org/api/v1/snses) returns the root canisters of each SNS, and if you then query [https://sns-api.internetcomputer.org/api/v1/snses/](https://sns-api.internetcomputer.org/api/v1/snses/)\<root\_canister\_id\>, you’ll get information about the canisters of that particular SNS, e.g., for the first one in the list BOOM DAO, [https://sns-api.internetcomputer.org/api/v1/snses/xjngq-yaaaa-aaaaq-aabha-cai](https://sns-api.internetcomputer.org/api/v1/snses/xjngq-yaaaa-aaaaq-aabha-cai) . Then look for `ledger_canister_id` (and potentially `index_canister_id`).
2. This is not currently possible. We’re looking into options for this.

---

<div class="post-metadata">

**Author:** ![dskloet](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dskloet/32/10783_2.png) [@dskloet](https://forum.dfinity.org/u/dskloet)\
**Post date:** [October 22, 2024, 12:36pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/3 "2024-10-22T12:36:55Z")

</div>

You can get the list of SNSes (and canister IDs and a lot more) from a paginated list on the [SNS aggregator](https://3r4gx-wqaaa-aaaaq-aaaia-cai.icp0.io/).  
The first page is here: [https://3r4gx-wqaaa-aaaaq-aaaia-cai.icp0.io/v1/sns/list/page/0/slow.json](https://3r4gx-wqaaa-aaaaq-aaaia-cai.icp0.io/v1/sns/list/page/0/slow.json)  
There are currently 4 pages.

---

<div class="post-metadata">

**Author:** ![marc0olo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marc0olo/32/17290_2.png) [@marc0olo](https://forum.dfinity.org/u/marc0olo)\
**Post date:** [October 22, 2024, 1:36pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/4 "2024-10-22T13:36:10Z")

</div>

> [@mathiasb](#):
>
> 1. This is not currently possible. We’re looking into options for this.

do we already have ideas how to provide this?

---

<div class="post-metadata">

**Author:** ![nadiein](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/nadiein/32/26333_2.png) [@nadiein](https://forum.dfinity.org/u/nadiein)\
**Post date:** [December 3, 2024, 12:00pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/5 "2024-12-03T12:00:25Z")

</div>

hello @mathiasb  
we checked the option that you suggested, however, we can get only 20 tokens, disregarding that currently, 30 projects passed SNS.

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/8/3/83f94212a49cd662b348dec8b288217f6c3cfcf6.png)  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/2/c/2c1784762d121ffd78db3babc842536ee7ce97d2.jpeg)

we will take a look at the SNS aggregator, but will prefer the original endpoint to get the correct data (;

---

<div class="post-metadata">

**Author:** ![mathiasb](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@mathiasb](https://forum.dfinity.org/u/mathiasb)\
**Post date:** [December 3, 2024, 12:47pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/6 "2024-12-03T12:47:43Z")

</div>

Thanks for the update, @nadiein ! With the following script I am able to list 30 SNS index canisters:

```auto
#!/bin/bash
export DFX_WARNING="-mainnet_plaintext_identity"
ROOT_CANISTERS=$(curl -s "https://sns-api.internetcomputer.org/api/v1/snses?max_sns_index=99&offset=0&limit=100&include_swap_lifecycle=LIFECYCLE_COMMITTED" | jq -r ".data[].root_canister_id")
for root_canister in ${ROOT_CANISTERS};
do
  data=$(curl -s "https://sns-api.internetcomputer.org/api/v1/snses/$root_canister")
  name=$(printf "%-20s%s\n" `echo $data | jq -r ".name"`)
  canister_type_and_id=$(echo ${data} | jq -cr '.canisters[] | "\(.canister_type):\(.canister_id)"')
  for id in $canister_type_and_id
  do
    if [[$id == *"index"*]]
    then
      name=$(echo $name | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//' | sed 's/ /-/g' | tr '[:lower:]' '[:upper:]')
      echo -e "$name: \t$id" | sed 's/index://g'
    fi
  done
done

```

Based on what you wrote and your screenshot, I cannot say where the issue is. Maybe you’re not specifying a large enough limit, and only get information from 20 SNSs in the response to your query?

There is ongoing work on the [ICRC-106](https://github.com/dfinity/ICRC/blob/40a3ce74c330cc70627565edf93171644d34ac2b/ICRCs/ICRC-106/ICRC-106.md) standard that allows for retrieving information about the index canister ID from its ledger canister. There’s also some discussion around it in [this forum thread](https://forum.dfinity.org/t/ledger-and-tokenisation-working-group-index-discovery-alignment-of-icrc-ledgers-with-icrc-3/37229). At this time I would expect the functionality to be available in January 2025.

Since there is currently no standard for the ledger index, ICRC-106 is more of a stop-gap solution for supporting existing use cases. There are plans to work on an index standard as a follow-up.

---

<div class="post-metadata">

**Author:** ![marc0olo](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/marc0olo/32/17290_2.png) [@marc0olo](https://forum.dfinity.org/u/marc0olo)\
**Post date:** [February 3, 2025, 4:05pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/7 "2025-02-03T16:05:56Z")

</div>

this might sound like a stupid question, but what does “DAB” actually stand for? can anybody answer me that? I screened all existing docs but struggled to find that information 😅

---

<div class="post-metadata">

**Author:** ![dostro](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/dostro/32/1161_2.png) [@dostro](https://forum.dfinity.org/u/dostro)\
**Post date:** [February 4, 2025, 1:37pm UTC](https://forum.dfinity.org/t/decentralized-dab-by-nfid-labs/36312/9 "2025-02-04T13:37:49Z")

</div>

Decentralized Asset Bridge(?)

I’m not actually sure 🤷‍♂️

I’d say we built a decentralized token registry
