Orland0x
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # PortKey - Fiat Loans Against Crypto Collateral With Zero Counterparty Risk ## Abstract The PortKey protocol provides a way for crypto native individuals to take over-collateralized fiat loans against their on-chain assets in a trustless manner with zero counterparty risk. Providing the loans are fiat lenders that can obtain attractive fixed income opportunities for their capital whilst controlling their exposure to any credit risk. The protocol leverages Zero Knowledge Proofs to verify fiat payments in a privacy preserving manner, enabling the fiat and crypto financial worlds to become seamlessly integrated. ## Introduction Crypto native individuals want to hold hard currencies such as ETH, BTC, or even “hard” fiat. However they have requirements for local fiat in the countries they reside in. These local currency requirements vary widely, and include: housing deposits, visa/citizenship capital requirements, and day to day spending. These local fiat currencies are often weak, as anyone who has charted them against hard money knows, so people generally do not want to hold them. Borrowing is a way to short, so meeting these local capital requirements via a loan is a way to meet the fiat requirements imposed on them without taking on the associated directional exposure. So far the only places that offer fiat loans against crypto are the "CeFi" providers such as Nexo, Celisus, or BlockFi. During 2022 we saw many of these platforms collapse, highlighting the significant counterparty risks associated with these centralized systems. For the fiat lender, there is strong appetite to maximize the fixed income on their capital. On-chain interest rates on stablecoins are in general higher than those for fiat. This large variation between rates implies that there is no fluid way for the markets to interact, otherwise the difference would be arbitraged significantly. We believe that one of the reasons for this is that there are not sufficient money markets between crypto and fiat. Connecting these markets would in the short term provide above market rate fixed income opportunities for fiat lenders and in the long term, have the effect of making the yields more efficiently priced. Additionally, the exploding interest in the tokenization of Real World Assets throughout 2023/2024 provides further evidence of the growing delta between available crypto collateral and access to fiat liquidity. Hence why we're excited to introduce Portkey - a protocol where crypto native individuals can take fiat loans out against crypto collateral in a trustless manner with zero counterparty risk. On the other side, the fiat loan providers obtain attractive fixed income opportunities for lending their capital whilst controlling their exposure to any credit risk. ## How It Works PortKey is a protocol that matches crypto native borrowers with fiat native lenders. Due to the fragmented liquidity inherent in P2P platforms, we focus on large capital providers that can act as market makers on the fiat side rather than individuals. These providers will maintain the fiat liquidity to meet the borrowing demand when it appears and will be able to offer a number of loans simultaneously. PortKey can be separated into two sub protocols: an overcollateralized stablecoin lender, and a stablecoin <-> fiat bridge. We discuss each sub protocol before describing the overall interactions. #### Overcollateralized Stablecoin Overcollateralized on-chain stablecoin lending protocols such as Maker or Angle have proved themselves as robust defi primitives over the past few years. PortKey leverages this architecture to handle the loan infrastructure, the key difference is that PortKey stablecoins are always redeemable for their fiat version. This is achieved through the governance of the stablecoin. Each lender has their own stablecoin and therefore vary their governance independently. The key governance parameters that the lender would control are: - **Debt Ceiling**: Controls the amount of stablecoin that can be minted at any time. Lenders must ensure that it never increases beyond their fiat reserves so that they can always meet the fiat redeem demand. - **Whitelist/Blacklist**: Controls who can mint the stablecoin. Lenders will in most cases want some form of KYC on the borrowers as they will need to send and receive fiat from the borrower's bank accounts. - **Accepted Collateral Types and Liquidation LTVs**: Controls which on-chain assets can be used as collateral and how much fiat can be borrowed against each. - **Interest Rates**: Controls the interest rate on the fiat loan. There will be a fixed protocol rate that will accrue to the PortKey treasury from all loans, so the overall rate charged to the borrowers will be the protocol interest rate plus the lender interest rate. Fixed term loans can be achieved by significantly increasing the lender interest rate after a set date to disincentivize late repayments. - **Liquidators**: Controls who can liquidate positions. Lenders may want to handle this process solely themselves (can be very profitable) but also have the opportunity to outsource it to other actors. #### Stablecoin <-> Fiat Bridge The technical advancements that enable a system like PortKey are ZK proofs, which allow the privacy preserving and trustless verification of off-chain data in an on-chain context. [ZKP2P](https://github.com/zkp2p/zk-p2p) builds on this tech to create a trustless offramp where proofs of fiat transfers are brought on-chain and verified within smart contracts. Crypto is locked within the smart contracts and only released if the proofs are valid. Under the hood, their approach allows different sources of data to be utilized for the ZK proofs. Currently they support [ZK-Email](https://github.com/zkemail/zk-email-verify) and [TLS-Notary](https://tlsnotary.org/) which export data from payment confirmation emails and internet content served over TLS respectively. The result is a privacy-preserving trustless P2P fiat on-ramp interoperable with all popular fiat payment rails. All three projects mentioned are supported by the PSE group of the Ethereum Foundation. PortKey can build permissionlessly on top of ZK-P2P: The borrower's newly minted stablecoins can be deposited into the offramp protocol and then the order can be filled trustlessly by the lender. #### User Flows The user flow for the happy paths of loan creation and repayment are described below. Where possible, actions are batched into single transactions that will be executed atomically by the protocol (Represented by the a,b... suffixes). ![image](https://hackmd.io/_uploads/BkogHQtbA.png) ![image](https://hackmd.io/_uploads/r1C-HQFWC.png) ![image](https://hackmd.io/_uploads/rJbQH7FZR.png) #### Deploying a new Lender PortKey will include a process to permissionlessly create a new lender within the system. This will be done by a smart contract factory in a similar way to initializing a new pool in UniswapV3. Each lender will have their own stablecoin contracts but will interact with shared KYC, Escrow, and ZK-P2P instances. Each lender will maintain control over the governance of their own stablecoin in every way except for the PortKey protocol interest rate which will be enforced on all lenders. ![image](https://hackmd.io/_uploads/SJIkGzFbR.png) In the long term, we expect a diverse ecosystem of lenders covering different jurisdictions and risk profiles. However it will take time to develop the required trust and knowledge of the protocol within the wider industry for this to occur. Raising capital to place into a lender managed by our team would allow us to quickly begin meeting the demand for borrowing, solving the cold start problem whilst also generating immediate revenues. ### Edge Cases We now discuss edge cases and how they are mitigated at the protocol level. - **Lender does not send or verify the proof of fiat payment within the allotted time window**: - After the time window is exceeded the borrower can withdraw their collateral with no risk to their capital. However there still is a risk that the lender could grief the borrower as their capital is locked up until the window expires. To mitigate this issue the lender can add their own collateral as a stake in the Escrow Contract which is claimable by any borrower that's loan request was not met. This stake needs to exceed the capital efficiency loss incurred by the borrower's collateral being locked up for a short window period, we imagine 0.1% -1% would be sufficient in most cases. - Additionally, there is a reputational incentive to the lenders. Borrowers can view the historical actions of lenders via their wallet history and therefore can limit themselves to lenders that exceed a certain rate of successful orders. - **Borrower loses access to their fiat payment platform in the middle of the loan duration**: - In this case the borrower will not be able to repay their loan via fiat. However they can always repay via their collateral as described in the User Flows section. ## FAQ - **Whats stopping people just depositing their crypto into a lending protocol like Aave, borrowing a fiat stablecoin then off-ramping that?** Most fiat currencies are not on-chain, and never will be. There is simply not enough demand to support them due to the strong centralizing affects of stablecoins, over 98% of them being USD pegged (as of March 2024). **Crypto native people mostly want to hold USD pegged stablecoins, but off-chain their demands are significantly more varied.** PortKey allows these demands to be met as efficiently and trustlessly as possible. It is also worth considering the lending side, there are multiple orders of magnitude more fiat than stablecoins - with much of this market having strong demand for yield opportunities. If this market was connected to the borrowing demand of crypto native individuals, the opportunity is far larger than what would be possible with a fully on-chain stablecoin lending protocol. - **What about the dirty money being transfered through the platform?** Lenders can choose the level of KYC they desire and can therefore include their own anti-money laundering and security checks. - **How secure are payment emails for verifying fiat payments?** The on-chain verification includes the email domain of the payment provider, so there is no need for trust in the correctness of the email beyond the domain itself. The main consideration is the risk of transactions being reverted. Some payment providers could support this to some degree. It is up to the ZKP2P protocol as to which payment providers are supported since this functionality of PortKey is handled by them. The process of adding new providers is currently centralized among the core team but could become decentralized in future. A more thorough analysis of the security model of ZKP2P can be viewed [here](https://docs.zkp2p.xyz/zkp2p/developer/security). For completeness, we nonetheless consider the cases of payments reversal and how they could be mitigated at the protocol level. - **Lender reverses the loan payment**: In this case, the borrower can prove this transfer on-chain which will write-off the loan and allow them to withdraw their collateral. There is no way for the lender to steal funds so this can only be used as a griefing attack, mitigation for these sorts of attacks would be the same as discussed [here](#Edge-Cases). - **Borrower reverses the loan repayment**: After the borrower repays, verifies on-chain, and withdraws their collateral, they could reverse the repayment and walk away. Payment providers will generally put a time limit on reversing a transaction, so one mitigation approach would be to lock the borrower's collateral for a specified cooldown period after the loan is repayed, such that this window of reversibility is exceeded. In the case that a borrower did reverse the payment, the lender would be able to prove this on-chain and gain access to the collateral. Both cases can be considered optimistic security approaches where in the happy case nothing happens, but if someone acts maliciously then this can be proven and acted on. The cooldown period serves an analogous purpose as the ~1 week dispute period in Optimistic Rollups. Its worth also mentioning that this same reversal risk is present in centralized P2P off-ramping services such as Binance P2P, many of which have handled billions in volume without issues. Any malicious behaviour blacklists the user from the platform, which equally can be done at the protocol level for PortKey. ## Outlook As of March 2024 the total crypto market cap exceeds $2.6T. Enabling trustless ways to use this capital as collateral for fiat loans could unlock an enormous amount of liquidity. We find this a very exciting opportunity, thank you for reading.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully