Bitmark Inc.
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- ###### tags: `Blockchain-Club` `Feral File` `bridge` --- # Feral File NFT Migration Design ###### tags: `Blockchain-Club` `Feral File` `bridge` `swap` `migration` `ethereum` ## Overview This document describes our process to migrate a Bitmark NFT to an Ethereum (mainnet) NFT using ERC721. ## Flow ```mermaid sequenceDiagram autonumber Feral File->>+Bitmark: Scan bitmark assets through api Bitmark-->>-Feral File: Bitmark / Asset / Provenance Feral File->>Feral File: Generate the IPFS directory<br> includes metadata and provenance Feral File->>+IPFS: Push to IPFS IPFS-->>-Feral File: Return ipfs id Feral File->>+Bitmark: Send bitmark to zero address Bitmark-->>-Feral File: Done Feral File->>+Ethereum: Invoke token swap with ipfs id and bitmark id Ethereum-->>-Feral File: A new token added to a user ``` ## Bitmark vs Ethereum Chain Asset Structure In bitmark blockchain, we have assets and bitmarks(issuances). In Feral File, we create assets for each artwork and issue editions in bitmarkss. ``` +-------+ +---------+ | Asset | <-- | Bitmark | +-------+ +---------+ (Artwork) (Editions) ``` In ERC721 design, we create a contract for an exhibition. Artist can register its artwork into it. Based on the registered artwork, we mint edition tokens. ``` +------------+ +----------+ +----------+ | Exhibition | <-- | Artworks | <-- | Editions | +------------+ +----------+ +----------+ ``` ## Feral File Smart Contracts Our latest contracts are here: [Feral File Exhibition contract]( https://ropsten.etherscan.io/address/0x14cb7e6c96cd0a352d1bf0d2bc4955cdb5c3c9a7#code) (Etherscan) ### Contract Data ```solidity= struct Artwork { string title; string artistName; string fingerprint; uint256 editionSize; address royaltyAddress; } struct ArtworkEdition { uint256 editionID; string ipfsCID; } // Exihibition information string public exhibitionTitle; uint256 public maxEdition; uint256 public secondarySaleRoyaltyBPS; uint256 public MaxRoyaltyBPS; // Move this metadata off-chain string description; v string medium; v address artist; x uint256 bitmarkID; uint256 artworkID; uint256 editionNumber; v string prevProvenance; address public curator; v string public curatorNotes; v uint256 public basePrice; ``` #### Cost Table | Function | Gas | TX | Contract | | ----------- | ----------- | ----------- | ----------- | | (livenet) Create Artwork | 167,593 | [link](https://rinkeby.etherscan.io/tx/0x563771fbc7f3f74c0da59f54939f48bd42ea0ba3b1ca70ef69baaa84a47ea1d1) | [Contract](https://rinkeby.etherscan.io/address/0x204e6fd8f3231b0497b9c1411d30b35a938486e2) | (livenet) Swap edition | 343,598 | [link](https://rinkeby.etherscan.io/tx/0x7f0f7ed15c44fd2716ab3c99abb49d9a40dcf11060d58c34160f91ae37c420e2) | [Contract](https://rinkeby.etherscan.io/address/0x204e6fd8f3231b0497b9c1411d30b35a938486e2) ### Exhibition specific methods `createArtwork` is to register artworks. The`fingerprint` will be used to generate the id of an artwork. It can not be duplicated. ```solidity= // Create an artwork for an exhibition function createArtwork( string memory _fingerprint, string memory _title, string memory _description, address _artist, string memory _medium, uint256 _editionSize ) public onlyAuthorized {} ``` `mintArtwork` is for minting new editions for an artwork. Whereas, the `swapArtworkFromBitmarks` is to move the existent artwork from Bitmark blockchain to the ERC721 system. It takes 300,000 gas for swapping an artwork, and takes 2,680,000 for swapping 10 artworks. ```solidity= // Swap an existent artwork from bitmark to ERC721 function swapArtworkFromBitmarks( uint256 _artworkID, uint256 _bitmarkID, uint256 _editionNumber, address _owner, string memory _prevProvenance, string memory _ipfsCID ) public onlyAuthorized {} ``` The following function is to mint a new artwork for new exhibitons. ```solidity= // Mint artwork editions. function mintArtwork( uint256 _artworkID, string[] memory _ipfsCIDs ) public onlyAuthorized {} ``` :::info Since the length of CID is greater than 32, we can only use string for inputing CIDs. Use string costs more gas since it is an dynamic type. ::: The following functions help users query their artwork tokens. ```solidity= // Return total artwork counts of the exhibition function totalArtworks() public view virtual returns (uint256) {} // Return the token identifier for the `_index`th artwork function getArtworkByIndex(uint256 index) public view virtual returns (uint256) {} // Return the total minted editions of an artwork function totalEditionOfArtwork(uint256 artworkID) public view returns (uint256) {} // Return editionID of an artwork by index function getArtworkEditionByIndex(uint256 _artworkID, uint256 _index) public view returns (uint256) {} ``` ## Get the Bitmark NFT's provenance Here are the steps: 1. Use Bitmark.FullProvenance to get history 2. Summarize the provenance into the following format: ```json { "bitmark_provance": [ { "owner": "ecZ6DenzyjZ1u5vbFEg9Gki91eJduf4hjKCiBdBCen5ghSk7Wh", "inblock": "39857", }, { "owner": "fqDMrr8VESHfAwxxKwkDHmprQZRrnp7Kvsc5L5uG9qHtDgmiTp", "inblock": "59557", } ] } ``` 4. Attach the whole JSON string to IPFS metadata of the token which are going to migrate. ## Incorporate the IPFS address link into the reference parameter of erc 721. At the time we perform `swapArtworkFromBitmarks`, we will attach the IPFS cid of summarized metadata followed the standard provided by Opensea. The contract takes the ID to generate the tokenURI for each tokens. For example, ``` https://ipfs.bitmark.com/ipfs/QmYBfVBh9U5huzY72GucDdwvp35yhrWfgAdiUUfnAZPd7f/metadata.json ``` Here is an example of summarized metadata: ```json "attributes": [ { "trait_type": "Medium", "value": "video" }, { "trait_type": "Artist", "value": "Duyen Bui" }, { "display_type": "number", "trait_type": "Edition Size", "value": "30" }, { "trait_type": "Exhibition", "value": "The Real Real" } ], "description": "Video (color, sound)\n1280 × 1280 pixels\n30 seconds", "external_url": "https://feralfile.com/artworks/steering-pixels-k6p?sort=0", "image": "https://ipfs.bitmark.com/ipfs/QmUqMhPndTg7bPjaCitRqJLGVTc4vvQQ9rXXBo38qeANqg", "name": "Blue Veil #2", "timestamp": "2021-08-27 12:32:55.225725 +0800 CST m=+2.301450084" } ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully