MIP Proposal: Mina Provider API

MIP Proposal: Mina Provider API

This proposal introduces a standardized Provider API for Mina Protocol wallets, account providers, and public providers. The goal is to establish a consistent interface for zkApp developers to interact with user accounts, inspired by the widely adopted EIP-1193 and EIP-1474 standards in Ethereum.

The specification in this proposal is intentionally brief, including only the necessary methods and events to facilitate easy adoption. Once current Mina wallets adopt this specification, more elaborate extensions can be designed in the future.

Auro Wallet currently uses an object format for params instead of the array format. While the object format is valid according to the JSON-RPC 2.0 Specification, this proposal uses the array format because it aligns with the conventions of other major blockchains, making it easier for multichain wallets to support.

Motivation

Currently, major Mina wallets such as Auro Wallet and Pallad expose differing JavaScript Provider APIs, requiring zkApp developers to maintain separate integration code for each wallet. This fragmentation increases development complexity, testing overhead, and the risk of bugs.

Furthermore, without a defined standard, new wallet or account provider developers may introduce additional incompatible APIs, worsening the issue and hindering ecosystem growth.

A unified standard would:

  • Enable seamless multi-wallet support for zkApps.
  • Provide clear guidance for new wallet implementations.
  • Reduce developer friction and accelerate zkApp adoption.
  • Facilitate better user experiences, such as easy wallet switching.

RFC-0008 already exists but has some flaws that can be improved, such as:

  • Lack of methods for connecting and disconnecting the wallet.
  • Use of chainId instead of networkId (the term used in both Auro Wallet and Pallad), and referring to it as a hexadecimal value while Mina’s network ID is a string.

Proposal

We propose the formal adoption of the Mina Provider API, an EIP-1193-style provider with methods as defined below.

The provider implements:

  • request(args: { method: string; params?: array }): Promise<unknown>
  • Event subscription via on(eventName: string, listener: Function): void and removeListener(eventName: string, listener: Function): void

All methods use positional parameters (array format) as per JSON-RPC conventions adopted by major providers.

Specification

Public Provider Methods

mina_blockHash

Description

Returns the hash of the latest block.

Parameters

(none)

Returns

string - the current block hash

Example
// Request
{
    "method": "mina_blockHash",
    "params": []
}

// Response
{
    "result": "3NLeFzJBrAKh4BhpHFcs1DaPFkTKemgBdTY2W1EFYtrHJHfiC96Q"
}

mina_networkId

Description

Returns the current network ID.

Parameters

(none)

Returns

string - the network ID (e.g., “mina:mainnet”, “mina:devnet”)

Example
// Request
{
    "method": "mina_networkId",
    "params": []
}

// Response
{
    "result": "mina:mainnet"
}

mina_getBalance

Description

Returns the balance of a given account.

Parameters
  1. string - account public key (address)
  2. string (optional) - token ID
Returns

string - balance as a string quantity

Example
// Request
{
    "method": "mina_getBalance",
    "params": ["B62qoYJCCwNSGRw73ww5eNCZnKCvjoEtrqr9UxuLnVHamDBEwSXjaw3", "1"]
}

// Response
{
    "result": "5000000000"
}

mina_getTransactionCount

Description

Returns the transaction nonce for a given account.

Parameters
  1. string - account public key (address)
Returns

string - nonce as a string quantity

Example
// Request
{
    "method": "mina_getTransactionCount",
    "params": ["B62qoYJCCwNSGRw73ww5eNCZnKCvjoEtrqr9UxuLnVHamDBEwSXjaw3"]
}

// Response
{
    "result": "42"
}

mina_sendSignedTransaction

Description

Submits a signed transaction to the network.

Parameters
  1. object - signed transaction object
Returns

string - transaction hash

Example
// Request
{
    "method": "mina_sendSignedTransaction",
    "params": [{
        "signature": {
            "field":"2270917456437054151866310845889777237190541188364956508055930611671093285487",
            "scalar":"21449516654198770916732742168324673178939547645509705487897779421915836159965"
        },
        "input": {
            "to": "B62qpSphT9prqYrJFio82WmV3u29DkbzGprLAM3pZQM2ZEaiiBmyY82",
            "from": "B62qpSphT9prqYrJFio82WmV3u29DkbzGprLAM3pZQM2ZEaiiBmyY82",
            "fee": "10000000",
            "amount": "1000000000",
            "nonce": "33",
            "memo": "Offline Payment",
            "validUntil": "4294967295"
        }
    }]
}

// Response
{
    "result": "5Ju...txhash..."
}

Wallet Provider Methods

mina_accounts

Description

Returns the accounts currently connected to the dApp.

Parameters

(none)

Returns

array<string> - list of account public keys

Example
// Request
{
    "method": "mina_accounts",
    "params": []
}

// Response
{
    "result": ["B62q1...", "B62q2..."]
}

mina_requestAccounts

Description

Prompts the user to connect accounts.

Parameters

(none)

Returns

array<string> - list of connected account public keys

Example
// Request
{
    "method": "mina_requestAccounts",
    "params": []
}

// Response
{
    "result": ["B62q..."]
}

mina_networkId

Description

Returns the current network ID.

Parameters

(none)

Returns

string - the network ID (e.g., “mina:mainnet”, “mina:devnet”)

Example
// Request
{
    "method": "mina_networkId",
    "params": []
}

// Response
{
    "result": "mina:mainnet"
}

mina_addChain

Description

Requests to add a new network configuration.

Parameters
  1. object - chain configuration (including url)
Returns

null

Example
// Request
{
    "method": "mina_addChain",
    "params": [{
        "url": "https://api.minascan.io/node/devnet/v1/graphql"
    }]
}

// Response
{
    "result": null
}

mina_switchChain

Description

Requests to switch to a different network.

Parameters
  1. string - target network ID
Returns

null

Example
// Request
{
    "method": "mina_switchChain",
    "params": ["mina:devnet"]
}

// Response
{
    "result": null
}

mina_signTransaction

Description

Requests the wallet to sign a transaction without sending it.

Parameters
  1. object - transaction request (of type TransactionRequest as used in the reference implementation)
Returns

object - signed ZkappCommand or Signature

Example
// Request
{
    "method": "mina_signTransaction",
    "params": [{
        "to": "B62qpSphT9prqYrJFio82WmV3u29DkbzGprLAM3pZQM2ZEaiiBmyY82",
        "from": "B62qpSphT9prqYrJFio82WmV3u29DkbzGprLAM3pZQM2ZEaiiBmyY82",
        "fee": "10000000",
        "amount": "1000000000",
        "nonce": "33",
        "memo": "Offline Payment",
        "validUntil": "4294967295"
    }]
}

// Response
{
    "result": {
        "field":"2270917456437054151866310845889777237190541188364956508055930611671093285487",
        "scalar":"21449516654198770916732742168324673178939547645509705487897779421915836159965"
    }
}

mina_sendTransaction

Description

Requests the wallet to sign and send a transaction.

Parameters
  1. object - transaction request, same as for mina_signTransaction
Returns

string - transaction hash

Example
// Request
{
    "method": "mina_sendTransaction",
    "params": [{
        "to": "B62qpSphT9prqYrJFio82WmV3u29DkbzGprLAM3pZQM2ZEaiiBmyY82",
        "from": "B62qpSphT9prqYrJFio82WmV3u29DkbzGprLAM3pZQM2ZEaiiBmyY82",
        "fee": "100000000",
        "amount": "1000000000",
        "nonce": "33",
        "memo": "Offline Payment",
        "validUntil": "4294967295"
    }]
}

// Response
{
    "result": "5Ju...txhash..."
}

wallet_revokePermissions

Description

Revokes the current connection permissions.

Parameters

(none)

Returns

null

Example
// Request
{
    "method": "wallet_revokePermissions",
    "params": []
}

// Response
{
    "result": null
}

Events

The provider emits the following events:

chainChanged

If the network the Provider is connected to changes, it emits the chainChanged event.

Parameter

networkId: string

The new network ID as a string.

accountsChanged

If the accounts available to the Provider change (i.e., the result of mina_accounts would differ), it emits the accountsChanged event.

Parameter

accounts: array<string>

An array of account public keys (addresses).

message

The message event is for arbitrary notifications not covered by other events.

Parameter

message: { type: string; data: unknown }

This can be used for future extensions, such as subscription notifications if supported.

Reference Implementation

The proposed methods and types are directly derived from the TypeScript definitions in the Vimina project:

https://raw.githubusercontent.com/wagmina/vimina/9c304236f3a4813ced1d3569c504c9ba2adbe860/src/types/jsApiStandard.ts

This file defines PublicRpcSchema and WalletRpcSchema as the authoritative source.

Compatibility

The current APIs of Auro Wallet, Pallad, and RFC-0008 have been taken into consideration to minimize required changes and ensure a smooth transition and implementation.

Current wallets can continue to support both this standard and their existing formats until all zkApps update to the new standard.

Additionally, wagmina, developed by the author of this proposal, can be used to provide zkApp developers with a consistent interface regardless of the underlying wallet implementation, as demonstrated in Scaffold Mina.

Conclusion

Adopting this Mina Provider API standard represents a straightforward yet impactful step toward a more unified and developer-friendly ecosystem. It encourages wallet providers (Auro Wallet, Pallad, and emerging ones) to converge on a common interface.

Author: TheMonkeyCoder
Status: Draft

Community discussion and collaboration with wallet teams are welcomed to refine and implement this standard as an official MIP.

5 Likes

Hi!
I think the proposal is good and well structured. The idea of having a standard provider interface makes sense, and I mostly agree with the general direction. That said, there are a few points that are not fully clear to me.

First, error handling is not clearly defined. It is not very clear how a zkApp should be informed when an operation fails. There is no real error interface, and the proposal seems to rely only on the Promise reject. This may work for simple or immediate errors, but it feels a bit unclear and could be improved with a more explicit and structured error handling approach.

Another point is that some methods already exist in wallets like Clorio and Auro, but they are not included in the proposal (it would be useful to check how much they are actually used by zkApps):

  • signMessage
  • verifyMessage
  • signJsonMessage
  • verifyJsonMessage
  • signFields
  • verifyFields
  • createNullifier

These methods could technically be exposed using the “custom message methods” mentioned in the proposal. However, in my view, this is not the best solution. Since these methods are already defined and used today, it might be better to include them directly in the standard API. This would make the interface clearer and help improve compatibility between different wallets.

Thank you for your contribution to the project.

2 Likes

This is really great idea. Have you had any feedback from the Auro, Clorio and Pallad teams? Maybe @Cryptosaka could help too?

Is there funding available? @hgedia I think it’s a good strategy to implement.

Thanks for making the effort.

1 Like

Thanks .. we have requested more feedback from wallet teams auro/clorio & pallad on this initiative.

1 Like