---
# System prepended metadata

title: Mintacoin

---

# Mintacoin

![banner][banner-img]

[**Mintacoin**][www] is a minimalist and open-source API that abstracts the blockchain complexity and provides a simple and reliable infrastructure layer to mint your crypto assets and process payments with them.

Abstracting the blockchain complexity away, and combining the power of Elixir and Stellar, Mintacoin provides a simple and reliable infrastructure layer to mint crypto assets and process payments with them.

Reach the power of blockchain with just an API integration!

## Development

To start your Phoenix server:

  * Install dependencies with `mix deps.get`
  * Create and migrate your database with `mix ecto.setup`
  * Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

Run the tests with `mix test`.

## REST API

Minimalist API to run your crypto.

### Base URL

Currently, Mintacoin offers a Sandbox URL. Useful for testing and getting started with the API, the transactions are sent to the testnet of the supported blockchains.

```
https://sandbox.api.mintacoin.co
```

### Success response

A success response has the following format:

```javascript
{
  "data": {
      ...
  },
  "status": 200 | 201
}
```

##### Response parameters

| Parameter | Type    | Description                                                  |
| --------- | ------- | ------------------------------------------------------------ |
| `data`    | Map     | Contains the data returned by the endpoint you're accessing. |
| `status`  | Integer | HTTP response status code.                                   |


### Accounts

Group of endpoint to manage the account resource.

#### **Create account**
    
Creates an account on Mintacoin and in the given blockchain.

This endpoint returns the necessary to manage an account in Mintacoin: **address** (Mintacoin public key), **signature** (Mintacoin secret key), and **seed words** (to recover the signature).

##### Example requests

HTTP request:

```http
POST /accounts
```

Curl request:

```bash
curl -X POST \
     -H 'Content-Type: application/json' \
     -d '{"blockchain": "stellar"}' \
     "https://sandbox.api.mintacoin.co/accounts"
```

##### Body params

```json
{
  "blockchain": "stellar"
}
```

| Param        | Description                                                         |
| ------------ | ------------------------------------------------------------------- |
| `blockchain` | The blockchain in which the account's first wallet will be created. |

> Blockchains supported: `stellar`.

##### Response

```json
{
  "data": {
     "address": "D6J2KKOOXSTOXO36REKBPL3QH4FL2PCFKBK6W3TIOVMHR7DDVLTQ",
     "seed_words": "movie enrich merit census grid twice praise return glass wagon yard faint",
     "signature": "DCZIKJFUC6O5R2PVDDPB2C3XFGJL2ZCRKV66WNCPB4UDCP64HQLQ"
  },
  "status": 201
}
```

##### Response data parameters

| Parameter    | Type   | Description                                                                                                 |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------- |
| `address`    | String | Public key of your Mintacoin account.                                                                       |
| `signature`  | String | Secret key of your Mintacoin account. keep it safe and don't share it.                                      |
| `seed_words` | String | 12 words that you can use to recover your `signature` if you lost it, keep them safe, and don't share them. |

---

#### **Recover signature**
    
Recovers the `signature` with the `address` and the `seed_words` of an account.

##### Example requests

HTTP request:

```http
POST /accounts/:address/recover
```

Curl request:

```bash
curl -X POST \
     -H 'Content-Type: application/json' \
     -d '{"seed_words": "movie enrich merit census grid twice praise return glass wagon yard faint"}' \
     "https://sandbox.api.mintacoin.co/accounts/D6J2KKOOXSTOXO36REKBPL3QH4FL2PCFKBK6W3TIOVMHR7DDVLTQ/recover"
```

##### Body params

```json
{
  "seed_words": "movie enrich merit census grid twice praise return glass wagon yard faint"
}
```

| Param        | Description                   |
| ------------ | ----------------------------- |
| `seed_words` | Account's recover seed words. |

##### Response

```json
{
  "data": {
     "signature": "DCZIKJFUC6O5R2PVDDPB2C3XFGJL2ZCRKV66WNCPB4UDCP64HQLQ"
  },
  "status": 200
}
```

##### Response data parameters

| Parameter   | Type   | Description                           |
| ----------- | ------ | ------------------------------------- |
| `signature` | String | Secret key of your Mintacoin account. |

---
    
### Error response

An error response has the following format:

```json
{
 "code": "blockchain_not_found",
 "detail": "The introduced blockchain doesn't exist",
 "status": 400
}
```

##### Response parameters

| Parameter | Type    | Description                                                |
| --------- | ------- | ---------------------------------------------------------- |
| `code`    | String  | Result code of the response that communicates the failure. |
| `detail`  | String  | Description of the error response.                         |
| `status`  | Integer | Status code of the response.                               |

##### Standard error responses

| Code                   | Detail                                  | Status |
| ---------------------- | --------------------------------------- | ------ |
| `blockchain_not_found` | The introduced blockchain doesn't exist | 400    |
| `decoding_error`       | Address or seed words are invalid       | 400    |
| `invalid_address`      | The address is invalid                  | 400    |
| `invalid_seed_words`   | The seed words are invalid              | 400    |
| `encryption_error`     | Error during encryption                 | 400    |

## Changelog

Features and bug fixes are listed in the [CHANGELOG][changelog] file.

## Code of conduct

We welcome everyone to contribute. Make sure you have read the [CODE_OF_CONDUCT][coc] before.

## Contributing

For information on how to contribute, please refer to our [CONTRIBUTING][contributing] guide.

## License

This library is licensed under an MIT license. See [LICENSE][license] for details.

## Acknowledgements

Made with 💙 by [kommitters Open Source](https://kommit.co)

[license]: https://github.com/kommitters/mintacoin/blob/main/LICENSE
[coc]: https://github.com/kommitters/mintacoin/blob/main/CODE_OF_CONDUCT.md
[changelog]: https://github.com/kommitters/mintacoin/blob/main/CHANGELOG.md
[contributing]: https://github.com/kommitters/mintacoin/blob/main/CONTRIBUTING.md
[www]: https://mintacoin.co
[banner-img]: https://user-images.githubusercontent.com/1649973/170068587-1b4c1b0d-9b48-46d1-9aed-f99d1b2b84f8.png
