<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/OnionService/privateKey",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor12OnionServiceV10privateKeySSSgvp"
  },
  "title" : "privateKey"
}
-->

# privateKey

Base64-encoded ED25519-V3 private key, or `nil` if discarded.

```
let privateKey: String?
```

## Discussion

Populated when `ADD_ONION` was called **without** `DiscardPK`.
Persist in a secure store to later re-adopt the service via
[`OnionKeySpec.providedV3(_:)`](/documentation/Tor/OnionKeySpec/providedV3(_:)). `nil` indicates the key was
generated with `discardPrivateKey: true` and cannot be recovered.

> Important: Secret material — see the type-level `Important`
> note on storage.