litemint pfp nft bridge

Building Bridges For NFTs

Exciting times! As I write this blog article, we are rolling out a major update (1.0.11) for the Litemint NFT marketplace.

With this release (demo below), we introduce another first to NFTs on Stellar as we built an ERC-721 compliant, non-custodial and decentralized bridge to Ethereum allowing creators and collectors to use their NFTs, securely, as PFP (Picture for Proof or Profile Picture) with any Web3 service. Yes, that includes Twitter NFT profile picture, OnlyFans Web3 Avatars and more.

For the record, we ran our demo using an OnlyFans account as we do not yet have access to Twitter Blue in Korea.

Fully Non-Custodial Bridge for Stellar NFTs

We take no shortcuts. Our bridge is 100% non-custodial so you, and only you, control your assets at any time. Even in the event of Litemint not being reachable, you can always destroy the bridge to recover your NFTs by signing and submitting a transaction on Stellar. Likewise, ownership revocation on Ethereum does not rely on a central entity and process (more on this below).

💡 Any asset issued on Stellar, locked with 1 stroop supply, by a verified issuer domain (you can email happiness@litemint.com to get started with verification), can be bridged using this feature—that includes assets minted outside of Litemint. As per Stellar SEP-39 interoperability recommendations, the URI is based on the ipfshash (or ipfscid) data entry, if found on the issuer account.

Security

Our ERC-721 contract restricts all transfers on Ethereum. This includes auctions, listings, and direct wallet-to-wallet transfer from any service. For example, this is what happens on Opensea when we try to transfer the NFT (by artist Arina) used in the demo.

Always be safe when interacting with our contract, for convenience, we have verified the source code and registered our details with Etherscan.io (official links and social).

Technical Details

Initially, signed payload signers coupled with transaction preconditions seemed like the perfect tools for building decentralized bridges with Stellar. So, in early designs, I intended to leverage CAP-40 and CAP-21, recently introduced with Stellar protocol 19.

Unfortunately, CAP-40 is limited to use Ed25519 signatures, and this scheme is not standard on Ethereum. That is, curve calculations for signature verification in smart contracts would increase the transaction fees by at least 5 times! Although, EIP-665 was proposed for adding precompiled contracts for Ed25519 signature verification on the Ethereum protocol, its status is still stagnant. There is not much hope on the Ethereum side so maybe something to consider suggesting to the devs at Stellar for increased interoperability with the rest of the world.

In any case, this is the reason I reverted to use a hash(x) signer where x is a signed transaction hash on Stellar.

The Ethereum smart contract burn method is authorized for anyone providing x, revealed by the owner when submitting any valid transaction for the Stellar bridge account—and therefore, guarantying decentralized ownership revocation on Ethereum.

 function burn(uint256 tokenId, bytes32 secret) public {
        require(_exists(tokenId), "Litemint PFP: Invalid token.");
        require(keccak256(abi.encodePacked(_hashes[tokenId])) == keccak256(abi.encodePacked(sha256(abi.encodePacked(secret)))), "Litemint PFP: Invalid secret.");
        _burn(tokenId);
    }

The contract also prevents all transfer of ownership.

 function _beforeTokenTransfer(address from, address to, uint256 tokenId)
        internal
        whenNotPaused
        override
    {
        // Litemint PFPs are non-transferable.
        require(from == address(0) || to == address(0), "Litemint PFP: non-transferrable token.");
        super._beforeTokenTransfer(from, to, tokenId);
    }

The contract returns a URI matching the IPFS hash for each individual token, providing a seamless way for platforms on Ethereum to discover the image, name and description associated to the asset on Stellar. e.g., see below screen from Opensea.io, the platform can consistently discover our Stellar NFT data.

Let’s Build Bridges!

Web3 opportunities are endless, and we are dedicated to increase interoperability and usability for our users on Litemint developing more bridges to deliver decentralized and premium experiences. Besides tools like this one for immediate exposure on mainstream platforms, we have opportunities to build seamless, and sophisticated cross-chain modules (e.g., auctions…) to help creators reach new markets.

Furthermore, the advent of Soroban (Stellar Smart Contracts) is increasing our freedom as builders and I could not be more excited!

So let’s build bridges!

Make sure you follow us on our social channels to keep posted about our latest news:

Website: https://litemint.com/
Twitter: https://twitter.com/LitemintHQ
Youtube: https://www.youtube.com/litemint
Discord: litemint.gg

Thanks for reading.