address-ownership-verification v0.0.1
An ethereum address ownership verification smart contract
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.
Requirements
Online demo
:TODO:
Local installation
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 serveThen navigate to http://localhost:8080/ in your browser.
Usage
Definitions
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.
Suggested workflow
- 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
depositamount of wei to this contract - Transactee could also listen for theRequestEventevent to get notified. - Transactee sends
depositamount of wei to this contract fromaddress - Transactor listens for the
TrustEventevent 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 theRemoveRequestEventevent. - Transactor or transactee can call
revoke(transactor, transactee)to revoke the verification and return deposit to transactee. This triggers theRevokeEventevent.
Events
RequestEvent
event RequestEvent(address indexed transactor, address indexed transactee, uint32 indexed deposit);Triggered when a new request is created.
RemoveRequestEvent
event RemoveRequestEvent(address indexed transactor, address indexed transactee);Triggered when a pending request is removed by either party before it was verified.
VerificationEvent
event VerificationEvent(address indexed transactor, address indexed transactee, uint32 indexed deposit);Triggered when a pending request is successfully verified.
RevokeEvent
event RevokeEvent(address indexed transactor, address indexed transactee, uint32 indexed deposit);Triggered when either party revokes an existing verification.
Running tests
truffle test9 years ago