v0.4.0
This release brings some breaking changes to the message payload formats, migrating to CAIP-2 identifiers everywhere, and some major networking upgrades!
What's new
- Specs now declare exactly which chains they support using an
export const chains: string[]
export.- If one isn't declared, it defaults to
["eip155:1"]
(Ethereum mainnet only). - Applying a message will throw an error if the message is signed for a chain not declared in the
chains
array. - You must provide a chain implementation for every chain declared in the spec to
Core.initialize
.
- If one isn't declared, it defaults to
- Ethereum session signatures now use SIWE instead of EIP-712. This should be transparent to users, but is a breaking change to the signature generation and verification.
- The subject URI of the SIWE message is
ethereum:${sessionAddress}
. - The
ipfs://Qm...
URI of the app is given as the only resource URI. - Ethereum session signatures are now a 3-tuple string format
${domain}/${nonce}/${signatureBytes}
so that the SIWE message text can be deterministically reconstructed by verifiers.
- The subject URI of the SIWE message is
- major libp2p upgrades resulting in faster peer discovery times and more reliable connections. Many thanks to the libp2p team for responding quickly to some bugs we found!
- More organized and colorful logging :)
Breaking changes
appName
has been removed from specs and message payloads.chain
andchainId
in action and session payloads have been consolidated into a single CAIP-2 chain identifierchain: string
. CAIP is a great project dedicated to solving cross-chain identifier formats better than we could have.- Before:
{ chain: "ethereum", chainId: "1", ... }
- After:
{ chain: "eip155:1", ... }
- Before:
- As a result, the constructor signature of the chain implementation classes have all changed.
EthereumChainImplementation
is nowconstructor(chainId: number, domain: string)
SubstrateChainImplementation
andSolanaChainImplementation
are bothconstructor(genesisHash: string)
CosmosChainImplementation
is nowconstructor(chainId: string, bech32Prefix: string)
Upgrade guide
The user-facing changes in this release are
- Update the constructor of your chain implementations. For example, if you're creating a
EthereumChainImplementation
, you have to pass it a number instead of a string. - A new way to pass Ethereum RPC URLs to the CLI
- Before:
--chain-rpc ethereum 1 http://...
- After:
--chain eip155:1=http://...
- Before:
- There are changes to the
ApplicationData
object returned from the root HTTP route.chains
is nowstring[]
instead ofRecord<string, string[]>
.
- Multi-chain apps now have to declare their specific set of supported chains using the
export const chains = [ ... ]
export with CAIP-2 identifiers.