# `Bourse.Signing.Lighter`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/signing/lighter.ex#L1)

Lighter zk-Schnorr signing through an isolated official Go helper.

The API signing key crosses stdin exactly once into a per-key external OS
process. The helper is temporary and terminating it removes that key from the
signing subsystem. Network transport remains in `Bourse.HTTP`.

# `signing_error`

```elixir
@type signing_error() ::
  {:lighter_signing,
   :invalid_credentials
   | :invalid_configuration
   | :helper_unavailable
   | :helper_terminated
   | Bourse.Signing.Lighter.Protocol.protocol_error()}
```

# `sign_transaction`

```elixir
@spec sign_transaction(
  Bourse.Signing.Lighter.Protocol.operation(),
  map(),
  Bourse.Credentials.t(),
  map()
) ::
  {:ok, Bourse.Signing.Lighter.Protocol.signed_transaction()}
  | {:error, signing_error()}
```

Signs a supported Lighter transaction using the same per-key helper.

# `terminate_helper`

```elixir
@spec terminate_helper(Bourse.Credentials.t(), map()) ::
  :ok | {:error, signing_error()}
```

Terminates the helper that owns these credentials.

---

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