# `Spectre.GAM.Principal`
[🔗](https://github.com/elchemista/spectre/blob/0.4.0/lib/spectre/gam/principal.ex#L1)

Portable identity named by a domain's genesis or later governance acts.

A principal identifies a participant; it does not, by itself, grant any
authority.  Authority is carried exclusively by mandates.

# `t`

```elixir
@type t() :: %Spectre.GAM.Principal{
  attributes: map(),
  display_name: String.t() | nil,
  kind: :human | :organization | :service | :agent | :system,
  ref: String.t(),
  schema_version: 1
}
```

# `canonical`

```elixir
@spec canonical(t()) :: map()
```

Returns the plain, string-keyed ledger representation.

# `content_ref`

```elixir
@spec content_ref(t()) :: String.t()
```

Returns the content-derived reference, independent of an assigned `ref`.

# `digest`

```elixir
@spec digest(t()) :: String.t()
```

Returns the stable digest of the complete canonical record.

# `from_canonical`

```elixir
@spec from_canonical(map()) :: {:ok, t()} | {:error, term()}
```

Restores a principal from its canonical map.

# `new`

```elixir
@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, term()}
```

Builds and validates a principal.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
