seed-xor builds on top of rust-bip39 and lets you XOR bip39 mnemonics as defined in Coldcards docs.
It is also possible to XOR mnemonics with differing numbers of words. For this the shorter one will be extended with 0s during the XOR calculation.
```rust use seed_xor::Mnemonic; use std::str::FromStr;
// Coldcard example: https://github.com/Coldcard/firmware/blob/master/docs/seed-xor.md let astr = "romance wink lottery autumn shop bring dawn tongue range crater truth ability miss spice fitness easy legal release recall obey exchange recycle dragon room"; let bstr = "lion misery divide hurry latin fluid camp advance illegal lab pyramid unaware eager fringe sick camera series noodle toy crowd jeans select depth lounge"; let cstr = "vault nominee cradle silk own frown throw leg cactus recall talent worry gadget surface shy planet purpose coffee drip few seven term squeeze educate"; let resultstr = "silent toe meat possible chair blossom wait occur this worth option bag nurse find fish scene bench asthma bike wage world quit primary indoor";
// Mnemonic is a wrapper for bip39::Mnemonic which implements the XOR operation ^
.
// Mnemonics can also be created from entropy.
let a = Mnemonic::fromstr(astr).unwrap();
let b = Mnemonic::fromstr(bstr).unwrap();
let c = Mnemonic::fromstr(cstr).unwrap();
let result = Mnemonic::fromstr(resultstr).unwrap();
assert_eq!(result, a ^ b ^ c); ```
## Useful resources - Coldcard docs: https://github.com/Coldcard/firmware/blob/master/docs/seed-xor.md - Easy bip39 mnemonic explanation: https://learnmeabitcoin.com/technical/mnemonic