Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 39 additions & 1 deletion modules/sdk-coin-canton/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,45 @@ const sdk = new BitGoAPI();
sdk.register('canton', Canton.createInstance);
```

## Development
## Block lookup

Canton block identifiers are ledger offsets rather than conventional blockchain
block hashes. A ledger can be reset, so the offset is only unique together with
the ledger version.

When looking up a Canton block, use the transfer's `heightId` value from the
Get Transfer API response as the `{height}` path parameter. Do not use the
plain numeric `height` value: it represents only the ledger offset and can
refer to a different ledger after a reset.

```text
GET /api/v2/canton/public/block/{heightId}
```

For example, a transfer response containing:

```json
{
"height": 6291143,
"heightId": "006291143-6a85688d879741a95e3940b671adb39b"
}
```

must be followed by:

```text
GET /api/v2/canton/public/block/006291143-6a85688d879741a95e3940b671adb39b
```

A request using `/public/block/6291143` can return `block not found`, even
when the transfer exists. The `heightId` is the canonical Canton block
identifier and includes both the offset and the ledger version.

This is a Canton-specific exception to the usual block lookup pattern. For
other coins, use the block identifier documented for that coin; for coins
with conventional, non-resetting block heights, the numeric `height` can be
used. No other coin-specific `heightId` exception is defined by this package.


Most of the coin implementations are derived from `@bitgo/sdk-core`, `@bitgo/statics`, and coin specific packages. These implementations are used to interact with the BitGo API and BitGo platform services.

Expand Down
Loading