> For the complete documentation index, see [llms.txt](https://docs.bosonnetwork.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bosonnetwork.io/build-services/build-services.md).

# Overview

This section is for developers who extend Boson with their own layer-2 services. The service SPI is open source: a service is a Java library that a super node loads next to the built-in services. The four built-in services, described under [Layer-2 Services](/core-concepts/services.md), are the reference designs.

***

## The Boson service model

A Boson service:

1. **Has an identity** - an Ed25519 key pair whose public key is the service's **peer id**.
2. **Announces itself** in the DHT as a peer record, so clients find it by peer id rather than a fixed address.
3. **Authenticates callers** with CWT bearer tokens, accepting users and devices registered on its super node.
4. **Speaks its own protocol** - HTTPS, MQTTS, TCP or anything else.

***

## How a super node runs services

The Director:

1. Finds service implementations on its classpath through Java's `ServiceLoader`, by their `BosonServiceFactory`.
2. Reads `services.d/`, where each file `<order>_<type>[_<instance>].yaml` configures one instance of a service type.
3. For each file, creates the service, gives it a `ServiceContext` - its node, data directory, configuration, TLS certificate, and access to the node's accounts and federation - then starts the services in order.

A service that does not configure its own `privateKey` gets a key derived from the node's key, its type and its instance, so an operator backs up only the node's key.

***

## In this section

* [Announce and Discover](/build-services/announce-discover.md): publishing a peer record and being found
* [Authenticating Clients](/build-services/authenticating-clients.md): accepting tokens from the node's users and devices
* [Custom Service](/build-services/custom-service.md): writing and deploying a service
* [Service Federation](/build-services/service-federation.md): working across super nodes
* The built-in services, as reference designs, are described under [Layer-2 Services](/core-concepts/services.md)

For operator configuration, see [Configuring Services](/configure-a-node/services-config.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 dynamically by asking a question.

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

```
GET https://docs.bosonnetwork.io/build-services/build-services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
