ADD: THORChain Name Service (TNS)
Overview
- THORNames, aka vanity addresses
- Data structure has only 1 "chain" address associated. Edit to swap chain addresses, can query by any address or the
thorname
:
{ "SonOfOdin" :
{"THOR: "thor123",
"BTC" : "bc1",
"ETH" : "0x"}
}
/constants
Fees in -
TNSRegisterFee
: 10 RUNE -
TNSFeeOnSale
: 1000 BP -
TNSBlockFee
: 20 tor per block (roughly 1 RUNE per year)
Allowed Characters
Allow 1-21 characters (alpha-numeric) +_-
(can support 3*Emojis)
Referring to Sub-accounts
- A single name can be used for all of their asset accounts, but can be specified, such as
ALICE.ETH
,ALICE.BTC
by setting the ticker as a suffix. - Inferred: Swapping
BTC.BTC
toALICE
will send it to BTC address - Corrective: Sending
THOR.RUNE
toALICE.BTC
will send it toALICE.THOR
regardless.
Sales
- Anyone can make an offer for an existing THORName, they pay a "BID". Multiple people can bid on a name with various deposits.
- The owner can "ACCEPT" a bid, to complete the transfer, 10% fee to reserve.
- Bidders can "CANCEL" to get their deposit back.
Expiry
- TNS expires after the time of which paying fee
- User can just do another
REGISTER
with fees, to add to their expiry - After expiry sell to highest bidder, or if no bids, delete from KVStore.
- Randomly choose a TNS after
TNSExpiryBlocks
to expire every day.
Example
THORName can be used for a rune transfer or a swap.
|swap| asset |vanity_addr|merchant|fee
=:ETH.USDT-831EC7:SonOfOdin:ShapeShift:1000
The above example is 43 bytes
=:ETH.USDT-0XDAC17F958D2EE523A2206206994597C13D831EC7:SonOfOdin:ShapeShift:5000 //79bytes
=:ETH.USDT-1EC7:0XDAC17F958D2EE523A2206206994597C13D831EC7:ShapeShift:1000 //74 bytes
=:XMR.XMR:me //12 bytes
Events
Actions that move funds to the reserve should emit an event by tracking from Midgard. Ie, REGISTER, SALE
Transactions
Use MsgDeposit()
NEW NAME
Add a deposit for the fee. THOR address from member is automatically added.
TNS-NEW:NAME
TNS-NEW:ALICE
ADD CHAIN ADDRESS
No deposit required (but will pay normal gas fee). Will over-write what is already in there.
TNS-ADD:CHAIN:ADDRESS
TNS-ADD:BTC:bc1xcn7gw75ar874wk7p9c3cqncsv7pkanye45pnr
BID
Add a deposit for the bid
TNS-BID:NAME
TNS-BID:ALICE
SELL
No deposit required (but will pay normal gas fee)
TNS-SELL:ADDRESS
TNS-SELL:thor17gw75axcnr8747pkanye45pnrwk7p9c3cqncsv
CANCEL
Cancel a bid to get deposit back.
TNS-CANCEL:NAME
TNS-CANCEL:ALICE
Edited by THORChain