# W-OTS Migration Address
## Summary
Starting with Chrysalis Part 2, the IOTA protocol will remove support for W-OTS signatures and addresses. As such, there needs to be a migration process of moving funds from W-OTS addresses in the old network to Ed25519 in the new network.
The proposed solution involves moving funds to a legacy address uniquely generated from the desired target Ed25519 address. This documents describes how this migration address is computed.
## Detailed design
### Generating the migration address
According to [Draft RFC-8](https://github.com/luca-moser/protocol-rfcs/blob/signed-tx-payload/text/0000-transaction-payload/0000-transaction-payload.md) an Ed25519 address A consists of 32 raw bytes. This needs to be converted to a 81-tryte address:
- Compute the [SHA-256](https://csrc.nist.gov/publications/detail/fips/180/4/final) hash H of A.
- Append the first 4 bytes of H to A resulting 36 bytes.
- Convert A to trytes using the `b1t6` encoding (as described in [RFC-15](https://github.com/iotaledger/protocol-rfcs/blob/master/text/0015-binary-to-ternary-encoding/0015-binary-to-ternary-encoding.md)). This results in A<sub>tri</sub> consisting of 72 trytes.
- Prepend the 9-tryte prefix `MIGRATION` to A<sub>tri</sub> to get a legacy 81-tryte address.
Since A<sub>tri</sub> is an arbitrary address generated without any underlying private key, it will be practically impossible to access funds on those addresses.
### Decoding the migration address
- Valid migration addresses start with `MIGRATION` and the following 72 trytes represent a valid `b1t6` encoding of 36 bytes.
- The first 32 bytes of the result are called A and the last 4 bytes H.
- Check that H matches the first 4 bytes of the SHA-256 hash of A.
- The encoded Ed25519 address is A.
### Example
- Ed25519 address (32-byte): `e163b14ff96399f96c010de17a631b7dc4206bc9a7d1b383c2a18600a64db133`
- Migration address (81-tryte): `MIGRATIONWZRDBXYCT9RDEWT99DA9M9WZNERD9AQEUYEAZDZYSXGYDXJVSYMWMV99RXWCBXXBFCGVCZCB`
> Example Go implementation in [wollac/iota-crypto-demo](https://github.com/Wollac/iota-crypto-demo):
> - Address generation and decoding: [pkg/migration](https://github.com/Wollac/iota-crypto-demo/blob/master/pkg/migration/migration.go)
## Open Questions
- Instead of SHA-256 any cryptographic hash function can be used like BLAKE2b. However, since SHA-256 is arguably the most common secure hash function, it has been selected.
- Any alternative prefix is fine. However it should make sense logically and there should not be too many addresses currently starting with this prefix.