2024-01-15 13:35:14 -08:00
{
"$schema" : "../rpc-schema-draft.json" ,
"type" : "object" ,
"rpc" : "newaddr" ,
"title" : "Command for generating a new address to be used by Core Lightning" ,
"description" : [
"The **newaddr** RPC command generates a new address which can subsequently be used to fund channels managed by the Core Lightning node." ,
"" ,
"The funding transaction needs to be confirmed before funds can be used." ,
"" ,
"To send an on-chain payment from the Core Lightning node wallet, use `withdraw`."
] ,
"request" : {
"required" : [ ] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"addresstype" : {
"type" : "string" ,
"description" : [
"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."
] ,
"default" : "*bech32* address" ,
"enum" : [
"bech32" ,
"p2tr" ,
"all"
]
}
}
} ,
"response" : {
"required" : [ ] ,
2024-10-30 09:38:42 +10:30
"additionalProperties" : false ,
2024-01-15 13:35:14 -08:00
"properties" : {
"p2tr" : {
"added" : "v23.08" ,
"type" : "string" ,
"description" : [
"The taproot address."
]
} ,
"bech32" : {
"type" : "string" ,
"description" : [
"The bech32 (native segwit) address."
]
}
}
} ,
"errors" : [
"If an unrecognized address type is requested an error message will be returned."
] ,
2024-06-20 14:57:02 -07:00
"author" : [
"Felix <<fixone@gmail.com>> is mainly responsible."
] ,
"see_also" : [
"lightning-listfunds(7)" ,
"lightning-fundchannel(7)" ,
"lightning-withdraw(7)" ,
"lightning-listtransactions(7)"
] ,
"resources" : [
"Main web site: <https://github.com/ElementsProject/lightning>"
] ,
"examples" : [
2024-01-15 13:35:14 -08:00
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:newaddr#1" ,
"method" : "newaddr" ,
2024-06-18 14:49:51 -07:00
"params" : { }
2024-03-27 18:45:18 -07:00
} ,
"response" : {
2024-07-18 00:28:22 -07:00
"bech32" : "bcrt1qcqqvkswps3e6ck3jmqf86f9tcaeke5z04d3tv4"
2024-01-15 13:35:14 -08:00
}
} ,
{
2024-03-27 18:45:18 -07:00
"request" : {
"id" : "example:newaddr#2" ,
"method" : "newaddr" ,
"params" : {
2024-07-18 00:28:22 -07:00
"addresstype" : "p2tr"
2024-03-27 18:45:18 -07:00
}
} ,
"response" : {
2024-07-18 00:28:22 -07:00
"p2tr" : "bcrt1phtprcvhz842sxe8qw0yryvc0g6n6dw2puweklcpnfye273kjpfhs0d6d2e"
2024-01-15 13:35:14 -08:00
}
}
]
}