trest-free exchange offer

que23que23 Member Posts: 14
Hello, I might as well get the ball rolling. I am having difficulty understanding the trust-free exchange offer example in the white paper.

First, there's mention of trading 10 shamir for 1 primegold. I had first assumed that this was another contract-based currency. However, the shamir-contract is never contacted. Instead, the tx.sender(Is this the PrimeGold contract?) is sent this: valuesent * 10485760. I don't know what that is. Valuesent should be 1. If the exchange was for 10 shamir, then the exchanger-contract should have sent a transaction to the shamir-contract. What is it sending to the PrimeGold contract? Ether?

Thanks
Post edited by VitalikButerin on

Comments

  • que23que23 Member Posts: 14
    I think I understand a little better. The counterparty sends a transaction to the Primegold contract to transfer PG to the exchange-contract's address, then sends a notification to the exchange-contract. It then contacts the PG-contract to transfer the PG to B. Then the exchange-contract sends the counterparty 10485760 (wei?) * the number of PG coins. I'm still confused about the Shamir reference.
  • que23que23 Member Posts: 14
    Also, how is this trust-free? Someone wrote the contract. How do we know it's an honest contract? Is there a way to look at the contract's instructions? If so, then it might be a good idea to have tool that allows people to compare standard contract templates and see if there are deviations that might indicate if a contract isn't doing what it's supposed to.
  • VitalikButerinVitalikButerin Administrator Posts: 84 admin
    > Is there a way to look at the contract's instructions?

    Yes, the contract is public.
Sign In or Register to comment.