---
# System prepended metadata

title: DID Intro

---

# DID Intro

`did:ion:pfi1`: A fully qualified URI

- DIDs resolve into a DID Document

```json
{
    "service": [{
        "serviceEndpoint": {
            "host": "https://tbdex.pfi.org"
        }
    }]
}
```

```java
import io.javalin.Javalin;

public class HelloWorld {
    public static void main(String[] args) {
         InMemoryMessageThreadStore messageThreadStore = new InMemoryMessageThreadStore();
        MessageThreadProcessor pfi =
            new MessageThreadProcessor.Builder(messageThreadStore)
                .registerProcessor(MessageType.Ask, new AskProcessor())
                .registerProcessor(MessageType.OfferAccept, new OfferAcceptProcessor())
                .build();

        Ask ask = new Ask("USD", 100, "USDC");

        Message message =
            new Message.Builder("id", "threadID", "from", "to")
                    .createdTime(Instant.now())
                    .build(ask);

        Message reply = pfi.addMessage(message);
        
        Javalin app = Javalin.create().start(7070);
        
        app.post("/", ctx -> {
            JSONObject requestPayload = ctx.request().json();
            Message reply = pfi.addMessage(requestPayload);
            
            return reply;
        });
    }
}
```