ADR-33: Collections v2 Bridge

More details about this document
Latest published version:
https://adr.decentraland.org/adr/ADR-33
Feedback:
GitHub decentraland/adr (pull requests, new issue, open issues)
Edit this documentation:
GitHub View commits View commits on githistory.xyz

Abstract

With the collections v2 on Polygon around, we need to find the most efficient way in terms of UX and cost for users for moving collections' assets between Ethereum and Polygon.

The architecture of how collections will be represented between layers is already defined here.

Alt 1: Polling from the user account

The alternative needs one transaction per collection to approve the assets, and other transaction to poll the assets.

Tx.1) The user should approve the bridge contract to use their assets on their behalf for each collection. The transaction to approve is required only once per collection. It means that once the user approves the bridge on the collection, every time the user wants to move assets, the transaction to approve won't be needed. The user will be able to revoke the approval whenever they want.

collection1.approveForAll(user, bridge) // ERC721 standard approvalForAll method
collection2.approveForAll(user, bridge) // ERC721 standard approvalForAll method
collection3.approveForAll(user, bridge) // ERC721 standard approvalForAll method

Tx.2) The user should call the bridge smart contract to poll assets from their account to the bridge. The transaction to poll is required each time the user wants to deposit assets.

bridge.depositFor(user, beneficiary, [collections], [tokenIds])

Min transactions: 2

Recurrent transactions: 1 if it is an approved collection. 2 if it is a collection to be approved

Number of collections involved per deposit: n

Max assets per deposit: 60

Alt 2: Transfering the assets

The alternative needs one transaction per collection to transfer the assets to the bridge.

Tx.1) The user should transfer the assets to the bridge contract. A transaction per collection is needed.

collection1.safeTransferFrom(user, bridge, [tokenIds]) // ERC721 standard safeTransferFrom method
collection2.safeTransferFrom(user, bridge, [tokenIds]) // ERC721 standard safeTransferFrom method
collection3.safeTransferFrom(user, bridge, [tokenIds]) // ERC721 standard safeTransferFrom method

Min transactions: 1

Recurrent transactions: 1 per collection per deposit

Number of collections involved per deposit: 1

Max assets per deposit: 60

Decision Outcome

Atl 1 ✅

Pros

Cons

Alt 2

Pros

Cons

Open Questions

Participants

License

Copyright and related rights waived via CC0-1.0. DRAFT Living