Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

demo: simple import/export of Stellar testnet assets #448

Open
oleganza opened this issue May 21, 2020 · 0 comments
Open

demo: simple import/export of Stellar testnet assets #448

oleganza opened this issue May 21, 2020 · 0 comments

Comments

@oleganza
Copy link
Contributor

Goal: demonstrate use of ZkVM sidechain with Stellar assets.

Import workflow:

  1. A button "import from Stellar".
  2. Form: select the destination account or enter Wallet ID.
  3. UI: shows the one-time code (zkvm address?) to enter into the Memo field in the Stellar wallet.
  4. Paste the tx id, query the horizon and check that the memo field contains the hashed or plaintext code (Keybase seems to encode text in utf8 w/o hashing).
  5. Find in the DB the wallet ID matching the code and form a transaction. Replace the code record by the tx record, so the user cannot use the code twice. Then, build and submit the ZkVM tx that issues the mapped asset (issuance customized by the metadata containing asset ID).

Export workflow:

  1. Detect a retire entry on ZkVM chain, followed by a log entry that specifies the Stellar asset ID, qty (u64) and destination account.
  2. If the retired value is a non-blinded commitment with corresponding qty and flavor derived from that Stellar asset ID, then the retirement is considered a valid withdrawal request.
  3. Each withdrawal request is strictly ordered, and ordering maps directly onto Stellar sequence numbers, so we can issue txs w/o replay attacks.
  4. Once we detect the retirement, submit the tx to Horizon sending the corresponding asset to the desired account. The destination account receives the asset that was locked by the app.

Problems to solve:

  1. Which Stellar SDK to use? The Rust SDK from Sept 2018 might be incomplete/incompatible: https://github.com/kbacha/stellar-rust-sdk
  2. How to deal with missing trustlines when we cannot make a withdrawal tx because recipient ?
  3. What other issues may arise that may break 1:1 mapping of the retirement tx on zkvm to a sequence number of a stellar withdrawal tx?

Choose an SDK to connect to the public Stellar-owned Horizon instance: https://www.stellar.org/developers/reference/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant