# Authentication

TaxSplit uses wallet-based authentication with JWT tokens. Obtain a token via the challenge-verify flow, then include it in the `Authorization` header for authenticated endpoints.

### Challenge → verify flow

{% stepper %}
{% step %}

### Request a challenge

Call `POST /auth/challenge` with the user’s wallet address.
{% endstep %}

{% step %}

### Sign the message

Sign the returned `challenge` string with the user’s Solana wallet.
{% endstep %}

{% step %}

### Verify the signature

Call `POST /auth/verify` with the wallet address, signature, and signed message to receive a JWT.
{% endstep %}

{% step %}

### Send the JWT

Include the token in every authenticated request:

`Authorization: Bearer <token>`
{% endstep %}
{% endstepper %}

### Token expiry

* Token expires in: **7 days**

### Related

* [Auth endpoints](/api-reference/readme/auth-endpoints.md)
* [Error handling](/api-reference/readme/error-handling.md)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.taxsplit.app/api-reference/readme/authentication.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
