legal ground
Article 388 of the Civil Code
To establish a security interest, a security contract shall be concluded in accordance with the provisions of this Law and other laws. Guarantee contracts include mortgage contracts, pledge contracts and other contracts with guarantee functions. The guarantee contract is a subsidiary contract of the main creditor's rights and debts contract. If the principal creditor's rights and debts contract is invalid, the guarantee contract is invalid, unless otherwise stipulated by law.
If the debtor, guarantor and creditor are at fault after the guaranty contract is confirmed to be invalid, they shall bear corresponding civil liabilities according to their faults.
Article 394
In order to ensure the performance of the debt, if the debtor or a third party mortgages the property to the creditor without transferring the possession of the property, if the debtor fails to perform the due debt or realize the mortgage according to the agreement of the parties, the creditor has the right to be compensated in priority for the property.
The debtor or the third party specified in the preceding paragraph is the mortgagor, the creditor is the mortgagee, and the property that provides guarantee is the mortgaged property.