legal ground
Article 386 of the Civil Code
Unless otherwise provided by law, in the case that the debtor fails to perform the due debt or the realization of the security interest agreed by the parties occurs, the holder of the security interest has the priority to be compensated for the secured property.
Article 387
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 principal creditor's rights and debts contract. If the principal creditor's rights and debts contract is invalid, the guarantee contract is invalid, except as otherwise provided by law.