Integrating pTokens into EthGlobal’s HackMoney Hackathon

pNetwork Team
pNetwork
Published in
4 min readMay 19, 2020

The EthGlobal HackMoney Hackathon is well underway — and pTokens has been enthralled by the creativity and talent of its competing teams.

Since the launch of pBTC on mainnet, we’ve been thrilled to give developers a hands-on experience with pTokens, a system that enables cross-chain composability and aims to bring any crypto asset to any blockchain.

As a sponsor of the 30-day DeFi hackathon, we’ll be awarding 0.2 pBTC each to the top 3 projects utilizing the pTokens system.

So far, we’ve encountered some exciting ideas on integrating bitcoin into Ethereum projects via pBTC. Read on to learn more about what you can build.

1. BTCPoolTogether

A no-loss savings game for users with BTC.

How does it work? Users can deposit BTC into the BTCPoolTogether interface. The BTC is automatically swapped into pBTC via the pTokens system and then swapped again into DAI. The amount of DAI is used to buy tickets on PoolTogether. After the prize is awarded, an amount of DAI is returned. This gets swapped into pBTC and then automatically cross-chain swapped for BTC.

2. Metamask as a BTC wallet

Enable BTC deposits and withdrawals within Metamask.

How does it work? The pTokens JS library can be integrated with the Metamask wallet, enabling users to deposit BTC. Users deposit BTC, which are automatically swapped into pBTC (becoming Ethereum-compatible) and displayed within Metamask. The BTC can be redeemed anytime straight from Metamask.

3. Privacy BTC transactions via Ethereum

Enable users to move BTC while leveraging Ethereum’s privacy systems.

How does it work? Users can deposit BTC into the BTCPrivacy interface. The BTC is automatically swapped into pBTC and can be moved on Ethereum by leveraging privacy-preserving systems such as Aztec Protocol or Tornado.Cash. At the end, the pBTC is automatically swapped into BTC.

4. Interest-earning system for BTC holders

Allow users holding BTC the ability to earn interest via Compound.

How does it work? Users deposit BTC into the BTCinterest interface. The BTC is automatically swapped into pBTC, becoming compatible with lending platforms on Ethereum. The pBTC is deposited on Compound (by being swapped into wBTC), where it earns interest. Once some interest is generated, the interest is redeemed from Compound and automatically sent back from pBTC to BTC to the original BTC holder.

5. BTC CeFi / DeFi Arbitrage

A market making system that arbitrages the BTC pair between the centralized and decentralized ecosystems.

How does it work? The arbitrage system leverages the CCXT library (or similar) to integrate with a centralized exchange, the pTokens JS library to integrate the pTokens system (for peg-ins/outs) and a liquidity protocol such as Uniswap, Kyber, and Bancor. Market makers can access arbitrage opportunities by taking advantage of any slippage across the centralized exchange and the DEXes.

6. Onchain Bitmex for BTC perpetual futures

A decentralized exchange offering the possibility to trade BTC-backed perpetual future contracts.

How does it work? Users deposit BTC into the BTCperpfuturesDEX interface. The BTC is automatically swapped into pBTC, becoming compatible with Ethereum. Users can perform leverage-trading by using pBTC as collateral in a decentralized fashion (with the possibility of redeeming the underlying BTC anytime once their positions are closed and the collateral released).

7. BTC-backed stablecoin

Improve the stability of decentralized stablecoins, like DAI, by adding BTC as collateral.

How does it work? An underlying amount of BTC is deposited, locked and automatically moved into Ethereum by leveraging pTokens. Once on Ethereum, pBTC can be added as asset collateral for the decentralized stablecoin. Should a user be willing to redeem the collateral deposited into DAI, the pBTC would be redeemed and automatically swapped into BTC.

As we draw closer to the conclusion of the hackathon, we can only expect many of these ideas to take shape and to offer even more valuable experiences within the DeFi space.

We look forward to seeing what you build. Happy Hacking!

🦜 Want to join our flock? Connect with us on Twitter and join the conversation in our pNetwork Telegram and Discord.

💡 For a more technical deep dive into pTokens infrastructure, read our technical paper or check out the summary on our website.

🔗 For any blockchain project looking to integrate pTokens into their infrastructure, we have also built a pTokens JS library.

💌 Excited about pBTC? Sign up for our newsletter and be the first to know which blockchain pTokens will make their home in next.

--

--