legal ground
Article 387 of the Civil Code
Where a creditor needs security in order to ensure the realization of his creditor's rights in civil activities such as lending, buying and selling, he may establish a security interest in accordance with the provisions of this Law and other laws.
If a third party provides a guarantee for the debtor to the creditor, it may require the debtor to provide a counter-guarantee. The provisions of this law and other laws shall apply to counter-guarantee.
Article 388
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.