CalebEverett / arloader

Rust command line application and client for uploading files to Arweave.
Apache License 2.0
82 stars 23 forks source link

What data is passed through Arloader? #17

Closed enzotar closed 2 years ago

enzotar commented 2 years ago

When paying with SOL, we pass https://arloader.io/sol and also a keypair. You also mentioned that if a transaction is failed, you have to manually refund.

  1. How do you store the data? I am mainly concerned about keypairs.
  2. Do you perform a swap for AR or hold an equivalent in SOL for the transaction?
  3. If paying with AR, is it direct with Arweave, or does it also pass through you?
  4. Anything else that Arloader performs as a middleman? or that it could do?

I am interested in the case where Arloader is totally neutral and when it could take a cut by offering a more streamlined process/other features.

CalebEverett commented 2 years ago

Hi, sure - totally transparent here and hopefully handled in a way that respects the privacy of your keys.

  1. For AR transactions, arloader doesn't take anything, it just processes the transactions with reward going to the network. There is no place in the code even for an option to do anything like that. That applies to one file uploaded by itself, multiple files upload individually, uploading a single bundle, or uploading multiple bundles.
  2. For paying with sol, arloader doesn't send your keys any where. In order to process the transaction at the arloader.io endpoint, arloader sends a prepared and signed solana transaction along with the elements of the arweave transaction needed to create a signature. Then it sends those to the endpoint, submits the sol tx to solana, verifies that the amount was correct and then signs the tx elements with an ar wallet and sends the signature back to the arloader client. That signature is then added to the local tx with data and submitted directly to arweave. The amount of the sol tx is calculated by arloader locally based on the required ar reward, including any multiplier, if any.
  3. You can always check to see how much transactions will cost by running arloader estimate and include --with-sol to get the estimate in SOL. U.S. dollars included for both as an additional point of reference. You can also then check the Solana and Arweave block explorers to confirm the amounts. Mostly for simplicity sake, I have the sol amount at a fixed exchange rate https://github.com/CalebEverett/arloader/blob/a7a7548c3e6512bac348aa45b1877cbf3ffef92a/src/solana.rs#L26 which currently happens to be pretty close to where the market prices are relative to dollars. I've thought about making that more dynamic, but the volume is fairly low overall and it is mostly there as a convenience. You can always use AR directly and effectively transact directly with Arweave.
  4. The arloader code is completely open source, so you can check all of this to verify. Here is the code for creating the solana tx. https://github.com/CalebEverett/arloader/blob/a7a7548c3e6512bac348aa45b1877cbf3ffef92a/src/solana.rs#L108 And here is where that gets sent to the arloader.io endpoint https://github.com/CalebEverett/arloader/blob/a7a7548c3e6512bac348aa45b1877cbf3ffef92a/src/lib.rs#L967 with the signature received back and then added to the local tx before uploading to arweave.

Hope that helps, happy to answer any other questions.

If you are planning on using regularly for any kind of volume and have ideas on features / improvements that would be valuable, I'd be keen to hear about those.

enzotar commented 2 years ago

Thanks for the explanation. I think this summary could be helpful in your docs.

On Thu, Mar 10, 2022, 6:05 PM Caleb @.***> wrote:

Hi, sure - totally transparent here and hopefully handled in a way that respects the privacy of your secrets.

  1. For AR transactions, arloader doesn't take anything, it just processes the transactions with reward going to the network. There is no place in the code even for an option to do anything like tht.
  2. For paying with sol, arloader doesn't send your keys any where. In order to process the transaction at the arloader.io endpoint, arloader sends a prepared and signed solana transaction along with the elements of the arweave transaction needed to create a signature. Then it sends those to the endpoint, submits the sol tx to solana, verifies that the amount was correct and then signs the tx with an ar wallet and sends the signed tx back to the arloader client. Then that signature is added to the tx and submitted directly to arweave.
  3. You can always check to see how much transactions will cost by running arloader estimate and include --with-sol to get the estimate in SOL. U.S. dollars included for both as an additional point of reference. Mostly for simplicity sake, I have that at a fixed exchange rate https://github.com/CalebEverett/arloader/blob/a7a7548c3e6512bac348aa45b1877cbf3ffef92a/src/solana.rs#L26, which currently happens to be pretty close to where the market prices are relative to dollars. I've thought about making that more dynamic, but the volume is fairly low overall and it is mostly there as a convenience.
  4. The arloader code is complete open source, so you can check all of this to verify:. Here is the code for creating the solana tx: https://github.com/CalebEverett/arloader/blob/a7a7548c3e6512bac348aa45b1877cbf3ffef92a/src/solana.rs#L108. And here is where that gets sent to the arloader.io endpoint. https://github.com/CalebEverett/arloader/blob/a7a7548c3e6512bac348aa45b1877cbf3ffef92a/src/lib.rs#L967

Hope that helps, happy to answer any other questions.

— Reply to this email directly, view it on GitHub https://github.com/CalebEverett/arloader/issues/17#issuecomment-1064697735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIKTHU7USQJZEOGY3O2QSETU7KS5NANCNFSM5QN5PCUA . You are receiving this because you authored the thread.Message ID: @.***>