Skip to main content

Read Signature Outputs

GET /multisigs/outputs

Endpoint URL

 https://api.mixin.one/multisigs/outputs?members=:members&threshold=:threshold&state=:state&offset=:offset&limit=:limit&order=created

Authentication and options

Authorization
Authorized
LimitationNo limitation

Parameters

membersused together with threshold to participate in the hash of multi-signature members.
thresholdinteger, used with members, multi-signature threshold, for example, 2/3, threshold = 2
stateOptional, the states of UTXO, e.g. unspent, signed, and spent.
offsetOptional, pagination start time, RFC3339Nano format, e.g. `2020-12-12T12:12:12.999999999Z`.
limitOptional, pagination per page data limit, 500 by default, maximally 500
orderOptional, 'created' || 'updated', updated_at by default, asc only

If an account participates in multiple multi-signatures, the data can be filtered through the members and threshold parameters.

Here is the golang code for generating the multi-signature member hash:

func hashMembers(ids []string) string {
sort.Slice(ids, func(i, j int) bool { return ids[i] < ids[j] })
var in string
for _, id := range ids {
in = in + id
}
return crypto.NewHash([]byte(in)).String()
}

Example request

curl -i -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" https://api.mixin.one/multisigs/outputs?members=:members&threshold=:threshold&limit=500&offset=2006-01-02T15:04:05.999999999Z&state=spent&order=created
Response
{
"data": [
{
"type": "multisig_utxo",
"user_id": "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"utxo_id": "a465ffdb-4441-4cb9-8b45-00cf79dfbc46",
"asset_id": "43d61dcd-e413-450d-80b8-101d5e903357",
"transaction_hash": "29828149577920ccc9d90768012f95768b7d1a925c4189b912c343dbb000180e",
"output_index": 0,
"amount": "10",
// The number of members must reach the threshold to make a transaction effective.
"threshold": "2",
// The members participating the multi-signature.
"members": [
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"ab56be4c-5b20-41c6-a9c3-244f9a433f35"
],
"memo": "hello",
"state": "spent",
"sender: "ab56be4c-5b20-41c6-a9c3-244f9a433f35",
"signed_tx": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"signed_by": "298281....4952f95768b7d1a925c4189b912c343dbb000180e",
"created_at": "2018-05-03T10:08:34.859542588Z",
"updated_at": "2018-05-03T10:08:34.859542588Z"
},
...
]
}

In which, signed_tx and signed_by have values when the state is signed. signed_by represents the transaction hash, and signed_tx is the complete transaction content, signed_by can help sort the corresponding waiting list of transactions.