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, Web3 Avatars and more.

Fully Non-Custodial Bridge for Stellar NFTs

The 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 [email protected] 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.

OpenSea transfer blocked

Transfer blocked on OpenSea

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).

Etherscan verified contract

Verified contract on Etherscan

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.

Bridge diagram

Stellar to Ethereum bridge flow

See an example of bridge account on Stellar Expert. See an example of burn method call on Etherscan.

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.

1
2
3
4
5
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.

1
2
3
4
5
6
7
8
9
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.

OpenSea metadata discovery

Stellar NFT metadata on OpenSea

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.

The full contract source code is available on GitHub.

So let’s build bridges!