# LayerZero

#### Sync

Synchronize DID information to the destination chain through LayerZero protocol, including DID, avatar, and KYC information.

```
struct Payload {
    uint256 tokenId;        // did tokenid
    address user;           // did owner
    string did;             // did name
    string avatar;          // avatar url
    address[] KYCProvider;  // kyc provider address
    uint256[] KYCId;        // kyc id (kyc level)
    IDid.KYCInfo[] KYCInfo; // kyc info
    bytes[] evidence;       // kyc evidence signed by provider
    bytes evidenceLZ;       // evidence signed by HashKey DID
}
function sync(Payload memory _payload, uint16 _dstChainId) public;
```

* \_payload: DID infomation
* \_dstChainId: destination chain id defined by [LayerZero](https://layerzero.gitbook.io/docs/technical-reference/mainnet/supported-chain-ids)

#### Mint DID LayerZero

Minting a DID using information obtained from a sync event can only be invoked by the LayerZero endpoint or the HashKey DID endpoint (when the chain is not yet supported by LayerZero).

```
function mintDidLZ(uint256 tokenId, address user, string memory did, string memory avatar, address[] memory KYCProvider, uint256[] memory KYCId, KYCInfo[] memory kycInfo, bytes[] memory evidence)
```

* did infos args: Refer to the annotations of type `Payload` below.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hashkey.id/protocol/contract-api-reference/layerzero.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
