# `Cartouche.Solana.SystemProgram`
[🔗](https://github.com/zenhive/cartouche/blob/main/lib/cartouche/solana/system_program.ex#L1)

Instructions for the Solana System Program.

The System Program (address: `11111111111111111111111111111111`, 32 zero bytes)
handles basic operations like SOL transfers and account creation.

# `create_account`

```elixir
@spec create_account(
  &lt;&lt;_::256&gt;&gt;,
  &lt;&lt;_::256&gt;&gt;,
  non_neg_integer(),
  non_neg_integer(),
  &lt;&lt;_::256&gt;&gt;
) ::
  Cartouche.Solana.Transaction.Instruction.t()
```

Build a create_account instruction.

System Program instruction index 0.

## Examples

    iex> ix = Cartouche.Solana.SystemProgram.create_account(<<1::256>>, <<2::256>>, 1_000_000, 165, <<3::256>>)
    iex> ix.program_id
    <<0::256>>
    iex> byte_size(ix.data)
    52

# `program_id`

```elixir
@spec program_id() :: &lt;&lt;_::256&gt;&gt;
```

Returns the System Program pubkey (32 zero bytes).

Delegates to `Cartouche.Solana.Programs.system_program/0`.

# `transfer`

```elixir
@spec transfer(&lt;&lt;_::256&gt;&gt;, &lt;&lt;_::256&gt;&gt;, non_neg_integer()) ::
  Cartouche.Solana.Transaction.Instruction.t()
```

Build a transfer instruction (SOL transfer).

System Program instruction index 2.

## Examples

    iex> ix = Cartouche.Solana.SystemProgram.transfer(<<1::256>>, <<2::256>>, 1_000_000_000)
    iex> ix.program_id
    <<0::256>>
    iex> byte_size(ix.data)
    12

---

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