-
Notifications
You must be signed in to change notification settings - Fork 5
DNS .p2p validation rules
This file describes the extra data stores and validation rules for the extra transaction types that the .p2p blockchain has on top of the standard bitshares_toolkit.
Valid values for the name
and value
fields are described here.
-
name
*current_bid
*current_bidder
*required_bid
*last_bid_block_num
We define an operation update_auction_table(name, current_bid, current_bidder, required_bid)
, which does what you expect.
last_bid_block_num
is updated automatically whenever an update_auction_table
op succeeds.
*name
*owner
*value
*owner_state
*last_update_block
*owner
*hash
Transactions are validated one at a time. All validation steps and operations are performed atomically. (Remember, any time you "withdraw" without depositing, you are destroying the shares AKA paying a transaction fee (to dividends)).
Operations:
-
withdraw
from any addressaddress_1
for at leastMIN_TRX_FEE
. - `update_precommit_table(owner=owner, hash=HASH(name, amount)) AND NO OTHER OPERATIONS
Validation:
- Either
domain_records[name]
must not exist, orowner_state[name]
must beDOMAIN_STATE_EXPIRED
-
withdraw
op succeeds (balances[address_1] > MIN_TRX_FEE
)
This transaction type is detected by the presence of an update_auction_table
op but WITHOUT a deposit
.
Operations:
withdraw(amount=AMOUNT1, owner=ANY_ADDR)
- `update_auction_table(name=name, current_bid=amount, current_bidder=owner, required_bid=2*amount)
-
delete precommit_table[owner]
AND NO OTHER OPERATIONS
Validation:
AMOUNT1 > GLOBAL_MIN_BID
-
withdraw
op succeeds (balances[ANY_ADDR] > AMOUNT1
) -
domain_record_table[name]
does not exist ORdomain_record_table[name].owner_state == DOMAIN_STATE_EXPIRED
precommit_table[owner].hash == HASH(name, amount)
- Transaction is signed by
owner
Notice that it is the first first_bid
, and not the first precommit
, which determines who the first bidder is.
This transaction type is detected by the presence of an update_auction_table
AND a deposit
operation.
Operations:
- `withdraw(amount=AMOUNT1, address=ANY_ADDR)
- `deposit( amount=(AMOUNT1-auction_table[name].current_bid) * BIDDER_RETURN_RATIO, address=auction_table[name].current_bidder)
- `update_auction_table(name=name, current_bid = AMOUNT1, current_bidder = owner, required_bid = amount + (amount - auction_table[name].required_bid)) AND NO OTHER OPERATIONS
(notice a fee is paid equal to (AMOUNT1 - auction_table[name].current_bid) * (1 - BIDDER_RETURN_RATIO)
)
Validation:
AMOUNT1 > auction_table[required_bid]
-
withdraw
op succeeds -
deposit
op succeeds CURRENT_BLOCK - auction_table[name] < AUCTION_DURATION_BLOCKS
-
update_auction_table
op has exactly the values given in the description above
This transaction type is detected by the presence of a
This transaction type is detected by the presence of a update_domain_record_table
operation
Operations:
update_domain_record_table(name=name, value=value, owner=owner)
withdraw(amount=AMOUNT, addr=ANY_ADDR)
Validation:
- Transaction is signed by
domain_record_table[name].owner
AMOUNT > REQUIRED_TRX_FEE