Skip to content

Commit 3104057

Browse files
sangbidarustyrussell
authored andcommitted
schema: update schema to remove bip86 and add mnemonic to expose secret
This schema change updates newaddr to remove bip86 which was previously added, since don't want to make unnecessary schema changes this is being removed. The generated files for the exposesecret schema change are also being added
1 parent 5f67e7d commit 3104057

File tree

3 files changed

+15
-40
lines changed

3 files changed

+15
-40
lines changed

contrib/msggen/msggen/schema.json

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27135,13 +27135,12 @@
2713527135
"addresstype": {
2713627136
"type": "string",
2713727137
"description": [
27138-
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), *p2tr* taproot addresses, or *bip86* for BIP86-derived taproot addresses. The special value *all* generates all known address types for the same underlying key."
27138+
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
2713927139
],
2714027140
"default": "*bech32* address",
2714127141
"enum": [
2714227142
"bech32",
2714327143
"p2tr",
27144-
"bip86",
2714527144
"all"
2714627145
]
2714727146
}
@@ -27155,7 +27154,7 @@
2715527154
"added": "v23.08",
2715627155
"type": "string",
2715727156
"description": [
27158-
"The taproot address (returned for both 'p2tr' and 'bip86' addresstype)."
27157+
"The taproot address."
2715927158
]
2716027159
},
2716127160
"bech32": {
@@ -27203,18 +27202,6 @@
2720327202
"response": {
2720427203
"p2tr": "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
2720527204
}
27206-
},
27207-
{
27208-
"request": {
27209-
"id": "example:newaddr#3",
27210-
"method": "newaddr",
27211-
"params": {
27212-
"addresstype": "bip86"
27213-
}
27214-
},
27215-
"response": {
27216-
"p2tr": "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
27217-
}
2721827205
}
2721927206
]
2722027207
},

doc/schemas/newaddr.json

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
"addresstype": {
1818
"type": "string",
1919
"description": [
20-
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), *p2tr* taproot addresses, or *bip86* for BIP86-derived taproot addresses. The special value *all* generates all known address types for the same underlying key."
20+
"It specifies the type of address wanted; currently *bech32* (e.g. `tb1qu9j4lg5f9rgjyfhvfd905vw46eg39czmktxqgg` on bitcoin testnet or `bc1qwqdg6squsna38e46795at95yu9atm8azzmyvckulcc7kytlcckxswvvzej` on bitcoin mainnet), or *p2tr* taproot addresses. The special value *all* generates all known address types for the same underlying key."
2121
],
2222
"default": "*bech32* address",
2323
"enum": [
2424
"bech32",
2525
"p2tr",
26-
"bip86",
2726
"all"
2827
]
2928
}
@@ -37,7 +36,7 @@
3736
"added": "v23.08",
3837
"type": "string",
3938
"description": [
40-
"The taproot address (returned for both 'p2tr' and 'bip86' addresstype)."
39+
"The taproot address."
4140
]
4241
},
4342
"bech32": {
@@ -85,18 +84,6 @@
8584
"response": {
8685
"p2tr": "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
8786
}
88-
},
89-
{
90-
"request": {
91-
"id": "example:newaddr#3",
92-
"method": "newaddr",
93-
"params": {
94-
"addresstype": "bip86"
95-
}
96-
},
97-
"response": {
98-
"p2tr": "bcrt1p2gppccw6ywewmg74qqxxmqfdpjds3rpr0mf22y9tm9xcc0muggwsea9nkf"
99-
}
10087
}
10188
]
10289
}

tests/test_misc.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,12 @@ def test_htlc_in_timeout(node_factory, bitcoind, executor):
562562

563563

564564
@unittest.skipIf(TEST_NETWORK == 'liquid-regtest', 'must be on bitcoin network')
565-
def test_bech32_funding(node_factory, chainparams):
565+
def test_p2tr_funding(node_factory, chainparams):
566566
# Don't get any funds from previous runs.
567567
l1, l2 = node_factory.line_graph(2, opts={'random_hsm': True}, fundchannel=False)
568568

569-
# fund a bech32 address and then open a channel with it
570-
res = l1.openchannel(l2, 25000, 'bech32')
569+
# fund a p2tr address and then open a channel with it
570+
res = l1.openchannel(l2, 25000, 'p2tr')
571571
address = res['address']
572572
assert address.startswith(chainparams['bip173_prefix'])
573573

@@ -577,11 +577,11 @@ def test_bech32_funding(node_factory, chainparams):
577577
wallettx = l1.bitcoin.rpc.getrawtransaction(wallettxid, True)
578578
fundingtx = l1.bitcoin.rpc.decoderawtransaction(res['fundingtx'])
579579

580-
def is_p2wpkh(output):
581-
return output['type'] == 'witness_v0_keyhash' and \
580+
def is_p2tr(output):
581+
return output['type'] == 'witness_v1_taproot' and \
582582
address == scriptpubkey_addr(output)
583583

584-
assert any(is_p2wpkh(output['scriptPubKey']) for output in wallettx['vout'])
584+
assert any(is_p2tr(output['scriptPubKey']) for output in wallettx['vout'])
585585
assert only_one(fundingtx['vin'])['txid'] == res['wallettxid']
586586

587587

@@ -644,7 +644,7 @@ def dont_spend_outputs(n, txid):
644644
dont_spend_outputs(l1, out['txid'])
645645

646646
# Now send some money to l2.
647-
waddr = l2.rpc.newaddr('bech32')['bech32']
647+
waddr = l2.rpc.newaddr('p2tr')['p2tr']
648648
out = l1.rpc.withdraw(waddr, amount)
649649
bitcoind.generate_block(1)
650650

@@ -732,7 +732,7 @@ def dont_spend_outputs(n, txid):
732732
l1.rpc.unreserveinputs(bitcoind.rpc.createpsbt(inputs, []))
733733

734734
# Test withdrawal to self.
735-
l1.rpc.withdraw(l1.rpc.newaddr('bech32')['bech32'], 'all', minconf=0)
735+
l1.rpc.withdraw(l1.rpc.newaddr('p2tr')['p2tr'], 'all', minconf=0)
736736
bitcoind.generate_block(1)
737737
assert l1.db_query('SELECT COUNT(*) as c FROM outputs WHERE status=0')[0]['c'] == 1
738738

@@ -747,12 +747,13 @@ def dont_spend_outputs(n, txid):
747747
sync_blockheight(bitcoind, [l1])
748748
assert account_balance(l1, 'wallet') == 0
749749

750+
# randomHsm now uses p2tr addresses and have a different transaction weight than non-p2tr addresses
750751
external_moves = [
751752
{'type': 'chain_mvt', 'credit_msat': 2000000000, 'debit_msat': 0, 'tags': ['deposit']},
752753
{'type': 'chain_mvt', 'credit_msat': 2000000000, 'debit_msat': 0, 'tags': ['deposit']},
753754
{'type': 'chain_mvt', 'credit_msat': 2000000000, 'debit_msat': 0, 'tags': ['deposit']},
754755
{'type': 'chain_mvt', 'credit_msat': 2000000000, 'debit_msat': 0, 'tags': ['deposit']},
755-
{'type': 'chain_mvt', 'credit_msat': 11957393000, 'debit_msat': 0, 'tags': ['deposit']},
756+
{'type': 'chain_mvt', 'credit_msat': 11960055000, 'debit_msat': 0, 'tags': ['deposit']},
756757
]
757758

758759
check_coin_moves(l1, 'external', external_moves, chainparams)
@@ -1342,7 +1343,7 @@ def test_blockchaintrack(node_factory, bitcoind):
13421343
"""Check that we track the blockchain correctly across reorgs
13431344
"""
13441345
l1 = node_factory.get_node(random_hsm=True)
1345-
addr = l1.rpc.newaddr(addresstype='all')['bech32']
1346+
addr = l1.rpc.newaddr(addresstype='all')['p2tr']
13461347

13471348
######################################################################
13481349
# First failure scenario: rollback on startup doesn't work,

0 commit comments

Comments
 (0)