{"id":19593465,"url":"https://github.com/magicblock-labs/ephemeral-rollups-spl","last_synced_at":"2025-04-23T06:06:33.108Z","repository":{"id":259173362,"uuid":"874580502","full_name":"magicblock-labs/ephemeral-rollups-spl","owner":"magicblock-labs","description":"Ephemeral Rollups SPL","archived":false,"fork":false,"pushed_at":"2024-12-31T10:40:33.000Z","size":943,"stargazers_count":3,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T06:06:26.045Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magicblock-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T05:02:45.000Z","updated_at":"2025-03-16T17:25:27.000Z","dependencies_parsed_at":"2024-10-23T08:16:16.646Z","dependency_job_id":"69b8af75-fa01-44e3-b6fc-aca6fd3ba8fa","html_url":"https://github.com/magicblock-labs/ephemeral-rollups-spl","commit_stats":null,"previous_names":["magicblock-labs/ephemeral-rollups-spl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicblock-labs%2Fephemeral-rollups-spl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicblock-labs%2Fephemeral-rollups-spl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicblock-labs%2Fephemeral-rollups-spl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicblock-labs%2Fephemeral-rollups-spl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicblock-labs","download_url":"https://codeload.github.com/magicblock-labs/ephemeral-rollups-spl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250379797,"owners_count":21420841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T08:39:43.619Z","updated_at":"2025-04-23T06:06:33.086Z","avatar_url":"https://github.com/magicblock-labs.png","language":"Rust","funding_links":[],"categories":["Projects"],"sub_categories":[],"readme":"# Ephemeral Rollups SPL\n\nThis repository is aimed at providing reference implementations for very standard actions done in and out of the MagicBlock's Ephemeral Rollups engine's runtime.\n\n## Ephemeral Rollups Wrap\n\nThis crate provide an example implementation on how to wrap/unwrap Lamports (SOL) and SPL Tokens in and out of the Ephemeral Rollups.\n\n### Moving Lamports (SOL) in and out of the ER\n\nFor escrowing/wrapping lamports, the following IX are provided:\n\n- `lamport_escrow_create` -\u003e Create a new `LamportEscrow` account, holding escrowed lamports (is controlled by an \"authority\" wallet)\n- `lamport_escrow_claim` -\u003e The \"authority\" wallet can withdraw the lamports contained in the `LamportEscrow` to any wallet (can be used both on-chain and in the ER)\n- `lamport_escrow_delegate` -\u003e Delegate the `LamportEscrow` into the ER (becomes unusable on-chain)\n- `lamport_escrow_undelegate` -\u003e Undelegate the `LamportEscrow` back out from the ER (becomes usable again on-chain)\n\nA typical example scenario could like like this:\n\n1) `lamport_escrow_create` is called, creating an `wallet1_lamport_escrow` owned by `wallet1` on-chain\n2) `wallet2` transfers lamports into the `wallet1_lamport_escrow`\n3) `lamport_escrow_delegate` is called, delegating the `wallet1_lamport_escrow` into the ER\n4) `wallet1` can now claim all available lamports using `lamport_escrow_claim` from INSIDE the ER\n5) `lamport_escrow_undelegate` can optionally be called to be able to claim remaining lamports from the chain later\n\n### Moving SPL tokens in and out of the ER\n\nFor escrowing/wrapping SPL tokens, the following IX are provided:\n\n- `token_escrow_create` -\u003e Create a new `TokenEscrow` account representing a wallet's escrowed token balance (controlled by an \"authority\" wallet)\n- `token_escrow_deposit` -\u003e Deposit a SPL token account balance into a `TokenEscrow` previously created (can only be used on-chain)\n- `token_escrow_transfer` -\u003e Transfer an amount of escrowed token from a `TokenEscrow` to another `TokenEscrow` (can be used both on-chain and in the ER)\n- `token_escrow_withdraw` -\u003e Withdraw a `TokenEscrow` balance back into a SPL token account (can only be used on-chain)\n- `token_escrow_delegate` -\u003e Delegate the `TokenEscrow` into the ER (becomes unusable on-chain)\n- `token_escrow_undelegate` -\u003e Undelegate the `TokenEscrow` back out from the ER (becomes usable again on-chain)\n\nA typical example scenario could look like this:\n\n1) `token_escrow_create` is called on chain for `wallet1`, creating a `wallet1_token_escrow`\n2) `token_escrow_deposit` is called on chain, depositing some tokens into `wallet1_token_escrow`\n3) `token_escrow_delegate` is called, moving `wallet1_token_escrow` into the ER\n4) `token_escrow_create` is called on chain for `wallet2`, creating a `wallet2_token_escrow`\n5) `token_escrow_delegate` is called, moving `wallet2_token_escrow` into the ER\n6) `token_escrow_transfer` is called, moving funds from `wallet1_token_escrow` into `wallet2_token_escrow`, all heppening in the ER\n7) `token_escrow_undelegate` is called for `wallet2_token_escrow`, bringing it back to chain\n8) `token_escrow_withdraw` is then called by `wallet2` to withdraw regular SPL tokens from `wallet2_token_escrow` on-chain\n\n### Moving Bubblegum compressed NFT in and out of the ER\n\nIt's possible to escrow cNFT to the ER so that they can be traded/transfered as part of ER transactions. The following IXs are provided:\n\n- `bubblegum_escrow_deposit` -\u003e Create a new `BubblegumEscrow` account representing the wrapped cNFT, initially owned by the depositor's chosen authority wallet\n- `bubblegum_escrow_transfer` -\u003e Transfer ownership of the wrapped cNFT to a new authority wallet (can be used both on-chain and in the ER)\n- `bubblegum_escrow_withdraw` -\u003e Destroy the `BubblegumEscrow` and return the cNFT back to the specified owner (can only be used on-chain)\n- `bubblegum_escrow_delegate` -\u003e Delegate the `BubblegumEscrow` into the ER (becomes unusable on-chain)\n- `bubblegum_escrow_undelegate` -\u003e Undelegate the `BubblegumEscrow` back out from the ER (becomes usable again on-chain)\n\nA typical example scenario could look like this:\n\n1) `bubblegum_escrow_deposit` is called on chain with `wallet1`, creating a `bubblegum_escrow`\n2) `bubblegum_escrow_delegate` is called on chain, moving control of the `bubblegum_escrow` to inside the ER\n3) `bubblegum_escrow_transfer` is used many time inside the ER to trade the wrapped cNFT\n4) `bubblegum_escrow_undelegate` is used in the ER after a while, moving back control of the `bubblegum_escrow` back to chain\n5) `bubblegum_escrow_withdraw` is called by the latest owner of the cNFT on-chain to destroy the escrow and gain access to the raw cNFT for usage with the bubblegum metaplex's programs\n\n## Ephemeral Rollups Tooling\n\nThis crate provide example tests and scenario that can be used to help understand how each instructions can be used.\n\nCheckout fully functional wrapping scenarios working on devnet:\n\n- SPL Token Trading in the ER [devnet_token_escrow_create_deposit_delegate_undelegate](https://github.com/magicblock-labs/ephemeral-rollups-spl/blob/main/ephemeral-rollups-tooling/tests/suites/devnet_token_escrow_create_deposit_delegate_undelegate.rs)\n- Bubblegum cNFT Trading in the ER [devnet_bubblegum_escrow_deposit_delegate_undelegate](https://github.com/magicblock-labs/ephemeral-rollups-spl/blob/main/ephemeral-rollups-tooling/tests/suites/devnet_bubblegum_escrow_deposit_delegate_undelegate.rs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicblock-labs%2Fephemeral-rollups-spl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicblock-labs%2Fephemeral-rollups-spl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicblock-labs%2Fephemeral-rollups-spl/lists"}