> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dfns.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Java SDK

> Server-side SDK for integrating Dfns into Java backends, with typed clients, request signing, and helpers for wallets, transfers, and signatures.

<Warning>
  **This project is currently in Beta.**

  While we've worked hard to ensure its functionality, stability, and security, there may still be bugs, performance issues, or unexpected behavior.
</Warning>

The Java SDK is designed for **server-side/backend** applications. It handles request signing and provides typed access to the Dfns API.

You can find the repository [here](https://github.com/dfns/dfns-sdk-java).

**Requirements:** Java 17+.

## Quick start

### 1. Read-only operations

For read-only operations (listing wallets, fetching balances, etc.), you only need an auth token:

```java theme={null}
import co.dfns.sdk.*;

DfnsClientConfig config = DfnsClientConfig.builder()
    .authToken("your-auth-token")
    .build();

try (DfnsClient client = new DfnsClient(config)) {
    PaginatedList<co.dfns.sdk.wallets.model.Wallet> wallets =
        client.wallets.listWallets(new co.dfns.sdk.wallets.model.ListWalletsQuery());

    for (var wallet : wallets.items()) {
        System.out.printf("%s: %s %s%n", wallet.id(), wallet.network(), wallet.address());
    }
}
```

<Tip>
  For a quick test you can get your login token (short-lived) from the [Dfns Dashboard](https://app.dfns.io/) under `Settings` > `Personal Access Tokens`.
</Tip>

### 2. Signing requests

State-changing operations (creating wallets, signing transactions, etc.) require cryptographic request signing:

```java theme={null}
import co.dfns.sdk.*;
import co.dfns.sdk.auth.*;
import co.dfns.sdk.wallets.model.*;

import java.nio.file.Files;
import java.nio.file.Path;

byte[] privateKey = Files.readAllBytes(Path.of("private_key.der"));
Signer signer = KeySigner.fromEd25519PrivateKey("cr-...", privateKey);

DfnsClientConfig config = DfnsClientConfig.builder()
    .authToken("your-auth-token")
    .signer(signer)
    .build();

try (DfnsClient client = new DfnsClient(config)) {
    Wallet wallet = client.wallets.createWallet(
        new CreateWalletRequest(Network.EthereumSepolia, null, null, null, null, null, null)
    );
    System.out.printf("Created wallet: %s%n", wallet.id());
}
```

## Next steps

* **[Create a service account](/guides/developers/service-account)** for server-to-server authentication with long-lived tokens
* **[Development guide](/sdks/backend/java/development)** for detailed request signing architecture
