Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add NFT Trading bridge #305

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
896792f
add specs
liusanchuan Jan 5, 2023
169e03a
copy templete
liusanchuan Jan 5, 2023
caab3a2
learn test
liusanchuan Jan 5, 2023
a26f1bc
update specs flow
liusanchuan Jan 6, 2023
1e7e3a5
add NFT Transfer templete
liusanchuan Jan 6, 2023
9ecc60c
Merge branch 'AztecProtocol:master' into nft-trading-bridge
liusanchuan Jan 31, 2023
8244828
add specs
liusanchuan Jan 5, 2023
34a70be
copy templete
liusanchuan Jan 5, 2023
e36dc2b
learn test
liusanchuan Jan 5, 2023
28d8124
update specs flow
liusanchuan Jan 6, 2023
8582acd
add NFT Transfer templete
liusanchuan Jan 6, 2023
2b3e198
style: updated formatting (#306)
benesjan Jan 9, 2023
f90f80a
Lh/deployments update (#294)
LHerskind Jan 9, 2023
5900677
nits: capitalize env vars (#300)
Maddiaa0 Jan 9, 2023
c7df8f8
Subsidy log script (#293)
benesjan Jan 9, 2023
a25f80c
fix: handle case on devnet where basefee is 0
LHerskind Jan 10, 2023
56ab87e
fix: cleanup + add a test
LHerskind Jan 10, 2023
24d672a
fix: pin BiDCA tests to block 14950000 (#310)
LHerskind Jan 18, 2023
e7f4b85
chore: removed `read()` and updates readme. (#312)
LHerskind Jan 19, 2023
8a143dd
Fixed small typos in the ElementBridge contract (#314)
cashd Jan 24, 2023
693e65d
Merge branch 'nft-trading-bridge' of https://github.com/liusanchuan/a…
liusanchuan Jan 31, 2023
bff4780
add specs
liusanchuan Jan 5, 2023
269a6e4
copy templete
liusanchuan Jan 5, 2023
dc9c463
learn test
liusanchuan Jan 5, 2023
a461f25
update specs flow
liusanchuan Jan 6, 2023
bd37725
add NFT Transfer templete
liusanchuan Jan 6, 2023
7fa9129
Merge branch 'nft-trading-bridge' of https://github.com/liusanchuan/a…
liusanchuan Jan 31, 2023
ec1e206
Merge branch 'nft-trading-bridge' of https://github.com/liusanchuan/a…
liusanchuan Jan 31, 2023
9d0539f
Merge branch 'nft-trading-bridge' of https://github.com/liusanchuan/a…
liusanchuan Jan 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add specs
liusanchuan committed Jan 5, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 896792f2a4a0ebf9517f95a76de8a2d5f59a6aa6
46 changes: 46 additions & 0 deletions specs/bridges/nft_trading/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Spec for NFT Trading Bridge

## What does the bridge do? Why build it?

This bridge enables user to trading their NFT on the established Layer 1 NFT marketplaces, aka [OpenSea](https://opensea.io/), where users can list and purchase NFTs from Aztec L2 without revealing their L1 identities.
In this way, the owner of one NFT owner is in private with the power of Aztec's zero knowledge rollup. So this bridge can enhance the secret characterist of Layer 1 user.


## What protocol(s) does the bridge interact with ?


The bridge interacts with [OpenSea](https://opensea.io/).

## What is the flow of the bridge?
The simple flow as below:
1. User A on Aztec chain bridge interface pay and buy an NFT on Opensea in Ethereum.
2. The "Buy" order and relevant fee is send to L1 by Aztec's rollup.
3. The bridge contract in L1 is triggered to interact with OpenSea protocol.
4. Then the bridge contract own this NFT and record it to a private user id.
5. The User A On Aztec can redeem this NFT anytime, with his valid signature.



### General Properties of convert(...) function

- The bridge is synchronous, and will always return `isAsync = false`.

- The bridge uses `_auxData` to encode the target NFT, id, price.

- The Bridge perform token pre-approvals to allow the `ROLLUP_PROCESSOR` and `UNI_ROUTER` to pull tokens from it.
This is to reduce gas-overhead when performing the actions. It is safe to do, as the bridge is not holding the funds itself.

## Is the contract upgradeable?

No, the bridge is immutable without any admin role.

## Does the bridge maintain state?

No, the bridge doesn't maintain a state.
However, it keeps an insignificant amount of tokens (dust) in the bridge to reduce gas-costs of future transactions (in case the DUST was sent to the bridge).
By having a dust, we don't need to do a `sstore` from `0` to `non-zero`.

## Does this bridge maintain state? If so, what is stored and why?

Yes, this bridge maintain the NFT bought from NFT to relevant user's private identity.
This state is a record for user to redeem their NFT asset.