BSV
$72.2
Vol 123.06m
4.63%
BTC
$98851
Vol 86970.35m
-0.23%
BCH
$544.92
Vol 1515.63m
9.77%
LTC
$100.84
Vol 1892.19m
11.85%
DOGE
$0.42
Vol 17027.63m
7.19%
Getting your Trinity Audio player ready...

This post was first published on Medium.

nChain
Vanity Address

Previously, we have shown a novel and private way to purchase Bitcoin vanity addresses, using Zero-Knowledge Key-Statement Proof. In practice, it has one drawback: after the buyer verifies the proof in step 7, he can abort the exchange protocol and the seller wastes resources to find an answer but does not get paid.

To overcome this drawback, we conduct the exchange entirely on chain using a smart contract. It only pays out if a private key is provided such as the derived/combined public key/address meets the vanity pattern. Full code is shown below.

 

To compute point addition (Line 16) and multiplication (Line 13) efficiently, we leverage the same technique as before. After we have the combined public key, we validate its corresponding address meets the predefined vanity pattern at Line 19.

Extension

We have only showed how to verify the derived address has certain prefix. But it is straightforward to extend it to have the address or the public key meet any arbitrary requirement.

Watch: CoinGeek New York presentation, Smart Contracts & Computation on Bitcoin

Recommended for you

David Case gets technical with Bitcoin masterclass coding sessions
Whether you're a coding pro or a novice, David Case's livestream sessions on the X platform are not to be...
November 21, 2024
NY Supreme Court’s ruling saves BTC miner Greenidge from closing
However, the judge also ruled that Greenidge must reapply for the permit and that the Department of Environmental Conservation has...
November 20, 2024
Advertisement
Advertisement
Advertisement