Skip to main content

Send Multisigs Requests

Multisigs need to first generate a multi-signature request to obtain request_id, and then initiate the multi-signature operation.

Generating Multisig Requests

POST /multisigs/requests

Generate a multi-signature request.

Endpoint URL

 https://api.mixin.one/multisigs/requests

Authentication and options

Authorization
Authorized
LimitationNo limitation

Payload

{
"action": "Operations: could be 'sign' or 'unlock'",
"raw": "For transactions generated in accordance with the mainnet specifications"
}
info

raw is a transaction with mainnet specification. Refer to the implementation in Go and JS provided by our code

Example request

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/multisigs/requests --data '{"action": "sign", "raw": "298281....4952f95768b7d1a925c4189b912c343dbb000180e"}'
Response
{
"data": {
"type": "multisig_request",
"request_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"user_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"asset_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "10",
"threshold": "2",
"senders": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"receivers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"signers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"memo": "hello",
"action": "sign",
"state": "spent",
"transaction_hash": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"raw_transaction": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"created_at": "2018-05-03T10:08:34.859542588Z",
"code_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35"
}
}

Initiating A Multi-signature

POST /multisigs/requests/:id/:action

Endpoint URL

 https://api.mixin.one/multisigs/requests/:id/:action

Authentication and options

Authorization
Authorized
LimitationNo limitation

Parameters

action
*required
Operations: could be `sign`, `cancel`, and `unlock`
pin_base64Encrypted PIN.
pin
*required

how to generate TIP Pin

"TIP:MULTISIG:REQUEST:SIGN:" + request_id

pin_base64 of sign multisig is the sha256-256 sum of above value

"TIP:MULTISIG:REQUEST:UNLOCK:" + request_id

pin_base64 of unlock multisig is the sha256-256 sum of above value

Example request

curl -i -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/multisigs/requests/:id/:action --data '{"pin": "YOUR_PIN"}'
Response
{
"data": {
"type": "multisig_request",
"request_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"user_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"asset_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"amount": "10",
"threshold": "2",
"senders": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"receivers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"signers": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"memo": "hello",
"action": "sign",
"state": "spent",
"transaction_hash": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"raw_transaction": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"created_at": "2018-05-03T10:08:34.859542588Z",
"code_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35"
}
}

Operations

Initiate or participate in signing

// Generate multisig request.
POST /multisigs/requests
{
"action": "sign",
"raw": "298281....000180e"
}

// Sign multisig request.
POST /multisigs/requests/:id/sign

Cancel my signature

// Generate multisig request.
POST /multisigs/requests
{
"action": "cancel",
"raw": "298281....000180e"
}

// Send multisig cancelling request.
POST /multisigs/requests/:id/cancel

Cancel multisigs

// Generate multisig request.
POST /multisigs/requests
{
"action": "unlock",
"raw": "298281....000180e"
}

// Send multisig unlocking request.
POST /multisigs/requests/:id/unlock