diff --git a/locales/en.json b/locales/en.json index 641f8b544..0e07e9832 100644 --- a/locales/en.json +++ b/locales/en.json @@ -755,9 +755,6 @@ }, "zmqRawTx": { "title": "Set bitcoind ZMQ Raw Tx Host" - }, - "p2tr": { - "title": "Enable receiving on-chain via Taproot (P2TR)" } }, "LN": { diff --git a/src/state/OnChain.ts b/src/state/OnChain.ts index b3d59fc1d..ef23e5e67 100644 --- a/src/state/OnChain.ts +++ b/src/state/OnChain.ts @@ -22,7 +22,7 @@ export interface ISetTransactionsPayload { export interface IGetAddressPayload { forceNew?: boolean; - p2sh?: boolean; + p2wkh?: boolean; } export interface ISendCoinsPayload { @@ -140,30 +140,22 @@ export const onChain: IOnChainModel = { actions.setUnconfirmedBalance(walletBalanceResponse); }), - getAddress: thunk(async (actions, { forceNew, p2sh }, { injections, getStoreState }) => { + getAddress: thunk(async (actions, { forceNew, p2wkh }, { injections }) => { try { const { newAddress } = injections.lndMobile.onchain; let type: lnrpc.AddressType; if (forceNew) { - if (p2sh) { - type = lnrpc.AddressType.NESTED_PUBKEY_HASH; + if (p2wkh) { + type = lnrpc.AddressType.WITNESS_PUBKEY_HASH; } else { - if (getStoreState().settings.receiveViaP2TR) { - type = lnrpc.AddressType.TAPROOT_PUBKEY; - } else { - type = lnrpc.AddressType.WITNESS_PUBKEY_HASH; - } + type = lnrpc.AddressType.TAPROOT_PUBKEY; } } else { - if (p2sh) { - type = lnrpc.AddressType.UNUSED_NESTED_PUBKEY_HASH; + if (p2wkh) { + type = lnrpc.AddressType.UNUSED_WITNESS_PUBKEY_HASH; } else { - if (getStoreState().settings.receiveViaP2TR) { - type = lnrpc.AddressType.UNUSED_TAPROOT_PUBKEY; - } else { - type = lnrpc.AddressType.UNUSED_WITNESS_PUBKEY_HASH; - } + type = lnrpc.AddressType.UNUSED_TAPROOT_PUBKEY; } } diff --git a/src/state/Settings.ts b/src/state/Settings.ts index b002ef3bb..37059b9bf 100644 --- a/src/state/Settings.ts +++ b/src/state/Settings.ts @@ -78,7 +78,6 @@ export interface ISettingsModel { changeLndNoGraphCache: Thunk; changeInvoiceExpiry: Thunk; changeRescanWallet: Thunk; - changeReceiveViaP2TR: Thunk; changeStrictGraphPruningEnabled: Thunk; changeLndPathfindingAlgorithm: Thunk; changeMaxLNFeePercentage: Thunk; @@ -124,7 +123,6 @@ export interface ISettingsModel { setLndNoGraphCache: Action; setInvoiceExpiry: Action; setRescanWallet: Action; - setReceiveViaP2TR: Action; setStrictGraphPruningEnabled: Action; setLndPathfindingAlgorithm: Action; setMaxLNFeePercentage: Action; @@ -169,7 +167,6 @@ export interface ISettingsModel { lndNoGraphCache: boolean; invoiceExpiry: number; rescanWallet: boolean; - receiveViaP2TR: boolean; strictGraphPruningEnabled: boolean; lndPathfindingAlgorithm: routerrpcEstimator; maxLNFeePercentage: number; @@ -243,7 +240,6 @@ export const settings: ISettingsModel = { (await getItemObject(StorageItem.invoiceExpiry)) ?? DEFAULT_INVOICE_EXPIRY, ); actions.setRescanWallet(await getRescanWallet()); - actions.setReceiveViaP2TR((await getItemObject(StorageItem.receiveViaP2TR)) ?? false); actions.setStrictGraphPruningEnabled( (await getItemObject(StorageItem.strictGraphPruningEnabled)) ?? false, ); @@ -447,12 +443,6 @@ export const settings: ISettingsModel = { actions.setRescanWallet(payload); }), - changeReceiveViaP2TR: thunk(async (actions, payload, { getStoreActions }) => { - await setItemObject(StorageItem.receiveViaP2TR, payload); - actions.setReceiveViaP2TR(payload); - await getStoreActions().onChain.getAddress({}); - }), - changeStrictGraphPruningEnabled: thunk(async (actions, payload) => { await setItemObject(StorageItem.strictGraphPruningEnabled, payload); actions.setStrictGraphPruningEnabled(payload); @@ -605,9 +595,6 @@ export const settings: ISettingsModel = { setRescanWallet: action((state, payload) => { state.rescanWallet = payload; }), - setReceiveViaP2TR: action((state, payload) => { - state.receiveViaP2TR = payload; - }), setStrictGraphPruningEnabled: action((state, payload) => { state.strictGraphPruningEnabled = payload; }), @@ -673,7 +660,6 @@ export const settings: ISettingsModel = { lndNoGraphCache: false, invoiceExpiry: DEFAULT_INVOICE_EXPIRY, rescanWallet: false, - receiveViaP2TR: false, strictGraphPruningEnabled: false, lndPathfindingAlgorithm: DEFAULT_PATHFINDING_ALGORITHM, maxLNFeePercentage: DEFAULT_MAX_LN_FEE_PERCENTAGE, diff --git a/src/storage/app.ts b/src/storage/app.ts index 073315e46..ed0620e8b 100644 --- a/src/storage/app.ts +++ b/src/storage/app.ts @@ -73,7 +73,6 @@ export enum StorageItem { // const enums not supported in Babel 7... lndNoGraphCache = "lndNoGraphCache", invoiceExpiry = "invoiceExpiry", // in seconds rescanWallet = "rescanWallet", - receiveViaP2TR = "receiveViaP2TR", strictGraphPruningEnabled = "strictGraphPruningEnabled", lndPathfindingAlgorithm = "lndPathfindingAlgorithm", maxLNFeePercentage = "maxLNFeePercentage", @@ -176,7 +175,6 @@ export const clearApp = async () => { removeItem(StorageItem.lndNoGraphCache), removeItem(StorageItem.invoiceExpiry), removeItem(StorageItem.rescanWallet), - removeItem(StorageItem.receiveViaP2TR), removeItem(StorageItem.strictGraphPruningEnabled), removeItem(StorageItem.lndPathfindingAlgorithm), removeItem(StorageItem.maxLNFeePercentage), @@ -262,7 +260,6 @@ export const setupApp = async () => { setItemObject(StorageItem.lndNoGraphCache, false), setItemObject(StorageItem.invoiceExpiry, DEFAULT_INVOICE_EXPIRY), setItemObject(StorageItem.rescanWallet, false), - setItemObject(StorageItem.receiveViaP2TR, false), setItemObject(StorageItem.strictGraphPruningEnabled, false), setItem(StorageItem.lndPathfindingAlgorithm, DEFAULT_PATHFINDING_ALGORITHM), setItemObject(StorageItem.maxLNFeePercentage, DEFAULT_MAX_LN_FEE_PERCENTAGE), diff --git a/src/windows/OnChain/OnChainInfo.tsx b/src/windows/OnChain/OnChainInfo.tsx index f0fe30371..3b90b26c8 100644 --- a/src/windows/OnChain/OnChainInfo.tsx +++ b/src/windows/OnChain/OnChainInfo.tsx @@ -59,7 +59,7 @@ export const OnChainInfo = ({ navigation }: IOnChainInfoProps) => { }, [navigation]); const onGeneratePress = async () => await getAddress({ forceNew: true }); - const onGenerateP2SHPress = async () => await getAddress({ forceNew: true, p2sh: true }); + const onGenerateP2WPKHPress = async () => await getAddress({ forceNew: true, p2wkh: true }); const onWithdrawPress = () => navigation.navigate("Withdraw"); @@ -134,7 +134,7 @@ export const OnChainInfo = ({ navigation }: IOnChainInfoProps) => { disabled={!rpcReady} style={style.button} onPress={onGeneratePress} - onLongPress={() => onGenerateP2SHPress()} + onLongPress={() => onGenerateP2WPKHPress()} > {t("newAddress.title")} diff --git a/src/windows/Settings/Settings.tsx b/src/windows/Settings/Settings.tsx index 254aa8e8d..b9377f619 100644 --- a/src/windows/Settings/Settings.tsx +++ b/src/windows/Settings/Settings.tsx @@ -1157,13 +1157,6 @@ ${t("experimental.tor.disabled.msg2")}`; await changeDunderEnabled(!dunderEnabled); }; - // Enable Receive by P2TR - const receiveViaP2TR = useStoreState((store) => store.settings.receiveViaP2TR); - const changeReceiveViaP2TR = useStoreActions((store) => store.settings.changeReceiveViaP2TR); - const onToggleReceiveViaP2TR = async () => { - await changeReceiveViaP2TR(!receiveViaP2TR); - }; - // Set Max LN Fee Percentage const maxLNFeePercentage = useStoreState((store) => store.settings.maxLNFeePercentage); const changeMaxLNFeePercentage = useStoreActions( @@ -1865,18 +1858,6 @@ ${t("experimental.tor.disabled.msg2")}`; )} - - - - - - {t("bitcoinNetwork.p2tr.title")} - - - - - - {t("LN.title")}