Skip to content

v0.4.0

Compare
Choose a tag to compare
@joeltg joeltg released this 18 Apr 14:56
· 1956 commits to main since this release

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.
  • 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.
  • 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 and chainId in action and session payloads have been consolidated into a single CAIP-2 chain identifier chain: 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", ... }
  • As a result, the constructor signature of the chain implementation classes have all changed.
    • EthereumChainImplementation is now constructor(chainId: number, domain: string)
    • SubstrateChainImplementation and SolanaChainImplementation are both constructor(genesisHash: string)
    • CosmosChainImplementation is now constructor(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://...
  • There are changes to the ApplicationData object returned from the root HTTP route.
    • chains is now string[] instead of Record<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.