Let’s go through a fuller story.
- Mr A registers
a.eth, somehow no one contests. During the registration process, Mr A puts 100 ETH into the contract as a rent payment budget. Mr A now owns
a.eth, with a rent of 0 (or alternatively one could set a base minimum fee of eg. $5 per year).
- Mr B registers a bid for
a.eth, at a price of 10 ETH, and locks up an additional fee prepayment of 2 ETH (so 12 ETH total) [it’s theoretically legal to have a fee prepayment of zero but that’s stupid because then if you win the domain you would immediately lose it due to the fee contract going bankrupt]. The fee that A has to pay now goes up to 0.1 ETH per year (10 ETH bid * 1% assumed tax rate per year).
- Mr C registers a bid for
a.ethat a price of 20 ETH, and locks up an additional fee prepayment of 2 ETH (so 22 ETH total). The fee that Mr A has to pay now goes up to 0.2 ETH per year (20 ETH * 1%)
- A year passes. At this point, Mr A is free to withdraw only 99.8 ETH from the fee prepayment contract, because 0.2 ETH per year is taken as a fee (no need to have a “pinging” mechanism; the contract can lazy-evaluate the remaining balance at any time). Mr B and Mr C still have 12 and 22 ETH locked up, respectively; you don’t pay a fee to bid.
- Mr A decides that he wants to sell, so he sells to the highest bidder (Mr C). Mr A gets the 20 ETH, and automatically gets handed back his remaining fee balance, so he gets a total 119.8 ETH. Mr C is now the owner of the domain; of his original 22 locked up ETH, 20 was given to Mr A, so 2 is the remaining fee balance. The next highest bidder is Mr B, who bids 10 ETH, so the fee that Mr A has to pay is 10 * 1% = 0.1 ETH per year.
- A year passes. At this point, Mr C is free to withdraw only 1.9 ETH.
- It turns out that Mr C lost his private key, so he will never voluntarily give up the domain. Suppose no one else comes to make a higher bid. 19 years later, Mr C’s contract is “bankrupt”. If there is another bidder, the highest bidder can now snap up the domain at his own bid price; if there is no bidder, then anyone can snap it up for free.
Am I correct to assume that people can only top up fund to X contract, but cannot withdraw?
Any deposit that is made into a fee payment contract can be withdrawn, except for an amount that corresponds to the fee that has accrued. Any deposit that is made to make a bid can be recovered by withdrawing the bid at any time.
Hope that helps.