Error when attempting signet offboarding

I am experimenting with the signet demo. I had successfully bought some Kibbles 'n Bits, and then refreshed the vtxo. After the round I ran $ bark vtxos and confirmed I had a “vtxo_type”: “round”

I then ran $ bark offboard --all and encountered the following error

Couldn’t broadcast round tx: HttpResponse { status: 400, message: “sendrawtransaction RPC error -25: bad-txns-inputs-missingorspent” }

When I checked my balance (with $ bark balance) all my signet coins were gone.

Full log from console here:

Are you running bark with esplora or bitcoind backend?

It seems that the round tx the server made has an input that your backend doesn’t know about. But that should be resolved by just waiting for the tx to propagate and check your balance shortly after.

If you go back now and try bark balance, does it still not show your balance as onchain?

bark esplora

I just ran bark balance again and the balance is still 0

{
“onchain_sat”: 0,
“offchain_sat”: 0,
“pending_exit_sat”: 0
}

Sorry to hear that. We’ve been experiencing some issues with BDK not dealing well with txs that are double spent. Also some crossover from our sweeper code (that sometimes makes double spends on purpose) and our round scheduler, which might have caused a few round txs to have been lost. We have since mitigated this issue but are further separating the different subsystems to avoid similar issues in the future.

I think your best bet is to try again, we’re up and running again. I could send you some sats if you like :slight_smile: Apologies for the unfortunate experience and thanks for the patience.

No problem, that’s what Alpha’s are for!

I’ve given it a second try, this time I encountered an issue where I attempted to pay an expired LN invoice. As a result the vtxo appears to be marked as spent, meaning I can’t spend it (despite it being listed when I run $ bark vtxos)

Summary of actions
---
bark vtxo-pubkey
bark balance (10,000 offchain_sat)
bark vtxos (1, 10,000 sat arkoor vtxo)
bark refresh --all
    first attempt: error in event stream
    second attempt: successfully refreshed (in rounc 7fa7fbdb15de4d1ba6a661801737b9e56adef2655c670d835cd14e4af7c1b4ab)
bark send <lninvoice>
    first attempt: payment failed to to expired invoice 
    second attempt: payment error "bad user input: attempted to sign OOR for already spent vtxo 2646...4e28"
bark vtxos
    lists vtxo with id 2646...4e28

full log

[16:03:55.671  INFO] Connecting to ASP using TLS...
[16:03:55.992  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[16:03:55.994  INFO] Syncing wallet...
{
  "onchain_sat": 0,
  "offchain_sat": 10000,
  "pending_exit_sat": 0
}
$ bark vtxos

[16:04:07.153  INFO] Connecting to ASP using TLS...
[16:04:07.470  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[16:04:07.471  INFO] Syncing wallet...
[
  {
    "id": "74dc7bcde2b387aae0087fcd8527b5dc5a0bcdff2868adeb32673364db58defd:0",
    "amount_sat": 10000,
    "vtxo_type": "arkoor",
    "utxo": "74dc7bcde2b387aae0087fcd8527b5dc5a0bcdff2868adeb32673364db58defd:0",
    "user_pubkey": "0245cfe5bd5474fdb4ffd4e112cb37ccc035d30c6143b822bf535d6fcb05b7f9a1",
    "asp_pubkey": "02aea88345a06cb27d3a3179cdda14dc2d7398e4c8cdcea4892364187c807aae1e",
    "expiry_height": 241084,
    "exit_delta": 12
  }
]
$ bark refresh --all

[16:04:25.472  INFO] Connecting to ASP using TLS...
[16:04:25.790  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[16:04:25.792  INFO] Syncing wallet...
[16:04:26.647  INFO] Refreshing 1 vtxos...
[16:04:26.650  INFO] Waiting for a round start...
An error occurred: round failed
Caused by:
	received error on event stream
	status: Internal, message: "h2 protocol error: error reading a body from connection", details: [], metadata: MetadataMap { headers: {} }
	error reading a body from connection
	stream error received: unexpected internal error encountered
$ bark refresh --all

[16:48:30.260  INFO] Connecting to ASP using TLS...
[16:48:30.658  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[16:48:30.661  INFO] Syncing wallet...
[16:48:31.664  INFO] Refreshing 1 vtxos...
[16:48:31.668  INFO] Waiting for a round start...
[16:50:58.374  INFO] Round started
[16:51:00.387  INFO] Sending 2 partial vtxo cosign signatures for pk 03983018aa497d239c3a75d3511846d9add265425aa4b478288cbe5398b8a02c38
[16:51:00.521  INFO] Broadcasting round tx 7fa7fbdb15de4d1ba6a661801737b9e56adef2655c670d835cd14e4af7c1b4ab
[16:51:00.736  INFO] Round finished
{
  "participate_round": true,
  "round": "7fa7fbdb15de4d1ba6a661801737b9e56adef2655c670d835cd14e4af7c1b4ab"
}
$ bark send lntbs1u1pn793sgsp5uent3qvpm6leqyk9m7yelgdypdhc94q8tkv2v3w9eygr3dvn0w5spp5mmuqwajzpxvn65rjquj2l97l7fjfjggyt7e22eqa66g72ukem75sdq4g9exkgznw3hhyefqyvcnxxqzjccqp29qxpqysgq2j3gzm5aup6fhs8g4ngghnglca6dqvqz27qj3jh92exf5avgj5d3h0km6fne8yqxqw3kfdkf0dplaq3gsg8x45fwxn5s8pvxh8wul5qqyslguf
[16:51:23.795  INFO] Connecting to ASP using TLS...
[16:51:24.117  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[16:51:24.120  INFO] Syncing wallet...
[16:51:25.123  INFO] Sending bolt11 payment of 0.00000100 BTC to invoice lntbs1u1pn793sgsp5uent3qvpm6leqyk9m7yelgdypdhc94q8tkv2v3w9eygr3dvn0w5spp5mmuqwajzpxvn65rjquj2l97l7fjfjggyt7e22eqa66g72ukem75sdq4g9exkgznw3hhyefqyvcnxxqzjccqp29qxpqysgq2j3gzm5aup6fhs8g4ngghnglca6dqvqz27qj3jh92exf5avgj5d3h0km6fne8yqxqw3kfdkf0dplaq3gsg8x45fwxn5s8pvxh8wul5qqyslguf
[16:51:25.199  INFO] Adding change VTXO of 0.00009570 BTC
An error occurred: Payment failed: Payment failed: status: Unknown, message: "Error calling method Pay: RpcError { code: Some(207), message: \"Invoice expired\", data: None }", details: [], metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Tue, 25 Mar 2025 15:51:25 GMT", "content-length": "0"} }
$ bark send lntbs1u1pn795g2sp5tzewk2rwc77t5x9vznn2kq3cjutzgjlz5ufw3pcvphhj9y5svs9spp53mcdqxs662cpsmfy34y0xw7aknhky74zcx7mt06kv0vlku032prsdq4g9exkgznw3hhyefqyvcn2xqzjccqp29qxpqysgqef47lg9tx8y7chm7lk9lsphp2nsjj0wlwrfdrr99u2g4jf9f7wtzrk0nrc6w9he6au6kh55ptv8kt5dxvnquaksz8gpnzu67msqexjgqe9p7kk
[16:51:52.401  INFO] Connecting to ASP using TLS...
[16:51:52.725  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[16:51:52.727  INFO] Syncing wallet...
[16:51:53.763  INFO] Sending bolt11 payment of 0.00000100 BTC to invoice lntbs1u1pn795g2sp5tzewk2rwc77t5x9vznn2kq3cjutzgjlz5ufw3pcvphhj9y5svs9spp53mcdqxs662cpsmfy34y0xw7aknhky74zcx7mt06kv0vlku032prsdq4g9exkgznw3hhyefqyvcn2xqzjccqp29qxpqysgqef47lg9tx8y7chm7lk9lsphp2nsjj0wlwrfdrr99u2g4jf9f7wtzrk0nrc6w9he6au6kh55ptv8kt5dxvnquaksz8gpnzu67msqexjgqe9p7kk
An error occurred: htlc request failed
Caused by:
	status: InvalidArgument, message: "error making payment: bad user input: attempted to sign OOR for already spent vtxo 26461b5bdf339b757d7403ddf2a5a6ce1a57094f8150ec043cd44ce5ba444e28:0", details: [], metadata: MetadataMap { headers: {"server": "openresty", "date": "Tue, 25 Mar 2025 15:51:53 GMT", "content-type": "application/grpc", "content-length": "0", "x-served-by": "ark.signet.2nd.dev"} }
$ bark vtxos
[16:52:10.394  INFO] Connecting to ASP using TLS...
[16:52:10.711  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[16:52:10.713  INFO] Syncing wallet...
[
  {
    "id": "26461b5bdf339b757d7403ddf2a5a6ce1a57094f8150ec043cd44ce5ba444e28:0",
    "amount_sat": 10000,
    "vtxo_type": "round",
    "utxo": "26461b5bdf339b757d7403ddf2a5a6ce1a57094f8150ec043cd44ce5ba444e28:0",
    "user_pubkey": "023426578ac6c1be58047b0c88222765f7edc6dcf2252b34814ad049a5747cb41d",
    "asp_pubkey": "02aea88345a06cb27d3a3179cdda14dc2d7398e4c8cdcea4892364187c807aae1e",
    "expiry_height": 241096,
    "exit_delta": 12
  }
]
$ bark vtxos
[17:33:43.331  INFO] Connecting to ASP using TLS...
[17:33:43.721  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[17:33:43.724  INFO] Syncing wallet...
[
  {
    "id": "26461b5bdf339b757d7403ddf2a5a6ce1a57094f8150ec043cd44ce5ba444e28:0",
    "amount_sat": 10000,
    "vtxo_type": "round",
    "utxo": "26461b5bdf339b757d7403ddf2a5a6ce1a57094f8150ec043cd44ce5ba444e28:0",
    "user_pubkey": "023426578ac6c1be58047b0c88222765f7edc6dcf2252b34814ad049a5747cb41d",
    "asp_pubkey": "02aea88345a06cb27d3a3179cdda14dc2d7398e4c8cdcea4892364187c807aae1e",
    "expiry_height": 241096,
    "exit_delta": 12
  }
]
$ bark send lntbs10u1pn79kklsp5yh73sq4hfh0pmx606yavt9ccgrpyaqlmwzcxd3h6jj0al7zh5wgqpp5ldhxcr7ggw4pnjm6le60akrd4lxf055vrq5zqcp49ww5dgapmf9qdq4g9exkgznw3hhyefqyvergxqzjccqp29qxpqysgqm9gvshlzqwwcndgj5ytk03940s4yqm4cnc0gqactxg5afq55jxnyst2uh4t3v4y3893day6hp002cyl0d7uu858ld8z732grt336u4qph5apm0
[17:33:48.725  INFO] Connecting to ASP using TLS...
[17:33:49.040  WARN] Message from Ark server: "We are doing some maintenance. Round time has been reduced to once every 15 minutes"
[17:33:49.043  INFO] Syncing wallet...
[17:33:50.086  INFO] Sending bolt11 payment of 0.00001000 BTC to invoice lntbs10u1pn79kklsp5yh73sq4hfh0pmx606yavt9ccgrpyaqlmwzcxd3h6jj0al7zh5wgqpp5ldhxcr7ggw4pnjm6le60akrd4lxf055vrq5zqcp49ww5dgapmf9qdq4g9exkgznw3hhyefqyvergxqzjccqp29qxpqysgqm9gvshlzqwwcndgj5ytk03940s4yqm4cnc0gqactxg5afq55jxnyst2uh4t3v4y3893day6hp002cyl0d7uu858ld8z732grt336u4qph5apm0
An error occurred: htlc request failed
Caused by:
	status: InvalidArgument, message: "error making payment: bad user input: attempted to sign OOR for already spent vtxo 26461b5bdf339b757d7403ddf2a5a6ce1a57094f8150ec043cd44ce5ba444e28:0", details: [], metadata: MetadataMap { headers: {"server": "openresty", "date": "Tue, 25 Mar 2025 16:33:50 GMT", "content-type": "application/grpc", "content-length": "0", "x-served-by": "ark.signet.2nd.dev"} }

So basically, since the LN invoice was expired, the payment failed. Failing Lightning payment is a case we don’t handle yet (because we are on Signet, we weren’t expecting failures on the lightning side).

A payment from the Ark to Lightning, creates 2 outputs, an HTLC output holding the amount sent, and a change output.

It’s a special kind of HTLC, with 3 clauses:

  • A+S : where A is Alice’s pk and S is Server’s
  • S + preimage + (Texpiry + exit) : where Texpiry is the VTXO expiry and exit is a block delta
  • A + (Texpiry + 2x exit)

When the LN payment fails, client won’t get the preimage and thus needs to ask for payment revocation. Revocation implies asking the Ark Server to cosign a new transaction spending the HTLC output back into an arkoor (using the 1rst clause). This ensure that if ever a transaction spending the HTLC (using second clause) gets broadcasted by the Server afterwards, the user will have priority over it.

If the server refuse to cosign the revocation, client needs to go onchain to either spend the HTLC after timelock (using third clause), or force the Server to disclose the preimage.

You can find an open PR to make this a reality here

1 Like