Hydro
  • Getting Started
  • Raindrop
    • Raindrop Overview
    • Client Side Raindrop
      • Client-Side Raindrop Overview
      • Handling User Signatures
      • Recognizing Users
      • User Account Management
        • Check if Username is Taken
        • Creating HydroIDs
        • Creating HydroIDs (delegated)
        • Deleting Users
      • Verifying signatures
    • Server Side Raindrop
  • Snowflake
    • Snowflake Overview
      • Setting Up Snowflake
      • Naming Conventions
      • Handling User Signatures
    • Address Management
      • Adding Addresses
      • Removing Addresses
    • Provider Management
      • Add Providers
      • Upgrade Providers
    • Resolver Management
      • Adding Resolvers
      • Adding Resolvers (delegated)
      • Removing Resolvers
    • Allowances in Snowflake
      • User Hydro Balances and the Allowance Structure
      • Allowance management logic
      • Setting Initial DApp Allowances
      • Changing DApp Allowances
      • Change DApp Allowances (Delegated)
    • Payments in Snowflake
      • Self-Initiated Payments
      • Resolver-Initiated Payments
        • EIN - EIN Transfer
        • EIN - Address Withdrawal
      • Resolver-Initiated Via Payments
        • EIN - Via - EIN Transfer
        • EIN - Via - Address Withdrawals
      • Resolver-As-Escrow Payments
        • Resolver - EIN Transfer
        • Resolver - Address Withdrawal
      • Resolver-As-Escrow Via Payments
        • Resolver - Via - EIN Transfer
        • Resolver - Via - Address Withdrawal
    • Building a Resolver
      • Smart Contract
      • React Front-End
    • Building a Via Contract
  • Ice
    • Untitled
  • Tide
    • Untitled
Powered by GitBook
On this page

Was this helpful?

  1. Snowflake
  2. Address Management

Adding Addresses

Add Addresses

To add an address to an existing EIN, call the addAssociatedAddressDelegated function on the Identity Registry.

To remain a trustless process, adding an address requires two signatures - one from a current Associated Address, and one from the Associated Address to be claimed.

To add an Associated Address, call the addAddress function on the Snowflake smart contract with the approvingAddress, addressToAdd, r,s,v signatures from both addresses, and the timestamp of the function call.

Signatures should follow the example format:

require(
    isSigned(
        approvingAddress,
        keccak256(
            abi.encodePacked(
                byte(0x19), byte(0), address(this),
                "I authorize adding this address to my Identity.",
                ein, addressToAdd, timestamp[0]
            )
        ),
        v[0], r[0], s[0]
    ),
    "Permission denied from approving address."
);
require(
    isSigned(
        addressToAdd,
        keccak256(
            abi.encodePacked(
                byte(0x19), byte(0), address(this),
                "I authorize being added to this Identity.",
                ein, addressToAdd, timestamp[1]
            )
        ),
        v[1], r[1], s[1]
    ),
    "Permission denied from address to add."
);

ARGUMENTS

Parameter

Type

Description

approvingAddress

address

A current Associated Address of the EIN.

addressToAdd

address

Address to be added to the user's EIN.

[r], [s], [v] signatures

[bytes32], [bytes32], [uint8]

Signed messages from each address as required in the example format.

timestamp

uint

Timestamp of the function call - to prevent replay attacks.

PreviousAddress ManagementNextRemoving Addresses

Last updated 6 years ago

Was this helpful?