mnft.registerMachine for a given Machine NFT contract.
What “adding a Machine Issuer” means
- The Machine Regulator (e.g. Framework Owner) approves an EOA as a Machine Issuer.
- That EOA must have an ONCHAINID identity with a KYC claim (
CT_KYC_APPROVED,666) and a Machine Issuer role claim (CT_MNFT_ISSUER,7), both issued by a trusted Claim Issuer. - The regulator then registers that EOA in the PeaqRwaNft contract via
rwanft.addMachineIssuer. After that, the address can register machines (mint Machine NFTs) for machine controllers.
Prerequisites
- Machine Regulator signer (e.g.
MACHINE_REGULATOR_PRIVATE_KEY): callsaddMachineIssuer. The regulator’s identity needs a KYC claim (CT_KYC_APPROVED,666) and a Machine Regulator role claim (CT_MNFT_REGULATOR,8), and the PeaqRwaNft owner must register the regulator withaddMachineRegulator(owner only, not exposed in the SDK; call the contract directly). OtherwiseaddMachineIssuerreverts withUnauthorizedorVerification failed. - Claim Issuer contract address (
CLAIM_ISSUER_CONTRACT_ADDRESS): the same Claim Issuer used for KYC. Its signer issues role claims. One wallet can act as both regulator and claim issuer. - Candidate Machine Issuer: the EOA you want to turn into a Machine Issuer (e.g. Alice). They must already have an ONCHAINID identity. Create one first with Create Identity if needed.
Steps
1. Ensure the candidate has an identity
Resolve the candidate’s ONCHAINID identity (create it first if they don’t have one):- Get Identity with
subject: candidateAddress. - If
status === 'not_found', Create Identity for that address (ID Factory admin signs), then call Get Identity again.
2. Issue the Machine Issuer role claim
The Claim Issuer issues a role claim for the candidate’s identity with topicCT_MNFT_ISSUER:
- Issue Role Claim with:
claimIssuerSigner: your Claim Issuer signer.claimIssuerContract:CLAIM_ISSUER_CONTRACT_ADDRESS.subjectIdentity: the candidate’s identity address from step 1.roleTopic:ClaimTopics.CT_MNFT_ISSUER(7).roleDescription: e.g.'Machine Issuer'.
{ claim, signature }.
3. Add the claim to the candidate’s identity
The identity owner (the candidate) must add the claim to their identity:- Add Claim to Identity with:
identityController: candidate’s signer (e.g. Alice’s wallet).subjectIdentity: candidate’s identity address.claim: the claim from step 2.claimSignature: the signature from step 2.
4. Add a KYC claim
The candidate needs a KYC claim on their identity as well as the role claim. Issue it with Issue KYC Claim and attach it with Add Claim to Identity. Without it,addMachineIssuer reverts with Verification failed.
5. Register the Machine Issuer in PeaqRwaNft
The Machine Regulator adds the candidate’s EOA to the PeaqRwaNft contract:- Add Machine Issuer with:
machineRegulatorSigner: Machine Regulator wallet.newMachineIssuer: candidate’s EOA address (e.g.alice.address).
status: 'added', machineIssuer, machineNft (the contract created for this issuer), and receipt.
6. (Optional) Verify
- Get Machine Issuers before and after step 5 to confirm the new address appears in the list.

