> For the complete documentation index, see [llms.txt](https://docs.bitsafe.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bitsafe.finance/beth/get-started/developer-quick-start.md).

# Developer quick start

[BETH overview](/beth/overview.md) · [BETH environments and prerequisites](/beth/get-started/environments-and-prerequisites.md)

### What you will do

1. Prepare a supported Rust environment.
2. Check out a pinned `bitsafe-token-lib` release.
3. Configure Canton and authentication values without committing secrets.
4. Run the balance-check example.
5. Verify that the response belongs to the intended party.

This read-only outcome is intentionally smaller than minting or transferring BETH. It verifies the core connection before you create accounts or submit ledger changes.

### Prerequisites

* Access to an approved development or test environment.
* A supported Canton participant and party.
* Approved authentication credentials for that party.
* Git and a compatible Rust toolchain.
* Network access to the Canton participant and identity provider.
* A secure local method for storing environment values.

### 1. Check out the reviewed source

```bash
git clone https://github.com/DLC-link/bitsafe-token-lib.git
cd bitsafe-token-lib
git checkout v0.2.0
```

Use an approved release tag. Do not use `main` in production instructions.

### 2. Create local configuration

```bash
cp .env.example .env
```

Fill only the values required for the balance check:

* Canton JSON Ledger API host, including the API path.
* Target Canton party.
* Approved identity-provider and client values required by the selected authentication flow.
* The `ENVIRONMENT` value: `devnet`, `testnet`, or `mainnet`.
* The `ASSET` value: `beth`.

Do not paste real credentials into documentation, issue reports, shell history, or source control.

### 3. Build the example

```bash
cargo build --example check_balance
```

A successful build confirms that the selected Rust toolchain can resolve the pinned BETH and shared Canton dependencies.

### 4. Run the balance check

```bash
cargo run --example check_balance
```

### Expected result

The command should:

* Authenticate successfully.
* Query active BETH holdings for the configured party. The query keeps only holdings whose instrument ID and admin both match the BETH instrument.
* Report the party’s balance and holding count, including a valid zero-balance result where applicable.
* Exit without exposing access tokens or passwords.

{% hint style="info" %}
Output fields vary by supported release and environment. Verify the response belongs to the intended party, and never substitute a fabricated balance or contract identifier when testing an integration.
{% endhint %}

### If the check fails

| Symptom                  | Check                                                                     | Next action                                                                 |
| ------------------------ | ------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| Authentication fails     | Provider URL, realm or audience, client, grant type, secret, token claims | Use the canonical Authentication guide and confirm the party authorization. |
| Connection fails         | Ledger host, DNS, TLS, proxy, and network access                          | Verify the participant endpoint with the environment owner.                 |
| No holdings are returned | Target party, environment, and whether zero balance is valid              | Confirm the configured party before attempting a state-changing operation.  |
| Build or type errors     | Checked-out tag, Rust toolchain, lockfile, and shared library access      | Return to the approved compatibility matrix.                                |
| Response parsing fails   | Canton and library compatibility                                          | Capture sanitized output and escalate with the version set.                 |

### Next steps

After the balance check passes, choose one task:

* [Transfer and receive BETH](/beth/guides/transfer-and-receive-beth.md).
* Create a deposit account and follow [Mint BETH](/beth/guides/mint-beth.md).
* Create a withdrawal account and follow [Redeem BETH](/beth/guides/redeem-beth.md).
* Use [BETH SDK, API, and integration reference](/beth/concepts-and-reference/sdk-api-and-integration-reference.md) to integrate balance and transfer behavior into a wallet or application.

### Technical sources

* [`bitsafe-token-lib` `v0.2.0`](https://github.com/DLC-link/bitsafe-token-lib/tree/v0.2.0)
* [Balance-check example](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/examples/check_balance.rs)
* [Examples guide](https://github.com/DLC-link/bitsafe-token-lib/blob/v0.2.0/examples/README.md)

### Related pages

* [Install and validate BETH DARs](/beth/get-started/install-and-validate-dars.md)
* [BETH authentication](/beth/get-started/authentication.md)
* [Mint BETH](/beth/guides/mint-beth.md)
* [Redeem BETH](/beth/guides/redeem-beth.md)
* [Transfer and receive BETH](/beth/guides/transfer-and-receive-beth.md)
* [BETH SDK, API, and integration reference](/beth/concepts-and-reference/sdk-api-and-integration-reference.md)
* [BETH errors, retries, and troubleshooting](/beth/concepts-and-reference/errors-retries-and-troubleshooting.md)

### Next step

👉 **Build your first workflow:** [Transfer and receive BETH](/beth/guides/transfer-and-receive-beth.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bitsafe.finance/beth/get-started/developer-quick-start.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
