> For the complete documentation index, see [llms.txt](https://shinkalabs.gitbook.io/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shinkalabs.gitbook.io/hub/andromeda/guides/signing-pipeline.md).

# The signing pipeline

Signing with a dWallet is a small set of composable steps. You rarely need all of them at once; most applications run DKG once, keep a pool of presignatures warm, and call sign on demand.

```
DKG (once per wallet)
  -> Presign (build presignatures)
       -> Sign (consume one presignature + message hash -> raw signature)

Variants:
  Future-Sign         pre-authorise now, complete later on a condition
  Imported Key        bring an existing key under management instead of DKG
  Re-Encrypt Share    move the user-side share to a new holder
  Make Share Public   publish the user-side share (changes the trust model)
```

## DKG

Distributed Key Generation creates the dWallet and produces its public key. `POST /v1/dwallet/dkg/prepare` starts the round; `POST /v1/dwallet/dkg/submit` completes it. Heavier than a normal call, longer timeout. Run it once per wallet. See [Create a dWallet](/hub/andromeda/getting-started/create-dwallet.md).

## Presign

Presignatures are the expensive precomputation that makes signing fast. `POST /v1/dwallet/presign/submit` generates them; `GET /v1/dwallet/presigns/{userPubkey}` reports how many are left. Generate them when the system is idle, not in the critical path of a user action.

## Sign

`POST /v1/dwallet/sign/submit` takes the dWallet address and a 32-byte message hash, consumes one presignature, and returns a raw signature in the dWallet's curve. You build and broadcast the destination-chain transaction yourself. See [Sign a message](/hub/andromeda/getting-started/sign.md).

## Future-Sign

`POST /v1/dwallet/future-sign/submit` pre-authorises a signature; `POST /v1/dwallet/future-sign/complete/submit` produces it when the condition is met. Pair this with a [Future-Sign trigger](/hub/andromeda/guides/future-sign.md) (oracle, slot, event, or external webhook) so Andromeda fires the completion for you.

## Imported keys

Instead of DKG, import an existing key so a wallet with on-chain history keeps its address. See the import endpoints in the [OpenAPI spec](https://api.andromedainfra.pro/openapi.json).

## Share management

`POST /v1/dwallet/re-encrypt-share/submit` re-encrypts the user-side share to a new holder. `POST /v1/dwallet/make-share-public/submit` publishes it. The second one materially changes the dWallet's security; treat it as a deliberate, audited action.

## With a policy attached

If a policy program holds the dWallet authority, every Sign and Future-Sign must satisfy it (allowlist, velocity, quorum, confidential check, and so on). The policy is enforced on-chain. See [On-chain policies](/hub/andromeda/concepts/policies.md).

## Operational notes

* Use [`Idempotency-Key`](/hub/andromeda/guides/idempotency.md) on every submit.
* Use [Dry-run / Simulate](/hub/andromeda/guides/simulate.md) before high-stakes signs.
* Use [Auto-batching](/hub/andromeda/guides/batching.md) when you have many signature requests to land.


---

# 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:

```
GET https://shinkalabs.gitbook.io/hub/andromeda/guides/signing-pipeline.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.
