Delali
Delali

Reputation: 908

How to transfer an ERC721 token across networks

Please pardon me if this question sounds dumb, but I am a little new to this concept and there are not many resources out there I could find. Thanks.

Suppose I have created a ERC721 smart contract and used that to mint an NFT token. Now I want to be able to transfer that token from one network to another. I know to mint transfer the NFT to another user, the owner needs to approve the transaction. I have already tried this on rinkeby testnet. But I have no idea how to transfer from say rinkeby testnet to another network. Please see my mint and transfer functions below:

function _transfer(
        address _from,
        address _to,
        uint256 _tokenId
    ) external payable {
        require(ownerOf(_tokenId) == _from);
        _owners[_tokenId] = _to;
        _balances[_from]--;
        _balances[_to]++;

        emit Transfer(_from, _to, _tokenId);
    }

    function _mint(address _to, uint256 _tokenId)
        internal
        uniqueToken(_tokenId)
        notZeroAddress(_to)
    {
        _owners[_tokenId] = _to;
        _balances[_to] += 1;
        tokenExist[_tokenId] = true;
       
        emit Transfer(address(0), msg.sender, _tokenId);
    }

I would appreciate any assistance. Thanks.

Upvotes: 0

Views: 596

Answers (1)

Amin Talebi
Amin Talebi

Reputation: 373

Cross chain (network) transactions need a bridge. It can be a centralized one or it can be trust-less and decentralized one like near rainbow bridge.

It's not a trivial problem to tackle.

Following links might give you insight on how it should get done.

near rainbow bridge

avalanche bridge

cosmos IBC

polkadot bridges

Upvotes: 2

Related Questions