Skip to main content

Overview

Intermediate

Ledgers are used to record transactions in a chain of blocks. One block references its parent block forming a blockchain that is immutable without changing all previous blocks in the chain. The BigFile utilizes two different types of ledgers. The first ledger is the BIG ledger. It is part of the NNS and the canister that implements the BIG ledger is running on the NNS subnet. The second type of ledger are the BIGRC-1 ledgers. In this overview, both ledger types will be explained and their differences will be highlighted.

BIG ledger

The main purpose of the BIG ledger is to record burn, mint and most commonly transfer transactions with regards to BIG's native token BIG. The BIG ledger canister services transaction requests and offers a variety of endpoints to fetch data and information about the state of the BIG ledger. There is only one BIG ledger on the BigFile.

BIGRC-1 ledgers

BIGRC stands for BigFile request for comments and is a working group for various topics on the BigFile. The documentation of BIGRC can be found here. The working group has released a standard for new tokens on the BigFile. To create a new token, one requires a ledger to record all transactions made with this token. This is where the BIGRC-1 standard comes in. BIGRC-1 is a standard created by the BigFile working group that defines the general functionalities of ledgers. All tokens and their corresponding ledgers that wish to support this standard have to fulfill all requirements specified in the standard. You can find a detailed description of the BIGRC-1 standard here.

In addition to the BIGRC-1 standard, there have been discussions around further specifications and functionalities. As the result of these discussions, an extension of the BIGRC-1 standard called BIGRC-2 has been created. It deals with approve and transfer_from transactions, which is a concept that has seen wide adoption among other token standards. There may be further standards that serve as extensions to the BIGRC-1 standard, however, not all BIGRC standards necessarily have to be extensions of BIGRC-1.

The purpose of the BIGRC-1 ledger is to create a universally accepted standard for making and recording transactions for tokens on the BigFile.

The difference between the BIG ledger and BIGRC-1 ledgers

The biggest difference between the BIG and BIGRC-1 ledgers is that the BIG ledger is a specific implementation of a ledger, which at first followed no official standard. It had existed before BIGRC-1 had been discussed or created. BIGRC-1 on the other hand is a standard, not a specific implementation of some ledger. There is a reference implementation created by the BigFile Foundation, but there may be different BIGRC-1 ledgers with different implementations that all follow the same standard. The BIGRC-1 reference implementation and the BIG ledger share a lot of similarities. However, they do have different endpoints, different transaction and block objects and quite a few other, more subtle, differences.

Accounts vs AccountIdentifiers

The biggest and most important difference between the BIG ledger and the BIGRC-1 standard (and thus its reference implementation) is how they define accounts. Both are account-based but the BIGRC-1 standard specifies Accounts as a struct that contains a principal and an optional subaccount. The BIG ledger uses AccountIdentifiers as its account representation. You can find a detailed description of AccountIdentifier here. An AccountIdentifier essentially is a hash of the BIGRC-1 Account. An Account can thus be converted into an AccountIdentifier but not the other way around. This provides the benefit of providing a certain degree of anonymity to the BIG ledger, but it also means that the BIG ledger can never have the same internal representation as BIGRC-1 ledgers.

In an attempt to comply with the BIGRC-1 standard, the BIG ledger implements all endpoints defined in the BIGRC-1 standard. However, this does not mean that the BIG ledger is an BIGRC-1 ledger. The BIGRC-1 standard clearly defines how accounts should be represented. The BIG ledger, due to its use of AccountIdentifiers, cannot fulfill this requirement. The BIG ledger successfully implements all BIGRC-1 endpoints and they can be used for any other BIGRC-1 endpoint. Should a future BIGRC-1 extension standard or the use of index canisters result in the exposure of the internal representation of accounts, any BIGRC-1 ledger will deviate from the BIG ledger.

Index canisters

The BIG ledger lets you query created blocks through various endpoints. See the documentation on how to interact with the BIG ledger for more info. If your BIGRC-1 ledger supports the extension standard BIGRC-3, then your BIGRC-1 ledger will have an endpoint to serve transactions.

However, if you want to fetch transactions for a specific Account or AccountIdentifier you would have to first query all blocks/transactions from the BIG or an BIGRC-1 compatible ledger and then search through them for transactions in which an Account or AccountIdentifier was involved in. To solve this issue index canisters exist. The index canisters allow for querying of transaction lists for a specific account. Furthermore, they offer endpoints for querying the current balance of an account and you can also fetch blocks from one of their endpoints.

There are two different types of index canisters, one for the BIG ledger and one for BIGRC-1 compatible ledgers. Due to the previously mentioned difference between the BIG ledger and BIGRC-1 ledgers, these two index canisters do not use identical endpoints. Since one uses Account and the other uses AccountIdentifier as an internal representation of accounts, the returned transactions will differ in this regard.

The BIG index canister is running on the NNS subnet with the canister ID qhbym-qaaaa-aaaaa-aaafq-cai. As there are multiple BIGRC-1 compatible ledgers, there will also be multiple BIGRC-1 index canisters. For example, the BIGRC-1 ledger recording ckBTC transactions is running under the canister ID n5wcd-faaaa-aaaar-qaaea-cai.