# Interface: Channel

Defined in: [packages/core/src/identity/channel.ts:74](https://github.com/leifriksheim/minca/blob/main/core/src/identity/channel.ts#L74)

Both sides' sealed channel. Each direction has its own key, and each message
is bound to its type and to its place in its direction (`seq`, from 0).

## Methods

### derive()

```ts
derive(label, length): Promise<Uint8Array<ArrayBufferLike>>;
```

Defined in: [packages/core/src/identity/channel.ts:80](https://github.com/leifriksheim/minca/blob/main/core/src/identity/channel.ts#L80)

Bytes only this exchange gives, under `label` with the transcript appended: pairing's short code

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `label` | `string` |
| `length` | `number` |

#### Returns

`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>

***

### open()

```ts
open(type, sealed): Promise<Uint8Array<ArrayBufferLike> | null>;
```

Defined in: [packages/core/src/identity/channel.ts:78](https://github.com/leifriksheim/minca/blob/main/core/src/identity/channel.ts#L78)

Opens the other side's next message; null for anything else, which leaves the count where it was

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `type` | `string` |
| `sealed` | `unknown` |

#### Returns

`Promise`\<`Uint8Array`\<`ArrayBufferLike`\> \| `null`\>

***

### seal()

```ts
seal(type, plaintext): Promise<string>;
```

Defined in: [packages/core/src/identity/channel.ts:76](https://github.com/leifriksheim/minca/blob/main/core/src/identity/channel.ts#L76)

Seals this side's next message: base64url of an envelope

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `type` | `string` |
| `plaintext` | `Uint8Array` |

#### Returns

`Promise`\<`string`\>
