-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: provably locked anyone-can-renew/renew-only addresses for names #567
Conversation
Pull Request Test Coverage Report for Build 615185312
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ACK. On the usage of the script itself, feels like a double-edged sword. Going to lose control over updating the resource record to avoid the inconvenience of renewing seems like a pyrrhic victory. Then again, this is purely opt-in optional and totally allowed by the scripting system so idk. Seems like it could be useful in a limited number of cases where updates don't matter.
await node.sendTX(mtx.toTX()); | ||
await mineBlocks(1); | ||
|
||
const ns = await node.getNameStatus(nameHash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe test that the name resource i.e TXT record is preserved here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
await bob.fund(mtx, {coins: [coin]}); | ||
await bob.finalize(mtx, {coins: [coin]}); | ||
await bob.sign(mtx); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility that someone might grief the network by spamming renewals on every name sent here, using dust fee?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a possibility but renewals in general are rate-limited already by two factors:
- Renewals must be at least 1 tree interval apart (36 blocks):
Lines 1262 to 1267 in f2702f8
if (height < ns.renewal + network.names.treeInterval) { | |
throw new VerifyError(tx, | |
'invalid', | |
'bad-renewal-premature', | |
100); | |
} |
- Renewals are limited to 600 per block:
Line 208 in f2702f8
exports.MAX_BLOCK_RENEWALS = 600; |
Of course this pull request doesn't change anything - the cat's out of the bag. @tynes and I actually spoke with the project founders about this potential rule-bypass during testnet and there was some discussion about altering OP_TYPE
to more strictly enforce the intent of the renewal requirement, but ultimately it didn't get implemented.
I suppose there is a potential future risk to users that deploy contracts like this, that in the future the community may deploy a fork and break the pattern but right now, and especially in the use case described by @ca98am79, it seems to be a benefit.
|
||
assert.rejects( | ||
bob.sendTransfer(name, bobReceive), | ||
{message: 'Auction not found.'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why this says 'Auction not found' instead of Wallet does not own
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because Alice sent the open, the bid, the transfer - everything. Bob is just an innocent bystander (aka "anyone") so his wallet has no namestate data at all. Alice's wallet has some namestate data because she bid and actually owned the name at some point in the past. So its like, in her "watchlist" (walletDB nameMap
). But the UTXO that owns the name is not in her wallet or under her control.
You did make me curious though Im going to add a test to see if this action causes bob's wallet to start tracking the name, especially now that #564 has been merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok updated, Alice's wallet still tracks the name but Bob's never does.
We implemented this with our TLD .badass. You can see the transfer history here. The use case for us is to lock the TLD so that 2nd-level domain owners do not have to trust the TLD owner. It is provably owned by no one, but renewable by anyone. |
9a2cfc7
to
749bde9
Compare
749bde9
to
f8f0d27
Compare
Just a thought: if people are upset by this behavior being abused on chain, it can be avoided with a soft-fork which terminates script execution if OP_TYPE's corresponding output is a RENEW. Of course, there is a cost to this: names which utilize OP_TYPE must use TRANSFER/FINALIZE as their RENEW mechanism. edit: New behavior for OP_TYPE could be enabled in a new witness version which censors the RENEW integer (making it look like an UPDATE/TRANSFER possibly). |
This PR just adds a test to hsd, but like #500 it also acts like a standardizing document for wallet implementations to use and most importantly, proves that the following addresses encode the following script hash. Note that
8
is the type for RENEWIf you send a name to one of these addresses and FINALIZE. No one will ever be able to do anything with that name except RENEW. And anyone can renew it by simply adding a miner fee and broadcasting. This effectively "locks" the name forever, unless the entire community forgets to renew the name within the 2-year window.