Page 1 of 4

shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 5:04 am
by kurumiimari
Hey there!

I'd like to introduce shakedex, a CLI-based decentralized exchange for Handshake names. It works under the hood using the non-interactive name swap protocol described here, but uses CLI interface to make things much simpler:

Installation:

Code: Select all

npm i -g shakedex
shakedex talks to your hsd full node's wallet, so be sure to install that too.

Sell side:
  1. Transfer your name to a locking script using shakedex transfer-lock <yourname>.
  2. Finalize your name to the locking script using shakedex finalize-lock <yourname>.
  3. Create an auction by running shakedex create-auction <yourname>. This will spit out a list of pre-signed auction transactions that anyone can fill in order to execute the name swap.
See the footnotes below for the details of what's going on here.

Then, on the buy side:
  1. Download a list of pre-signed auction transactions.
  2. Fulfill the best bid at the current time by running shakedex fufill-auction <path to the presigns>.
  3. Finalize the swap by running shakedex finalize-auction <name>. That's it!
Sell side footnotes:

The purpose of the locking script is to make sure that the swap can complete atomically by preventing the name from being updated, revoked, or renewed while the auction is active.

The pre-signed auction transactions form a reverse-Dutch auction. Reverse-Dutch auctions are auction in which the auctioneer sets a high starting bid and decreases it over time until someone chooses to fulfill the bid. With shakedex, each pre-signed auction transaction uses nLockTime to prevent name swaps of lower bid amounts until a certain time is reached. The create-auction command lets you configure this.

I've attached an example set of auction presigns to this post - I'll create a mainnet auction once I finish buying a couple of throwaway names.

Buy side footnotes:

Once name buyers execute the fulfill-auction command they'll need to wait 48 hours for Handshake's transfer lockup to expire before being able to update the name. However, because of the locking script the name is effectively theirs the moment their fulfill transaction is confirmed.

Example presigns:

Code: Select all

{"name":"yeet","lockingTxHash":"4d36784c48da73283541ff7321aa6f484a5125458845e2df78982a01ede5d6ca","lockingOutputIdx":0,"publicKey":"03b10ad937d89152b85e5560052c4f467c489c7c9519af2a8df2cf6daa5fdce8d4","paymentAddr":"rs1qy89693mvr9wahqx0czy8x706efd8d7ad932s78","price":10000000000,"lockTime":1612601826,"signature":"10dd0c9e384bf76f9e21d50201cfbffa417216efe5f1eb87c143c691713dd25c2829454ccabee5a61474f2c3fedc1116d6589d14df1279ca484063c9ec7aa55e84"}
{"name":"yeet","lockingTxHash":"4d36784c48da73283541ff7321aa6f484a5125458845e2df78982a01ede5d6ca","lockingOutputIdx":0,"publicKey":"03b10ad937d89152b85e5560052c4f467c489c7c9519af2a8df2cf6daa5fdce8d4","paymentAddr":"rs1qhdaj3czcgma3xd8lxan2fv29rlagkqe6vd90qe","price":9587500000,"lockTime":1612605426,"signature":"bf8cf96d339a7c96687610e09c00bd723d10cf69565fe31b0b3e77c6fd0f188c3b6cd05ba0ee9b6e79ec31dcc2fa320b1e9d8b5ad083bb0aad6a1aec3095ed6d84"}
{"name":"yeet","lockingTxHash":"4d36784c48da73283541ff7321aa6f484a5125458845e2df78982a01ede5d6ca","lockingOutputIdx":0,"publicKey":"03b10ad937d89152b85e5560052c4f467c489c7c9519af2a8df2cf6daa5fdce8d4","paymentAddr":"rs1qggsn5c5exadzt7l34mnsfyaj3aakeyuur6n7dd","price":9175000000,"lockTime":1612609026,"signature":"43aa149f81013d6832619118c8a8d60de6d8a525b248d8813a8a4f12c7c2ecaa45cbe20485a41678264528c33b04f7dab89be7bb5ffda91a4bd9a641fed57fcc84"}
{"name":"yeet","lockingTxHash":"4d36784c48da73283541ff7321aa6f484a5125458845e2df78982a01ede5d6ca","lockingOutputIdx":0,"publicKey":"03b10ad937d89152b85e5560052c4f467c489c7c9519af2a8df2cf6daa5fdce8d4","paymentAddr":"rs1qc0u7zk098tykac4emfhymp74ruh4tyjjc0puqw","price":8762500000,"lockTime":1612612626,"signature":"e8fa4943e238164bb4904b839dc8aa9ba0945fa149eff33fa4ddeb6c20350f4c6e7eb40042be125dad765efea0282d9d7c52629d5298dd115320175267c97eb884"}
{"name":"yeet","lockingTxHash":"4d36784c48da73283541ff7321aa6f484a5125458845e2df78982a01ede5d6ca","lockingOutputIdx":0,"publicKey":"03b10ad937d89152b85e5560052c4f467c489c7c9519af2a8df2cf6daa5fdce8d4","paymentAddr":"rs1qa3l34tntpck55cfraftpqy830wztjc882cagm4","price":8350000000,"lockTime":1612616226,"signature":"a277c1ffd07689609f1632da640ad241349ccf5d45e3a23e9f7c8f44ddc5c1727b3f5fa6ee13b7e70fe88f2d4ec6a0e61a8ad5eb3c8f42a973b5f1a9bf39e59c84"}
{"name":"yeet","lockingTxHash":"4d36784c48da73283541ff7321aa6f484a5125458845e2df78982a01ede5d6ca","lockingOutputIdx":0,"publicKey":"03b10ad937d89152b85e5560052c4f467c489c7c9519af2a8df2cf6daa5fdce8d4","paymentAddr":"rs1qcrztsyv7u5q97rdg26mueay9spldnn0jfmz092","price":7937500000,"lockTime":1612619826,"signature":"52f37b4a1fb903961ab4262df4728e587988de223eef4705ad0e7d48ee75e2cb5180347202bb15fd6b0285adc1a4f2c78599ba2154fc03865e04b12ed0de99d084"}
I'd love to get some feedback on this project. If anyone has a name that they are willing to part with on mainnet to help me test this, I'm willing to pay up to 500 HNS for it. Just let me know.

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 5:58 am
by cjj
Wow...This is inspiring!!

Great work you did here! The more ways to trade the better !
@skyinclude look into this please...Spread the word in the telegram and discord !

But I want to ask why are you being anonymous...a look on your GitHub profile is enough to say that you created it to hide your real identity...Anyways it is your wish really...

Anyways really appreciate you for working on this amazing Decentralized exchange !

Please do it in the telegram groups “viewtopic.php?f=11&t=21” and in the discord name community https://discord.com/invite/V3aTrkp
You may even get 20,000 HNS for creating this as part of a Hackathon

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 6:46 am
by kurumiimari
Wow...This is inspiring!!

Great work you did here! The more ways to trade the better !
@skyinclude look into this please...Spread the word in the telegram and discord !
Thank you!
But I want to ask why are you being anonymous...a look on your GitHub profile is enough to say that you created it to hide your real identity...Anyways it is your wish really...
I believe that we'll all be pseudo-anonymous in the future. For all intents and purposes, Kurumi Imari is a real person. She writes code. She chats with others. She has a reputation that follows her wherever she goes. The fact that Kurumi Imari is not on someone's birth certificate doesn't change any of those things. Crypto enables the decentralization of not only money but identity too - and since I'm a decentralized identity maximalist, I'd be slowing the adoption of decentralized identity by using my legal name.

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 6:47 am
by bob
Reviewed the code and it looks solid. Well done.

We have some ideas for how to bootstrap volume and make the UX shine. DM here or on TG if you'd are interested in collaborating to get this into prod w/ Bob users.

We also have a few names we're willing to yolo-list.

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 6:54 am
by kurumiimari
We have some ideas for how to bootstrap volume and make the UX shine. DM here or on TG if you'd are interested in collaborating to get this into prod w/ Bob users.
Nice, DM'd!
We also have a few names we're willing to yolo-list.
Let's do it - we can coordinate publicly by posting the transaction hashes in the buy/trade/barter channels once we get set up.

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 9:48 am
by andrew3000
this is amazing!

have done a few Atomic swaps now - but all my names are either in Bob or Namebase - would either work?

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 10:32 am
by skyinclude
kurumiimari wrote: Mon Feb 08, 2021 5:04 am Hey there!

I'd like to introduce shakedex, a CLI-based decentralized exchange for Handshake names. It works under the hood using the non-interactive name swap protocol described here, but uses CLI interface to make things much simpler:

Wow - this is really awesome to see - there has been discussions about reverse auctions - and now with the 1 year anniversary of Handshake it seems like an ideal time.


Thanks CJJ - for sure I will share this in various Telegram and social media groups.

Glad to see Bob Wallet already connecting and reviewing the code.

Thank you kurumiimari

i'm not too technical, more an internet marketer - and hope to get more people to know about and use your new tool. And I think Bob is the perfect one to talk to as well.

cheers all - HNS to the moon!

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 6:04 pm
by pinheadmz
Incredible work I opened some issues and left comments on the README commit.

I'm playing around with this locally right now really amazing work, and such fast turn-around from your first issue about the `RELEASE` covenant!

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Mon Feb 08, 2021 9:04 pm
by kurumiimari
have done a few Atomic swaps now - but all my names are either in Bob or Namebase - would either work?
Bob will work once I chat with the Bob team about adding this as a feature within Bob. You'll need to transfer your names out from Namebase to either Bob or HSD to use shakedex - NB restricts the kinds of transactions you can do with your names. This problem was part of the reason I decided to make shakedex :)
Incredible work I opened some issues and left comments on the README commit.

I'm playing around with this locally right now really amazing work, and such fast turn-around from your first issue about the `RELEASE` covenant!
Thank you sir! I couldn't have done it without you pointing me in the right direction.

Re: shakedex - Non-Interactive, Reverse-Dutch Auction Name Swaps

Posted: Tue Feb 09, 2021 12:21 pm
by jacobjonz
This is awesome. I'm really excited about it. Kudos.

HNS.to is a highly insecure way of browsing Handshake domains and should only be used for demo or educational purposes. Click to see preferable resolutions methods