Buys & Renewals

Contract: TLDRegistrar.Commit

Creates a commitment to buy a second-level domain without disclosing the actual name. This is implemented according to our commit&reveal scheme.
Entrypoint: commit
Parameter Type
Description
bytes
SHA-512 hash of a packed tuple of label, owner, and a random nonce corresponding to the intended buy (see TLDRegistrar.Buy). The hashed tuple is of the Michelson typepair (pair bytes address) nat. Having a random nonce prevents susceptibility to dictionary attacks.
CamelLIGO
Michelson
1
type commit_param = bytes
2
3
| Commit of bytes
Copied!
1
parameter (or
2
(bytes %commit)
3
# ... more entrypoints outside of this interoperability spec
4
);
Copied!
Error
Description
AMOUNT_NOT_ZERO
The transferred amount of tez is not zero.
COMMITMENT_EXISTS
The given commitment exists. A commitment with a new nonce has to be generated.

Contract: TLDRegistrar.Buy

Buys a second-level domain based on previous commitment (see TLDRegistrar.Commit).
Entrypoint: buy
Amount restriction: The amount sent with this call has to be equal to the price of the domain. The price in mutez is calculated as standard_price_per_day * duration / 1000000.
Parameter
Type
Description
label
bytes
The UTF-8 encoded label of the second-level domain to buy.
duration
nat
Ownership duration represented in days.
owner
address
The new owner of the given domain.
address
address option
The optional address the given domain resolves to.
data
(string, bytes) map
A map of any additional data clients wish to store with the given domain.
nonce
nat
The chosen commitment nonce.
CamelLIGO
Michelson
1
type buy_param = {
2
label: bytes;
3
duration: nat;
4
owner: address;
5
address: address option;
6
data: (string, bytes) map;
7
nonce: nat;
8
}
9
10
| Buy of buy_param michelson_pair_left_comb
Copied!
1
parameter (or
2
(pair %buy (bytes %label)
3
(pair (nat %duration)
4
(pair (address %owner)
5
(pair (option %address address)
6
(pair (map %data string bytes) (nat %nonce))))))
7
# ... more entrypoints outside of this interoperability spec
8
);
Copied!
Error
Description
COMMITMENT_DOES_NOT_EXIST
Corresponding commitment (see TLDRegistrar.Commit) was not created before.
COMMITMENT_TOO_OLD
The commitment is too old (older than configured age). Try recreating it again.
COMMITMENT_TOO_RECENT
The commitment is too recent (younger than configured age). Wait for some time.
LABEL_TAKEN
The requested label already exists and it is not expired.
LABEL_NOT_AVAILABLE
The requested label is currently not available for registration.
LABEL_IN_AUCTION
The requested label is currently only available in auction.
INVALID_LABEL
The given label is not valid. See Label Validation.
LABEL_EMPTY
The given label is empty.
LABEL_TOO_LONG
The label is too long.
NAME_TOO_LONG
The name (label + parent) is too long.
DURATION_TOO_LOW
The requested duration is too low (lower than the configured minimum).
AMOUNT_TOO_LOW
The transferred amount is lower than the actual price.
AMOUNT_TOO_HIGH
The transferred amount is higher than the actual price.

Contract: TLDRegistrar.Renew

Renews second-level domain for requested duration.
Entrypoint: renew
Amount restriction: The amount sent with this call has to be equal to the price of the domain. The price in mutez is calculated as standard_price_per_day * duration / 1000000.
Parameter
Type
Description
label
bytes
The UTF-8 encoded label of the second-level domain to buy.
duration
nat
The renewal duration represented in days.
CamelLIGO
Michelson
1
type renew_param = {
2
label: bytes;
3
duration: nat;
4
}
5
6
| Renew of renew_param michelson_pair_left_comb
Copied!
1
parameter (or
2
(pair %renew
3
(bytes %label)
4
(nat %duration))
5
# ... more entrypoints outside of this interoperability spec
6
);
Copied!
Error
Description
LABEL_NOT_FOUND
The requested label does not exist.
LABEL_EXPIRED
The requested label exists but it is expired. Therefore it can be bought, not renewed.
DURATION_TOO_LOW
The specified duration is too low (lower than the configured minimum).
AMOUNT_TOO_LOW
The transferred amount is lower than the actual price.
AMOUNT_TOO_HIGH
The transferred amount is higher than the actual price.