# Wallet Transaction Signing API (Functional)

> This ARC is intended to be completely compatible with [ARC-1](https://dev.algorand.co/arc-standards/arc-0001).

## Abstract

ARC-1 defines a standard for signing transactions with security in mind. This proposal is a strict subset of ARC-1 that outlines only the minimum functionality required in order to be usable.

Wallets that conform to ARC-1 already conform to this API.

Wallets conforming to [ARC-5](https://dev.algorand.co/arc-standards/arc-0005) but not ARC-1 **MUST** only be used for testing purposes and **MUST NOT** be used on MainNet. This is because this ARC-5 does not provide the same security guarantees as ARC-1 to protect properly wallet users.

## Specification

The key words “ **MUST**”, “ **MUST NOT**”, “ **REQUIRED**”, “ **SHALL**”, “ **SHALL NOT**”, “ **SHOULD**”, “ **SHOULD NOT**”, “ **RECOMMENDED**”, “ **MAY**”, and “ **OPTIONAL**” in this document are to be interpreted as described in [RFC-2119](https://www.ietf.org/rfc/rfc2119.txt).

> Comments like this are non-normative.

### Interface `SignTxnsFunction`

Signatures are requested by calling a function `signTxns(txns)` on a list `txns` of transactions. The dApp may also provide an optional parameter `opts`.

A wallet transaction signing function `signTxns` is defined by the following interface:

```
export type SignTxnsFunction = (

txns: WalletTransaction[],

opts?: SignTxnsOpts,

)

=> Promise<(SignedTxnStr | null)[]>;
```

- `SignTxnsOpts` is as specified by [ARC-1](https://dev.algorand.co/arc-standards/arc-0001#interface-signtxnsopts).
- `SignedTxnStr` is as specified by [ARC-1](https://dev.algorand.co/arc-standards/arc-0001#interface-signedtxnstr).

A `SignTxnsFunction`:

- expects `txns` to be in the correct format as specified by `WalletTransaction`.

### Interface `WalletTransaction`

```
export interface WalletTransaction {

/**

* Base64 encoding of the canonical msgpack encoding of a Transaction.

*/

txn: string;
}
```

### Semantic requirements

- The call `signTxns(txns, opts)` **MUST** either throw an error or return an array `ret` of the same length as the `txns` array.
- Each element of `ret` **MUST** be a valid `SignedTxnStr` with the underlying transaction exactly matching `txns[i].txn`.

This ARC uses interchangeably the terms “throw an error” and “reject a promise with an error”.

`signTxns` **SHOULD** follow the error standard specified in [ARC-0001](https://dev.algorand.co/arc-standards/arc-0001#error-standards).

### UI requirements

Wallets satisfying this ARC but not [ARC-0001](https://dev.algorand.co/arc-standards/arc-0001) **MUST** clearly display a warning to the user that they **MUST** not be used with real funds on MainNet.

## Rationale

This simplified version of ARC-0001 exists for two main reasons:

1. To outline the minimum amount of functionality needed in order to be useful.
2. To serve as a stepping stone towards full ARC-0001 compatibility.

While this ARC **MUST** not be used by users with real funds on MainNet for security reasons, this simplified API sets a lower bar and acts as a signpost for which wallets can even be used at all.

## Security Considerations

None.

## Copyright

Copyright and related rights waived via [CCO](https://creativecommons.org/publicdomain/zero/1.0/).
