Repository navigation
embedded: add an in-process transport - #197
Merged
Merged
Conversation
This was referenced Nov 11, 2026
darioAnongba
marked this pull request as ready for review
November 12, 2026 13:42
darioAnongba
force-pushed
the
darioAnongba/embedded-engine
branch
3 times, most recently
from
November 13, 2026 16:34
f2aee67 to
a927e53
Compare
The embedded engine calls tapsend.ValidateAnchoredPackets, tapsend.CommitPackets and proof.AppendConfirmedSuffix, and signs with asset.SignDescriptor.
NewClientFromConn builds the gRPC client over an established connection, such as an in-process one, and sends no macaroons.
The embedded transport takes what a tapd would take from lnd and its database through three ports. MemoryStore is a store for tests, and localConn routes gRPC calls to services in the same process.
The engine answers the tapd calls a wallet needs inside the host process: proof verification, asset keys, owned outputs, and the signing, sealing and publishing of caller-funded transfers. It writes the final proofs once an anchor transaction confirms, follows it through re-orgs and resumes after a restart.
The engine runs in browsers, so its tests also run under Node with GOOS=js GOARCH=wasm.
GetBalance and ListBalances probe the universe to tell a known asset with no balance from an unknown one. When the backend answers the probe with Unimplemented, the wallet's own records decide: an asset it holds or has spent is known.
The engine sums the wallet's unspent asset outputs by asset ID or by group key, with tapd's filters and its count of pending transfers. Wallet.GetBalance and Wallet.ListBalances work on the embedded transport.
darioAnongba
force-pushed
the
darioAnongba/embedded-engine
branch
from
November 13, 2026 17:23
a927e53 to
2c48bcd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
embeddedpackage is a third transport next togrpcandrest. It implementstapsdk.Clientinside the host process, so a wallet can hold, verify and move Taproot Assets with no tapd and no lnd beside it. The host supplies three ports: aStorefor keys, proof files and transfers, aKeyRing(lnd'skeychain.SecretKeyRingfits) and aChainfor block headers, broadcast and confirmations.The engine implements the subset of tapd's gRPC services a wallet needs and serves it over an in-process connection, under the existing gRPC client code. Both backends therefore share request validation, marshalling and error statuses. Every asset rule is a call into tapd's packages; the engine adds storage and the order of the calls.
VerifyProofchecks a file against the chain port's headers and the trusted asset groups.InsertProoffollowed byRegisterTransferimports a received asset, soWallet.ImportProofFileworks unchanged.ListBalancessums the wallet's unspent outputs by asset ID or by group key. The engine has no universe, soWallet.GetBalanceandWallet.ListBalancestreat an asset as known when the wallet holds or has spent an output of it.SignVirtualPsbt,CommitVirtualPsbtsandPublishAndLogTransfercover the custom-anchor flow for caller-funded anchor transactions, including signing the anchor inputs the wallet owns. A transfer is recorded before it is broadcast. The engine writes the final proofs when the anchor transaction confirms, follows it through re-orgs, and resumes after a restart.BackendLightweight, supports backend anchor signing and local verification, and reports wallet funding as unsupported, since the engine holds no Bitcoin.codes.Unimplemented: minting, universe queries, address sends, burns and event streams.The package builds for js/wasm, and
make unit-wasmwith its CI job runs the engine's tests there.docs/design/embedded-transport.mdrecords the design.go.modpins tapd main, which carries the helpers the engine calls (lightninglabs/taproot-assets#2387). #198 runs the engine against tapd in the itest stack.