Think SMS cell phone number verification for ethereum addresses.
Possible use cases:
Exchanges could use this contract to verify their user's withdrawal addresses before sending them crypto currencies.
This could remove a possible user error from the withdrawal processes.
The contract is deployed at address 0x6d2f190e6fd3bece517cb817254e8411249656a6 on the Ethereum live blockchain.
git clone https://github.com/smoove/AddressOwnershipVerification.git
cd AddressOwnershipVerification
npm install
truffle compile
truffle migrate # make sure testrpc/geth/parity is running
npm run build
truffle serve
Then navigate to http://localhost:8080/ in your browser.
address
: An ethereum address
transactor
: The party that wants to verify another parties ownership over address
transactee
: The party that is asked to verify their ownership of address
deposit
: A randomly generated number. It represents the amount of wei transactee
has to send to verify ownership of address
.
- Transactor receives an address from transactee, who claims to own said address.
- Transactor generates a random number,
deposit
. This can be anything greater than 0 up to uint32's max value (4294967295). - Transactor calls
request(address, deposit)
- Transactor tells transactee to send
deposit
amount of wei to this contract - Transactee could also listen for theRequestEvent
event to get notified. - Transactee sends
deposit
amount of wei to this contract fromaddress
- Transactor listens for the
TrustEvent
event or gets informed by transactee that the deposit has been sent - Transactor can now call
verify(transactor, address)
to know wether or not transactee has fullfilled the request
optional:
- Transactor or transactee can call
removeRequest(transactor, transactee)
to cancel a pending request before it was verified. This triggers theRemoveRequestEvent
event. - Transactor or transactee can call
revoke(transactor, transactee)
to revoke the verification and return deposit to transactee. This triggers theRevokeEvent
event.
event RequestEvent(address indexed transactor, address indexed transactee, uint32 indexed deposit);
Triggered when a new request is created.
event RemoveRequestEvent(address indexed transactor, address indexed transactee);
Triggered when a pending request is removed by either party before it was verified.
event VerificationEvent(address indexed transactor, address indexed transactee, uint32 indexed deposit);
Triggered when a pending request is successfully verified.
event RevokeEvent(address indexed transactor, address indexed transactee, uint32 indexed deposit);
Triggered when either party revokes an existing verification.
truffle test