State: Rough but working.
StakeNS is a voting-based naming system for Arweave, powered by AO. To begin, send (AOCRED-Test) tokens to the StakeNS process's pid. Then, utilize these tokens to vote for who should control what name by staking them. Stakes are reclaimable, allowing you to change your mind and withdraw tokens from the process.
The idea is stolen from how community URLs in LBRY protocol work, for details see: https://lbry.com/faq/naming and https://tech.lbry.nu/spec#appendix
Simple UI for StakeNS process can be found from here https://arweave.net/dTBZWiafcjFLd4-FvkQl5FOfRHl0djXLEgz8OU3IlVM/
- Send some CREDs to your wallet connected to the page
- Send some of the CREDs to the process using the option on the page
- Create a record for a name you want, and test out the results at https://jees.site/ (Naming works similar to ArNS, like
https://name.jees.site/
)
Note:
https://jees.site/ should also have required header set for it to work with a gateway node, and can be used by changing theTRUSTED_ARNS_GATEWAY_URL="https://__NAME__.arweave.dev"
toTRUSTED_ARNS_GATEWAY_URL="https://__NAME__.jees.site"
in .env file. (I think)
- Send some CREDs to the StakeNS process, using the
Transfer
action in the CRED process. (Don't useCast
tag, or tokens will get stuck to the process) - Use
CreateNameRecord
to create a record for the name, and to stake some CREDs for it, and to set what txid it should direct to.
- Find out that the name you want is already taken by someone else.
- Stake more tokens to it than they have by using the
CreateStake
action- Each stake has an activation delay. Activation delay is based on the time the current holder has held the control over the record. For each block passed, the new stakes will have an additional block of an activation delay, capping at 5040 blocks(~7 days).
- You can also stake tokens on someone else's behalf, to help them to takeover the control.
- Wait for your stake to activate and call
ResolveNewRecordHolder
to trigger a takeover. - Update the record to point to the txid you want with the
UpdateNameRecord
action
- Use
RetrieveState
state to get the state for the process, and find ids of your stakes. (Decode the json value from theState
tag in response, and look for your stakes in there.Stakes[your-address][staked-recordname]
) - Use
ReclaimStake
to revoke some of your stakes and get the CREDs available for staking elsewhere or for withdrawing. - Use
Withdraw
to tell process to send you back a specified quantity of your CREDs
StakeNS = "98x5osvP4pTIDNfqbMl7UphYzSR9ai2WPxeQ7YXeXA4"
TokenPid = "Sa0iBLPNyJQrwpTTG-tWLQU-1QeUAJA73DdxGGiKoJc"
Send({ Target = TokenPid, Action = "Transfer", Quantity = "10", Recipient = StakeNS })
Send({ Target = StakeNS, Action = "CreateNameRecord", RecordName = "Name", StakeQty = "10", TargetTxid = "txid-to-content", UndernamesTxid = "txid-to-json-containing-undernames" })
UndernamesTxid
is optional.
Send({ Target = StakeNS, Action = "UpdateNameRecord", TargetTxid = "txid-to-content", UndernamesTxid = "txid-to-json-containing-undernames" })
Only one of the TargetTxid
or UndernamesTxid
is required.
Send({ Target = StakeNS, Action = "CreateStake", RecordName = "Name", StakeQty = "10", Beneficier = "address-of-the-beneficier" })
Beneficier
is optional, by default it will be set to the sender.
Send({ Target = StakeNS, Action = "ReclaimStake", RecordName = "Name", StakeId = "stakeID" })
Send({ Target = StakeNS, Action = "ResolveNewRecordHolder", RecordName = "Name" })
Send({ Target = StakeNS, Action = "Withdraw", Quantity = "10" })
Send({ Target = StakeNS, Action = "RetrieveState"})
Name records on StakeNS can have undernames, similar to how ArNS has undernames. Undernames are to be stored in a json file uploaded to Arweave, and its txid can be linked to the name record.
Format for the undernames json:
{
"version": "0.1.1",
"undernames": [
{ "name": "undername", "txid": "content-txid" },
...
]
}