Skip to main content

TIR JSON-RPC API

All methods are invoked via POST /trusted-issuers-registry/v1/jsonrpc with the header x-api-key: <API_KEY>.


Data types

IssuerType

The issuerType field accepts the following string values (not the numeric values):

NameNumeric valueDescription
NONE0No role assigned. Not used directly in publications.
ROOT_TAO1Root Trusted Accreditation Organisation. Only ISBE can use it.
TAO2Trusted Accreditation Organisation.
TI3Trusted Issuer.
REVOKED4Revoked accreditation. Use to revoke an existing attribute.

Ethereum address (address)

Hexadecimal string with 0x prefix and 40 characters: 0x8445fC96e27ceB0d1794be16a1Ac8BF5D765AACB.

Hexadecimal string (hexstring)

String with 0x prefix followed by hexadecimal characters: 0x3f4143c6f3a1c79b....

DID

String with the prefix did:isbe:uc: or did:isbe:uc-pre: depending on the environment, followed by the DID identifier.


setAttributeMetadata

Builds an unsigned transaction that registers the role metadata of an issuer in the TIR contract. The resulting transaction must be signed by the owner of the key associated with the from field and sent with sendSignedTransaction.

Request

{
"jsonrpc": "2.0",
"method": "setAttributeMetadata",
"params": [
{
"from": "0x8445fC96e27ceB0d1794be16a1Ac8BF5D765AACB",
"did": "did:isbe:uc:zpxbBfHYA5GN45rS1tSEBJg",
"revisionId": "0x3f4143c6f3a1c79bb32f45a6cbd90ee6bb2e2e71eadda99e371a4a144c53050f",
"issuerType": "TI",
"taoDid": "did:isbe:uc:zj4sk7oEMx1SGNAzibWxVAV",
"attributeIdTao": "0xbd6123874c340eaea25a1fc01785593c350fd9216ed3a69864549f8013d501b4"
}
],
"id": 1
}

Parameters

FieldTypeMandatoryDescription
fromaddressEthereum address of who signs the transaction.
diddidDID of the subject to which the role is assigned.
revisionIdhexstringAttribute identifier in the TIR. Must match the reservedAttributeId of the accreditation. 64 hex chars + 0x prefix.
issuerTypeIssuerTypeRole to register: ROOT_TAO, TAO, TI, or REVOKED.
taoDiddidDID of the TAO (or RTAO) that accredits the subject. For revocation, use the same value as in the original publication.
attributeIdTaohexstringattributeId of the parent TAO accreditation in the TIR (prefixed with 0x).

Successful response

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0x8445fC96e27ceB0d1794be16a1Ac8BF5D765AACB",
"to": "0x00000000000000000000000000000000000015Be",
"data": "0x250f4d97...",
"value": "0x0",
"nonce": "0xb1d3",
"chainId": "0x...",
"gasLimit": "0x1000000",
"gasPrice": "0x0"
}
}

The result is an unsigned transaction. The to field is the TIR contract address.

Common errors

CodeCause
-32600Invalid or missing API Key.
-32602Missing parameter, invalid Ethereum address, incorrectly formatted DID, unknown issuerType.

setAttributeData

Builds an unsigned transaction that stores the complete accreditation JWT (hex-encoded) in the TIR contract. Must be executed after setAttributeMetadata for the same attribute.

Request

{
"jsonrpc": "2.0",
"method": "setAttributeData",
"params": [
{
"from": "0xD442e39AAd178Ec9DfD039aD048203D5d0122e61",
"did": "did:isbe:uc:zpxbBfHYA5GN45rS1tSEBJg",
"attributeId": "0x3f4143c6f3a1c79bb32f45a6cbd90ee6bb2e2e71eadda99e371a4a144c53050f",
"attributeData": "0x65794a6862476369..."
}
],
"id": 2
}

Parameters

FieldTypeMandatoryDescription
fromaddressEthereum address of who signs the transaction.
diddidDID of the subject to which the attribute belongs.
attributeIdhexstringSame revisionId used in setAttributeMetadata for this attribute.
attributeDatahexstringAccreditation JWT encoded as a hex string with 0x prefix. To convert: "0x" + Buffer.from(jwt_string).toString("hex").

attributeData encoding

The JWT generated by the CLI must be converted to hexadecimal before sending it. In Node.js:

const jwt = "eyJhbGciOiJFUzI1NiIs...";
const attributeData = "0x" + Buffer.from(jwt, "utf8").toString("hex");

Successful response

{
"jsonrpc": "2.0",
"id": 2,
"result": {
"from": "0xD442e39AAd178Ec9DfD039aD048203D5d0122e61",
"to": "0x00000000000000000000000000000000000015Be",
"data": "0x...",
"value": "0x0",
"nonce": "0xb1d4",
"chainId": "0x...",
"gasLimit": "0x1000000",
"gasPrice": "0x0"
}
}

sendSignedTransaction

Sends an already-signed transaction to the ISBE blockchain and returns the transaction hash. Use it to send each of the unsigned transactions obtained with setAttributeMetadata and setAttributeData.

The transaction is not processed immediately

sendSignedTransaction returns the hash as soon as the transaction enters the mempool. It does not guarantee that it has been included in a block or that it succeeded. You must query the receipt with eth_getTransactionReceipt and verify that status = 0x1.

Request

{
"jsonrpc": "2.0",
"method": "sendSignedTransaction",
"params": [
{
"protocol": "eth",
"unsignedTransaction": {
"from": "0x8445fC96e27ceB0d1794be16a1Ac8BF5D765AACB",
"to": "0x00000000000000000000000000000000000015Be",
"data": "0x250f4d97...",
"nonce": "0xb1d3",
"chainId": "0x...",
"gasLimit": "0x1000000",
"gasPrice": "0x0",
"value": "0x0"
},
"r": "0xf5649febb203...",
"s": "0x22d5188b34c3...",
"v": "0x1B",
"signedRawTransaction": "0xf9014c..."
}
],
"id": 3
}

Parameters

FieldTypeMandatoryDescription
protocolstringAlways "eth".
unsignedTransactionobjectUnsigned transaction object exactly as returned by setAttributeMetadata or setAttributeData.
unsignedTransaction.fromaddressEthereum address of the signer. Must match the actual transaction signer.
unsignedTransaction.toaddressTIR contract address.
unsignedTransaction.datahexstringTransaction payload (data field from the setAttributeMetadata/setAttributeData result).
unsignedTransaction.noncehexstringTransaction nonce.
unsignedTransaction.chainIdhexstringISBE network chain ID.
unsignedTransaction.gasLimithexstringGas limit.
unsignedTransaction.gasPricehexstringGas price (normally "0x0" in ISBE).
unsignedTransaction.valuehexstringValue in wei ("0x0").
rhexstringr component of the ECDSA signature.
shexstrings component of the ECDSA signature.
vhexstringv component of the ECDSA signature.
signedRawTransactionhexstringComplete serialized and signed transaction.

Server validations

The server verifies that:

  • signedRawTransaction is consistent with unsignedTransaction + (r, s, v).
  • The signer recovered from the signature matches unsignedTransaction.from.
  • The transaction chainId matches that of the server's network.
  • The to field points to the TIR contract configured on the server.

If any of these validations fail, the server returns -32602 without sending the transaction to the blockchain.

Successful response

{
"jsonrpc": "2.0",
"id": 3,
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}

The result is the transaction hash. Use it to query the receipt.

Query the transaction receipt

Query the Besu endpoint with the eth_getTransactionReceipt method:

curl -X POST <besu-rpc-url> \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionReceipt",
"params": ["0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"],
"id": 1
}'

Relevant receipt fields:

  • status: "0x1" = success, "0x0" = failure.
  • revertReason: reason for failure (if status = 0x0).

REST endpoint: read an accreditation

GET <base-url>/v1/issuers/{did}/attributes/{attributeId}

Authentication: none.

Path parameters:

ParameterDescription
didDID of the accreditation subject.
attributeIdAttribute identifier in the TIR. Without the 0x prefix.

Response 200 OK:

{
"did": "did:isbe:uc:zpxbBfHYA5GN45rS1tSEBJg",
"attribute": {
"body": "eyJhbGciOiJFUzI1NiIs...",
"hash": "3f4143c6f3a1c79bb32f45a6cbd90ee6bb2e2e71eadda99e371a4a144c53050f",
"issuerType": "TI",
"rootTao": "did:isbe:uc:z12kVar5p6bD5WCjEJcQ18Zyt8XV",
"tao": "did:isbe:uc:zj4sk7oEMx1SGNAzibWxVAV"
}
}
FieldDescription
didSubject's DID.
attribute.bodyAccreditation JWT (Base64url).
attribute.hashAttribute hash in the TIR (without 0x prefix). Matches the attributeId.
attribute.issuerTypeRole type: RTAO, TAO, TI, or REVOKED.
attribute.rootTaoDID of the root RTAO of the chain.
attribute.taoDID of the immediately superior TAO.

Errors:

CodeCause
404 Not FoundThe DID or the attributeId do not exist in the TIR.
400 Bad RequestThe attributeId contains non-hexadecimal characters.

Health endpoint

GET /health

Authentication: none.

Response 200 OK:

{
"status": "ok",
"uptime": 12.34
}

Metrics endpoint

GET /metrics

Exposes metrics in Prometheus format for monitoring with Grafana.

Authentication: none.