This would allow wallet operations like funding transactions with smart contract-based inputs such as LN, or any input the Core wallet doesn't know how to sign for.

https://github.com/bitcoin/bitcoin/pull/17211#issuecomment-933674310
bool fUpdated = false;
    bool is_mine;
    {
        LOCK(cs_);
        std::map<CTxDestination, CAddressBookData>::iterator mi = m_address_book.find(address);
        fUpdated = (mi != m_address_book.end() && !mi->second.IsChange());
        m_address_book[address].SetLabel(strName);
        if (!strPurpose.empty()) /* update 
            m_address_book[address].purpose = strPurpose;
        is_mine = IsMine(address) != ISMINE_NO;
    }
    NotifyAddressBookChanged(address, strName, is_mine,
                             strPurpose, (fUpdated ? CT_UPDATED : CT_NEW));
    if (!strPurpose.empty() && !batch.WritePurpose(EncodeDestination(address), strPurpose))
        return false;
    return batch.WriteName(EncodeDestination(address), strName);
}
bool CWaet::SetAddressBook(const CTxDestination& address, const std::string& strName, const std::string& strPurpose)
{
    WaetBatch batch(GetDatabase());
    return SetAddressBookWithDB(batch, address, strName, strPurpose);
}
bool CWaet::DelAddressBook(const CTxDestination& address)
{
    bool is_mine;
    WaetBatch batch(GetDatabase());
    {
        LOCK(cs_);
        //  we want to delete receiving addresses, we need to take care that DestData "used" (and possibly newer DestData) gets preserved (and the "deleted" address transformed into a change entry instead of actuay being deleted)
        // NOTE: This isn't a problem for sending addresses because they never have any DestData yet!