What we want to solve
JPEG station enables cross-chain swaps between Ethereum NFTs and Bitcoin Ordinals leveraging NEAR Chain Abstraction.
The protocol core relies in the NEAR smart contract, which serves as an escrow between the two parties involved in a trade. An example of a trade would be the following:
- Lisa wants to exchange her Milady with a Bitcoin Puppet (she's missing out badly, and wants a fast trade ASAP). She creates an order on JPEG station's website, and deposits her NFT to the NEAR contract derived Ethereum address;
- Bart wants to sell one of his 20 Puppets for a Milady, just to try something different. He's lucky enough to find the order in the website and accepts the proposal; So he sends his Ordinal to the NEAR contract derived Bitcoin address;
- Now both the JPEGs are locked in the escrow, so the users can finally retrieve their new pieces of art (in a safe way, thanks to the NEAR contract), which will go to the respective NEAR derived accounts.
Project links
GitHub repo: https://github.com/0xCaso/jpeg-station
Slides: https://pitch.com/v/jpeg-station-rwxf37
Challenges we ran into
- It would have been more efficient to have Typescript support for the frontend part, because we ran in types issues often for the transaction calldata building;
- The docs are really full of a lot of examples, but unfortunately there wasn't much about our specific case, where we wanted to do more other than cross-chain native assets swaps. We didn't manage to properly construct the correct calldata to transfer an NFT from the NEAR contract derived account to the user's one.
- We think that a wallet extension would be more convenient for the developers integrating the product, instead of a wallet web application (e.g., the dApp loses his own context every time the user has to open the wallet).
What we liked a lot
We liked a lot the fact that it wasn't needed to integrate different libraries/wallets, and we say a huge thanks to the NEAR DevRel guys (Owen and Lyudmil)!